From 565ca6a1f50f83d126422471a326aae7ce623907 Mon Sep 17 00:00:00 2001 From: Georgios Kalpakas Date: Sat, 17 Dec 2016 15:36:22 +0200 Subject: [PATCH 001/745] chore(benchmarks): add basic animation benchmark --- benchmarks/animation-bp/app.js | 44 ++++++++++++++++++++++++++ benchmarks/animation-bp/bp.conf.js | 22 +++++++++++++ benchmarks/animation-bp/jquery-noop.js | 1 + benchmarks/animation-bp/main.html | 28 ++++++++++++++++ 4 files changed, 95 insertions(+) create mode 100644 benchmarks/animation-bp/app.js create mode 100644 benchmarks/animation-bp/bp.conf.js create mode 100644 benchmarks/animation-bp/jquery-noop.js create mode 100644 benchmarks/animation-bp/main.html diff --git a/benchmarks/animation-bp/app.js b/benchmarks/animation-bp/app.js new file mode 100644 index 000000000000..82a4ca1dd8c9 --- /dev/null +++ b/benchmarks/animation-bp/app.js @@ -0,0 +1,44 @@ +'use strict'; + +angular + .module('animationBenchmark', ['ngAnimate'], config) + .controller('BenchmarkController', BenchmarkController); + +// Functions - Definitions +function config($compileProvider) { + $compileProvider + .commentDirectivesEnabled(false) + .cssClassDirectivesEnabled(false) + .debugInfoEnabled(false); +} + +function BenchmarkController($scope) { + var self = this; + var itemCount = 1000; + var items = (new Array(itemCount + 1)).join('.').split(''); + + benchmarkSteps.push({ + name: 'create', + fn: function() { + $scope.$apply(function() { + self.items = items; + }); + } + }); + + benchmarkSteps.push({ + name: '$digest', + fn: function() { + $scope.$root.$digest(); + } + }); + + benchmarkSteps.push({ + name: 'destroy', + fn: function() { + $scope.$apply(function() { + self.items = []; + }); + } + }); +} diff --git a/benchmarks/animation-bp/bp.conf.js b/benchmarks/animation-bp/bp.conf.js new file mode 100644 index 000000000000..535d6fd5d561 --- /dev/null +++ b/benchmarks/animation-bp/bp.conf.js @@ -0,0 +1,22 @@ +/* eslint-env node */ + +'use strict'; + +module.exports = function(config) { + config.set({ + scripts: [ + { + id: 'jquery', + src: 'jquery-noop.js' + }, { + id: 'angular', + src: '/build/angular.js' + }, { + id: 'angular-animate', + src: '/build/angular-animate.js' + }, { + src: 'app.js' + } + ] + }); +}; diff --git a/benchmarks/animation-bp/jquery-noop.js b/benchmarks/animation-bp/jquery-noop.js new file mode 100644 index 000000000000..8cac7fe4a149 --- /dev/null +++ b/benchmarks/animation-bp/jquery-noop.js @@ -0,0 +1 @@ +// Override me with ?jquery=/bower_components/jquery/dist/jquery.js diff --git a/benchmarks/animation-bp/main.html b/benchmarks/animation-bp/main.html new file mode 100644 index 000000000000..adf0442cae62 --- /dev/null +++ b/benchmarks/animation-bp/main.html @@ -0,0 +1,28 @@ + +
+
+

Large collection of elements animated in and out with ngAnimate

+ +
+
+ Just a plain ol' element +
+
+
+
From e7d8eee46d3ed11fe7054db5e616bd2a8eeb2c1b Mon Sep 17 00:00:00 2001 From: Georgios Kalpakas Date: Thu, 15 Dec 2016 15:04:50 +0200 Subject: [PATCH 002/745] refactor(ngAnimate): simplify functions and remove redundant args/calls Simplifies/Optimizes the following functions: - `areAnimationsAllowed()` - `cleanupEventListeners()` - `closeChildAnimations()` - `clearElementAnimationState()` - `markElementAnimationState()` - `findCallbacks()` Although not its primary aim, this commit also offers a small performance boost to animations (~5% as measured with the `animation-bp` benchmark). --- src/ngAnimate/animateQueue.js | 129 +++++++++++++++------------------- 1 file changed, 58 insertions(+), 71 deletions(-) diff --git a/src/ngAnimate/animateQueue.js b/src/ngAnimate/animateQueue.js index bf99c58d6a05..054559fecfde 100644 --- a/src/ngAnimate/animateQueue.js +++ b/src/ngAnimate/animateQueue.js @@ -36,9 +36,9 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate } } - function isAllowed(ruleType, element, currentAnimation, previousAnimation) { + function isAllowed(ruleType, currentAnimation, previousAnimation) { return rules[ruleType].some(function(fn) { - return fn(element, currentAnimation, previousAnimation); + return fn(currentAnimation, previousAnimation); }); } @@ -48,40 +48,40 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate return and ? a && b : a || b; } - rules.join.push(function(element, newAnimation, currentAnimation) { + rules.join.push(function(newAnimation, currentAnimation) { // if the new animation is class-based then we can just tack that on return !newAnimation.structural && hasAnimationClasses(newAnimation); }); - rules.skip.push(function(element, newAnimation, currentAnimation) { + rules.skip.push(function(newAnimation, currentAnimation) { // there is no need to animate anything if no classes are being added and // there is no structural animation that will be triggered return !newAnimation.structural && !hasAnimationClasses(newAnimation); }); - rules.skip.push(function(element, newAnimation, currentAnimation) { + rules.skip.push(function(newAnimation, currentAnimation) { // why should we trigger a new structural animation if the element will // be removed from the DOM anyway? return currentAnimation.event === 'leave' && newAnimation.structural; }); - rules.skip.push(function(element, newAnimation, currentAnimation) { + rules.skip.push(function(newAnimation, currentAnimation) { // if there is an ongoing current animation then don't even bother running the class-based animation return currentAnimation.structural && currentAnimation.state === RUNNING_STATE && !newAnimation.structural; }); - rules.cancel.push(function(element, newAnimation, currentAnimation) { + rules.cancel.push(function(newAnimation, currentAnimation) { // there can never be two structural animations running at the same time return currentAnimation.structural && newAnimation.structural; }); - rules.cancel.push(function(element, newAnimation, currentAnimation) { + rules.cancel.push(function(newAnimation, currentAnimation) { // if the previous animation is already running, but the new animation will // be triggered, but the new animation is structural return currentAnimation.state === RUNNING_STATE && newAnimation.structural; }); - rules.cancel.push(function(element, newAnimation, currentAnimation) { + rules.cancel.push(function(newAnimation, currentAnimation) { // cancel the animation if classes added / removed in both animation cancel each other out, // but only if the current animation isn't structural @@ -181,10 +181,7 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate return this === arg || !!(this.compareDocumentPosition(arg) & 16); }; - function findCallbacks(parent, element, event) { - var targetNode = getDomNode(element); - var targetParentNode = getDomNode(parent); - + function findCallbacks(targetParentNode, targetNode, event) { var matches = []; var entries = callbackRegistry[event]; if (entries) { @@ -209,11 +206,11 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate }); } - function cleanupEventListeners(phase, element) { - if (phase === 'close' && !element[0].parentNode) { + function cleanupEventListeners(phase, node) { + if (phase === 'close' && !node.parentNode) { // If the element is not attached to a parentNode, it has been removed by // the domOperation, and we can safely remove the event callbacks - $animate.off(element); + $animate.off(node); } } @@ -311,12 +308,9 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate // the input data when running `$animateCss`. var options = copy(initialOptions); - var node, parent; element = stripCommentsFromElement(element); - if (element) { - node = getDomNode(element); - parent = element.parent(); - } + var node = getDomNode(element); + var parentNode = node && node.parentNode; options = prepareAnimationOptions(options); @@ -381,7 +375,7 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate // there is no point in traversing the same collection of parent ancestors if a followup // animation will be run on the same element that already did all that checking work if (!skipAnimations && (!hasExistingAnimation || existingAnimation.state !== PRE_DIGEST_STATE)) { - skipAnimations = !areAnimationsAllowed(element, parent, event); + skipAnimations = !areAnimationsAllowed(node, parentNode, event); } if (skipAnimations) { @@ -393,7 +387,7 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate } if (isStructural) { - closeChildAnimations(element); + closeChildAnimations(node); } var newAnimation = { @@ -408,7 +402,7 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate }; if (hasExistingAnimation) { - var skipAnimationFlag = isAllowed('skip', element, newAnimation, existingAnimation); + var skipAnimationFlag = isAllowed('skip', newAnimation, existingAnimation); if (skipAnimationFlag) { if (existingAnimation.state === RUNNING_STATE) { close(); @@ -418,7 +412,7 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate return existingAnimation.runner; } } - var cancelAnimationFlag = isAllowed('cancel', element, newAnimation, existingAnimation); + var cancelAnimationFlag = isAllowed('cancel', newAnimation, existingAnimation); if (cancelAnimationFlag) { if (existingAnimation.state === RUNNING_STATE) { // this will end the animation right away and it is safe @@ -440,7 +434,7 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate // a joined animation means that this animation will take over the existing one // so an example would involve a leave animation taking over an enter. Then when // the postDigest kicks in the enter will be ignored. - var joinAnimationFlag = isAllowed('join', element, newAnimation, existingAnimation); + var joinAnimationFlag = isAllowed('join', newAnimation, existingAnimation); if (joinAnimationFlag) { if (existingAnimation.state === RUNNING_STATE) { normalizeAnimationDetails(element, newAnimation); @@ -474,7 +468,7 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate if (!isValidAnimation) { close(); - clearElementAnimationState(element); + clearElementAnimationState(node); return runner; } @@ -482,7 +476,7 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate var counter = (existingAnimation.counter || 0) + 1; newAnimation.counter = counter; - markElementAnimationState(element, PRE_DIGEST_STATE, newAnimation); + markElementAnimationState(node, PRE_DIGEST_STATE, newAnimation); $rootScope.$$postDigest(function() { var animationDetails = activeAnimationsLookup.get(node); @@ -523,7 +517,7 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate // isn't allowed to animate from here then we need to clear the state of the element // so that any future animations won't read the expired animation data. if (!isValidAnimation) { - clearElementAnimationState(element); + clearElementAnimationState(node); } return; @@ -535,7 +529,7 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate ? 'setClass' : animationDetails.event; - markElementAnimationState(element, RUNNING_STATE); + markElementAnimationState(node, RUNNING_STATE); var realRunner = $$animation(element, event, animationDetails.options); // this will update the runner's flow-control events based on @@ -547,7 +541,7 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate close(!status); var animationDetails = activeAnimationsLookup.get(node); if (animationDetails && animationDetails.counter === counter) { - clearElementAnimationState(getDomNode(element)); + clearElementAnimationState(node); } notifyProgress(runner, event, 'close', {}); }); @@ -557,7 +551,7 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate function notifyProgress(runner, event, phase, data) { runInNextPostDigestOrNow(function() { - var callbacks = findCallbacks(parent, element, event); + var callbacks = findCallbacks(parentNode, node, event); if (callbacks.length) { // do not optimize this call here to RAF because // we don't know how heavy the callback code here will @@ -567,10 +561,10 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate forEach(callbacks, function(callback) { callback(element, phase, data); }); - cleanupEventListeners(phase, element); + cleanupEventListeners(phase, node); }); } else { - cleanupEventListeners(phase, element); + cleanupEventListeners(phase, node); } }); runner.progress(event, phase, data); @@ -585,8 +579,7 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate } } - function closeChildAnimations(element) { - var node = getDomNode(element); + function closeChildAnimations(node) { var children = node.querySelectorAll('[' + NG_ANIMATE_ATTR_NAME + ']'); forEach(children, function(child) { var state = parseInt(child.getAttribute(NG_ANIMATE_ATTR_NAME), 10); @@ -604,16 +597,11 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate }); } - function clearElementAnimationState(element) { - var node = getDomNode(element); + function clearElementAnimationState(node) { node.removeAttribute(NG_ANIMATE_ATTR_NAME); activeAnimationsLookup.remove(node); } - function isMatchingElement(nodeOrElmA, nodeOrElmB) { - return getDomNode(nodeOrElmA) === getDomNode(nodeOrElmB); - } - /** * This fn returns false if any of the following is true: * a) animations on any parent element are disabled, and animations on the element aren't explicitly allowed @@ -621,54 +609,54 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate * c) the element is not a child of the body * d) the element is not a child of the $rootElement */ - function areAnimationsAllowed(element, parentElement, event) { - var bodyElement = jqLite($document[0].body); - var bodyElementDetected = isMatchingElement(element, bodyElement) || element[0].nodeName === 'HTML'; - var rootElementDetected = isMatchingElement(element, $rootElement); + function areAnimationsAllowed(node, parentNode, event) { + var bodyNode = $document[0].body; + var rootNode = getDomNode($rootElement); + + var bodyNodeDetected = (node === bodyNode) || node.nodeName === 'HTML'; + var rootNodeDetected = (node === rootNode); var parentAnimationDetected = false; + var elementDisabled = disabledElementsLookup.get(node); var animateChildren; - var elementDisabled = disabledElementsLookup.get(getDomNode(element)); - var parentHost = jqLite.data(element[0], NG_ANIMATE_PIN_DATA); + var parentHost = jqLite.data(node, NG_ANIMATE_PIN_DATA); if (parentHost) { - parentElement = parentHost; + parentNode = getDomNode(parentHost); } - parentElement = getDomNode(parentElement); - - while (parentElement) { - if (!rootElementDetected) { + while (parentNode) { + if (!rootNodeDetected) { // angular doesn't want to attempt to animate elements outside of the application // therefore we need to ensure that the rootElement is an ancestor of the current element - rootElementDetected = isMatchingElement(parentElement, $rootElement); + rootNodeDetected = (parentNode === rootNode); } - if (parentElement.nodeType !== ELEMENT_NODE) { + if (parentNode.nodeType !== ELEMENT_NODE) { // no point in inspecting the #document element break; } - var details = activeAnimationsLookup.get(parentElement) || {}; + var details = activeAnimationsLookup.get(parentNode) || {}; // either an enter, leave or move animation will commence // therefore we can't allow any animations to take place // but if a parent animation is class-based then that's ok if (!parentAnimationDetected) { - var parentElementDisabled = disabledElementsLookup.get(parentElement); + var parentNodeDisabled = disabledElementsLookup.get(parentNode); - if (parentElementDisabled === true && elementDisabled !== false) { + if (parentNodeDisabled === true && elementDisabled !== false) { // disable animations if the user hasn't explicitly enabled animations on the // current element elementDisabled = true; // element is disabled via parent element, no need to check anything else break; - } else if (parentElementDisabled === false) { + } else if (parentNodeDisabled === false) { elementDisabled = false; } parentAnimationDetected = details.structural; } if (isUndefined(animateChildren) || animateChildren === true) { - var value = jqLite.data(parentElement, NG_ANIMATE_CHILDREN_DATA); + var value = jqLite.data(parentNode, NG_ANIMATE_CHILDREN_DATA); if (isDefined(value)) { animateChildren = value; } @@ -677,40 +665,39 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate // there is no need to continue traversing at this point if (parentAnimationDetected && animateChildren === false) break; - if (!bodyElementDetected) { + if (!bodyNodeDetected) { // we also need to ensure that the element is or will be a part of the body element // otherwise it is pointless to even issue an animation to be rendered - bodyElementDetected = isMatchingElement(parentElement, bodyElement); + bodyNodeDetected = (parentNode === bodyNode); } - if (bodyElementDetected && rootElementDetected) { + if (bodyNodeDetected && rootNodeDetected) { // If both body and root have been found, any other checks are pointless, // as no animation data should live outside the application break; } - if (!rootElementDetected) { - // If no rootElement is detected, check if the parentElement is pinned to another element - parentHost = jqLite.data(parentElement, NG_ANIMATE_PIN_DATA); + if (!rootNodeDetected) { + // If `rootNode` is not detected, check if `parentNode` is pinned to another element + parentHost = jqLite.data(parentNode, NG_ANIMATE_PIN_DATA); if (parentHost) { // The pin target element becomes the next parent element - parentElement = getDomNode(parentHost); + parentNode = getDomNode(parentHost); continue; } } - parentElement = parentElement.parentNode; + parentNode = parentNode.parentNode; } var allowAnimation = (!parentAnimationDetected || animateChildren) && elementDisabled !== true; - return allowAnimation && rootElementDetected && bodyElementDetected; + return allowAnimation && rootNodeDetected && bodyNodeDetected; } - function markElementAnimationState(element, state, details) { + function markElementAnimationState(node, state, details) { details = details || {}; details.state = state; - var node = getDomNode(element); node.setAttribute(NG_ANIMATE_ATTR_NAME, state); var oldValue = activeAnimationsLookup.get(node); From 2b7a359363e78ee3ea9fcac8367927ddb5b13404 Mon Sep 17 00:00:00 2001 From: Georgios Kalpakas Date: Wed, 21 Dec 2016 14:09:19 +0200 Subject: [PATCH 003/745] test(ngAnimate): make expectations more specific --- test/ngAnimate/animateSpec.js | 88 +++++++++++++++++------------------ 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/test/ngAnimate/animateSpec.js b/test/ngAnimate/animateSpec.js index e1f37c4e4462..4f8af4c8fadc 100644 --- a/test/ngAnimate/animateSpec.js +++ b/test/ngAnimate/animateSpec.js @@ -168,7 +168,7 @@ describe('animations', function() { inject(function($animate, $rootScope) { $animate.enter(element, parent); $rootScope.$digest(); - expect(capturedAnimation).toBeFalsy(); + expect(capturedAnimation).toBeNull(); expect(element[0].parentNode).toEqual(parent[0]); hidden = false; @@ -188,7 +188,7 @@ describe('animations', function() { $animate.enter(element, parent); $rootScope.$digest(); - expect(capturedAnimation).toBeFalsy(); + expect(capturedAnimation).toBeNull(); element.addClass('only-allow-this-animation'); @@ -208,7 +208,7 @@ describe('animations', function() { $animate.enter(svgElement, parent); $rootScope.$digest(); - expect(capturedAnimation).toBeFalsy(); + expect(capturedAnimation).toBeNull(); svgElement.attr('class', 'element only-allow-this-animation-svg'); @@ -290,7 +290,7 @@ describe('animations', function() { $animate.leave(element); $rootScope.$digest(); - expect(capturedAnimation).toBeFalsy(); + expect(capturedAnimation).toBeNull(); expect(element[0].parentNode).toBeFalsy(); }); }); @@ -314,9 +314,9 @@ describe('animations', function() { $animate.enter(element, parent); - expect(capturedAnimation).toBeFalsy(); + expect(capturedAnimation).toBeNull(); $rootScope.$digest(); - expect(capturedAnimation).toBeFalsy(); + expect(capturedAnimation).toBeNull(); })); it('should disable all animations on the given element', @@ -328,15 +328,15 @@ describe('animations', function() { expect($animate.enabled(element)).toBeFalsy(); $animate.addClass(element, 'red'); - expect(capturedAnimation).toBeFalsy(); + expect(capturedAnimation).toBeNull(); $rootScope.$digest(); - expect(capturedAnimation).toBeFalsy(); + expect(capturedAnimation).toBeNull(); $animate.enabled(element, true); expect($animate.enabled(element)).toBeTruthy(); $animate.addClass(element, 'blue'); - expect(capturedAnimation).toBeFalsy(); + expect(capturedAnimation).toBeNull(); $rootScope.$digest(); expect(capturedAnimation).toBeTruthy(); })); @@ -347,14 +347,14 @@ describe('animations', function() { $animate.enabled(parent, false); $animate.enter(element, parent); - expect(capturedAnimation).toBeFalsy(); + expect(capturedAnimation).toBeNull(); $rootScope.$digest(); - expect(capturedAnimation).toBeFalsy(); + expect(capturedAnimation).toBeNull(); $animate.enabled(parent, true); $animate.enter(element, parent); - expect(capturedAnimation).toBeFalsy(); + expect(capturedAnimation).toBeNull(); $rootScope.$digest(); expect(capturedAnimation).toBeTruthy(); })); @@ -370,11 +370,11 @@ describe('animations', function() { $animate.addClass(element, 'red'); $rootScope.$digest(); - expect(capturedAnimation).toBeFalsy(); + expect(capturedAnimation).toBeNull(); $animate.addClass(child, 'red'); $rootScope.$digest(); - expect(capturedAnimation).toBeFalsy(); + expect(capturedAnimation).toBeNull(); $animate.enabled(element, true); @@ -402,7 +402,7 @@ describe('animations', function() { $rootScope.items = [1,2,3,4,5]; $rootScope.$digest(); - expect(capturedAnimation).toBeFalsy(); + expect(capturedAnimation).toBeNull(); })); it('should not attempt to perform an animation on a text node element', @@ -414,7 +414,7 @@ describe('animations', function() { $animate.addClass(textNode, 'some-class'); $rootScope.$digest(); - expect(capturedAnimation).toBeFalsy(); + expect(capturedAnimation).toBeNull(); })); it('should not attempt to perform an animation on an empty jqLite collection', @@ -426,7 +426,7 @@ describe('animations', function() { $animate.addClass(emptyNode, 'some-class'); $rootScope.$digest(); - expect(capturedAnimation).toBeFalsy(); + expect(capturedAnimation).toBeNull(); }) ); @@ -439,7 +439,7 @@ describe('animations', function() { $animate.leave(textNode); $rootScope.$digest(); - expect(capturedAnimation).toBeFalsy(); + expect(capturedAnimation).toBeNull(); expect(textNode[0].parentNode).not.toBe(parentNode); })); @@ -455,7 +455,7 @@ describe('animations', function() { $animate.leave(commentNode); $rootScope.$digest(); - expect(capturedAnimation).toBeFalsy(); + expect(capturedAnimation).toBeNull(); expect(commentNode[0].parentNode).not.toBe(parentNode); })); @@ -667,13 +667,13 @@ describe('animations', function() { $animate.removeClass(element, 'something-to-remove'); $rootScope.$digest(); - expect(capturedAnimation).toBeFalsy(); + expect(capturedAnimation).toBeNull(); element.addClass('something-to-add'); $animate.addClass(element, 'something-to-add'); $rootScope.$digest(); - expect(capturedAnimation).toBeFalsy(); + expect(capturedAnimation).toBeNull(); })); }); @@ -689,7 +689,7 @@ describe('animations', function() { parent.append(element); $animate.animate(element, null, toStyle); $rootScope.$digest(); - expect(capturedAnimation).toBeFalsy(); + expect(capturedAnimation).toBeNull(); }); }); @@ -700,7 +700,7 @@ describe('animations', function() { parent.append(element); $animate.animate(element, fromStyle); $rootScope.$digest(); - expect(capturedAnimation).toBeFalsy(); + expect(capturedAnimation).toBeNull(); })); it('should perform an animation if only from styles are provided as well as any valid classes', @@ -712,7 +712,7 @@ describe('animations', function() { var options = { removeClass: 'goop' }; $animate.animate(element, fromStyle, null, null, options); $rootScope.$digest(); - expect(capturedAnimation).toBeFalsy(); + expect(capturedAnimation).toBeNull(); fromStyle = { color: 'blue' }; options = { addClass: 'goop' }; @@ -816,11 +816,11 @@ describe('animations', function() { var elm1 = $compile('
')($rootScope); - expect(capturedAnimation).toBeFalsy(); + expect(capturedAnimation).toBeNull(); $animate.addClass(elm1, 'klass2'); - expect(capturedAnimation).toBeFalsy(); + expect(capturedAnimation).toBeNull(); $rootScope.$digest(); - expect(capturedAnimation).toBeFalsy(); + expect(capturedAnimation).toBeNull(); })); it('should skip animations if the element is attached to the $rootElement, but not apart of the body', @@ -834,22 +834,22 @@ describe('animations', function() { newParent.append($rootElement); $rootElement.append(elm1); - expect(capturedAnimation).toBeFalsy(); + expect(capturedAnimation).toBeNull(); $animate.addClass(elm1, 'klass2'); - expect(capturedAnimation).toBeFalsy(); + expect(capturedAnimation).toBeNull(); $rootScope.$digest(); - expect(capturedAnimation).toBeFalsy(); + expect(capturedAnimation).toBeNull(); })); it('should skip the animation if the element is removed from the DOM before the post digest kicks in', inject(function($animate, $rootScope) { $animate.enter(element, parent); - expect(capturedAnimation).toBeFalsy(); + expect(capturedAnimation).toBeNull(); element.remove(); $rootScope.$digest(); - expect(capturedAnimation).toBeFalsy(); + expect(capturedAnimation).toBeNull(); })); it('should be blocked when there is an ongoing structural parent animation occurring', @@ -857,7 +857,7 @@ describe('animations', function() { parent.append(element); - expect(capturedAnimation).toBeFalsy(); + expect(capturedAnimation).toBeNull(); $animate.move(parent, parent2); $rootScope.$digest(); @@ -867,7 +867,7 @@ describe('animations', function() { $animate.addClass(element, 'blue'); $rootScope.$digest(); - expect(capturedAnimation).toBeFalsy(); + expect(capturedAnimation).toBeNull(); })); it('should disable all child animations for atleast one turn when a structural animation is issued', @@ -917,7 +917,7 @@ describe('animations', function() { parent.append(element); - expect(capturedAnimation).toBeFalsy(); + expect(capturedAnimation).toBeNull(); $animate.addClass(parent, 'rogers'); $rootScope.$digest(); @@ -940,7 +940,7 @@ describe('animations', function() { $animate.addClass(element, 'rumlow'); $animate.move(parent, null, parent2); - expect(capturedAnimation).toBeFalsy(); + expect(capturedAnimation).toBeNull(); expect(capturedAnimationHistory.length).toBe(0); $rootScope.$digest(); @@ -1193,12 +1193,12 @@ describe('animations', function() { inject(function($animate, $rootScope) { $animate.enter(element, parent); - expect(capturedAnimation).toBeFalsy(); + expect(capturedAnimation).toBeNull(); $animate.addClass(element, 'red'); expect(element).not.toHaveClass('red'); - expect(capturedAnimation).toBeFalsy(); + expect(capturedAnimation).toBeNull(); $rootScope.$digest(); expect(capturedAnimation[1]).toBe('enter'); @@ -1227,7 +1227,7 @@ describe('animations', function() { $animate.removeClass(element, 'red'); $rootScope.$digest(); - expect(capturedAnimation).toBeFalsy(); + expect(capturedAnimation).toBeNull(); $animate.addClass(element, 'blue'); $rootScope.$digest(); @@ -1344,7 +1344,7 @@ describe('animations', function() { $animate.removeClass(element, 'four'); $rootScope.$digest(); - expect(capturedAnimation).toBeFalsy(); + expect(capturedAnimation).toBeNull(); })); it('but not skip the animation if it is a structural animation and if there are no classes to be animated', @@ -1632,7 +1632,7 @@ describe('animations', function() { $animate.addClass(animateElement, 'red'); $rootScope.$digest(); - expect(capturedAnimation).toBeFalsy(); + expect(capturedAnimation).toBeNull(); // Pin the element to the app root to enable animations $animate.pin(pinElement, $rootElement); @@ -1676,13 +1676,13 @@ describe('animations', function() { $animate.addClass(animateElement, 'red'); $rootScope.$digest(); - expect(capturedAnimation).toBeFalsy(); + expect(capturedAnimation).toBeNull(); $animate.pin(pinElement, pinTargetElement); $animate.addClass(animateElement, 'blue'); $rootScope.$digest(); - expect(capturedAnimation).toBeFalsy(); + expect(capturedAnimation).toBeNull(); dealoc(pinElement); }); @@ -1720,7 +1720,7 @@ describe('animations', function() { $animate.addClass(animateElement, 'blue'); $rootScope.$digest(); - expect(capturedAnimation).toBeFalsy(); + expect(capturedAnimation).toBeNull(); $animate.enabled(pinHostElement, true); From d24617bf329f1a5394de4627831c49a32b488685 Mon Sep 17 00:00:00 2001 From: Georgios Kalpakas Date: Thu, 15 Dec 2016 15:34:55 +0200 Subject: [PATCH 004/745] fix(ngAnimate): correctly animate transcluded clones with `templateUrl` Previously, `$animate` would decide whether an animation should be cancelled based on some assumption that didn't hold in specific cases (e.g. when animating transcluded clones with `templateUrl` directives on them for the first time). As a result, the entering elements would not be animated in such cases. This affected commonly used, structural built-in directives (`ngIf`, `ngRepeat`, `ngSwitch` etc). This commit fixes it by avoiding invalid assumptions (i.e. by taking into account the transformations that take place while compiling such elements). Partly addresses #14074 and #14124. Fixes #15510 Closes #15514 --- src/ngAnimate/animateQueue.js | 13 +++++++++++-- test/ngAnimate/animateSpec.js | 24 ++++++++++++++++++++++-- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/src/ngAnimate/animateQueue.js b/src/ngAnimate/animateQueue.js index 054559fecfde..daf947967404 100644 --- a/src/ngAnimate/animateQueue.js +++ b/src/ngAnimate/animateQueue.js @@ -302,13 +302,13 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate return $animate; - function queueAnimation(element, event, initialOptions) { + function queueAnimation(originalElement, event, initialOptions) { // we always make a copy of the options since // there should never be any side effects on // the input data when running `$animateCss`. var options = copy(initialOptions); - element = stripCommentsFromElement(element); + var element = stripCommentsFromElement(originalElement); var node = getDomNode(element); var parentNode = node && node.parentNode; @@ -479,6 +479,15 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate markElementAnimationState(node, PRE_DIGEST_STATE, newAnimation); $rootScope.$$postDigest(function() { + // It is possible that the DOM nodes inside `originalElement` have been replaced. This can + // happen if the animated element is a transcluded clone and also has a `templateUrl` + // directive on it. Therefore, we must recreate `element` in order to interact with the + // actual DOM nodes. + // Note: We still need to use the old `node` for certain things, such as looking up in + // HashMaps where it was used as the key. + + element = stripCommentsFromElement(originalElement); + var animationDetails = activeAnimationsLookup.get(node); var animationCancelled = !animationDetails; animationDetails = animationDetails || {}; diff --git a/test/ngAnimate/animateSpec.js b/test/ngAnimate/animateSpec.js index 4f8af4c8fadc..f259a6c3faf9 100644 --- a/test/ngAnimate/animateSpec.js +++ b/test/ngAnimate/animateSpec.js @@ -459,6 +459,28 @@ describe('animations', function() { expect(commentNode[0].parentNode).not.toBe(parentNode); })); + it('enter() should animate a transcluded clone with `templateUrl`', function() { + module(function($compileProvider) { + $compileProvider.directive('foo', function() { + return {templateUrl: 'foo.html'}; + }); + }); + + inject(function($animate, $compile, $rootScope, $templateCache) { + parent.append(jqLite('')); + $templateCache.put('foo.html', '
FOO
'); + $compile(parent)($rootScope); + + expect(capturedAnimation).toBeNull(); + + $rootScope.$apply('showFoo = true'); + + expect(parent.text()).toBe('parentFOO'); + expect(capturedAnimation[0].html()).toBe('
FOO
'); + expect(capturedAnimation[1]).toBe('enter'); + }); + }); + it('enter() should issue an enter animation and fire the DOM operation right away before the animation kicks off', inject(function($animate, $rootScope) { expect(parent.children().length).toBe(0); @@ -2437,7 +2459,6 @@ describe('animations', function() { return function($rootElement, $q, $animate, $$AnimateRunner, $document) { defaultFakeAnimationRunner = new $$AnimateRunner(); - $animate.enabled(true); element = jqLite('
element
'); parent = jqLite('
parent
'); @@ -2445,7 +2466,6 @@ describe('animations', function() { $rootElement.append(parent); $rootElement.append(parent2); - jqLite($document[0].body).append($rootElement); }; })); From 03043839d5a540b02208001fe12e812dfde00a8e Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Tue, 24 Jan 2017 17:23:54 +0000 Subject: [PATCH 005/745] docs(*): ensure naming is correct for Angular(JS) versions --- .github/ISSUE_TEMPLATE.md | 2 +- CONTRIBUTING.md | 16 +-- README.closure.md | 2 +- README.md | 4 +- TRIAGING.md | 6 +- .../templates/app/indexPage.template.html | 4 +- docs/content/api/index.ngdoc | 10 +- docs/content/error/$animate/nocb.ngdoc | 2 +- docs/content/error/$compile/infchng.ngdoc | 2 +- docs/content/error/$http/badjsonp.ngdoc | 2 +- docs/content/error/$injector/modulerr.ngdoc | 2 +- docs/content/error/$interpolate/badexpr.ngdoc | 2 +- .../content/error/$interpolate/dupvalue.ngdoc | 2 +- .../content/error/$interpolate/logicbug.ngdoc | 2 +- .../error/$interpolate/nochgmustache.ngdoc | 2 +- docs/content/error/$interpolate/reqarg.ngdoc | 4 +- .../content/error/$interpolate/reqcomma.ngdoc | 2 +- .../error/$interpolate/reqendbrace.ngdoc | 2 +- .../error/$interpolate/reqopenbrace.ngdoc | 2 +- .../content/error/$interpolate/reqother.ngdoc | 2 +- docs/content/error/$interpolate/unknarg.ngdoc | 2 +- docs/content/error/$interpolate/unsafe.ngdoc | 2 +- .../error/$interpolate/untermstr.ngdoc | 2 +- docs/content/error/$location/nobase.ngdoc | 2 +- docs/content/error/$parse/lexerr.ngdoc | 2 +- docs/content/error/$parse/syntax.ngdoc | 2 +- docs/content/error/$parse/ueoe.ngdoc | 2 +- docs/content/error/$rootScope/infdig.ngdoc | 4 +- docs/content/error/$rootScope/inprog.ngdoc | 32 +++--- docs/content/error/$sanitize/noinert.ngdoc | 2 +- docs/content/error/$sce/insecurl.ngdoc | 4 +- docs/content/error/$sce/unsafe.ngdoc | 4 +- docs/content/error/jqLite/nosel.ngdoc | 4 +- docs/content/error/ng/test.ngdoc | 4 +- docs/content/error/ngModel/datefmt.ngdoc | 2 +- docs/content/error/ngModel/numfmt.ngdoc | 2 +- docs/content/guide/$location.ngdoc | 16 +-- docs/content/guide/accessibility.ngdoc | 8 +- docs/content/guide/animations.ngdoc | 4 +- docs/content/guide/bootstrap.ngdoc | 20 ++-- docs/content/guide/compiler.ngdoc | 20 ++-- docs/content/guide/component-router.ngdoc | 25 ++--- docs/content/guide/component.ngdoc | 20 ++-- docs/content/guide/concepts.ngdoc | 44 ++++---- docs/content/guide/controller.ngdoc | 28 ++--- docs/content/guide/css-styling.ngdoc | 20 ++-- docs/content/guide/databinding.ngdoc | 12 +- docs/content/guide/decorators.ngdoc | 2 +- docs/content/guide/di.ngdoc | 20 ++-- docs/content/guide/directive.ngdoc | 20 ++-- docs/content/guide/e2e-testing.ngdoc | 6 +- docs/content/guide/expression.ngdoc | 32 +++--- docs/content/guide/external-resources.ngdoc | 26 ++--- docs/content/guide/filter.ngdoc | 10 +- docs/content/guide/forms.ngdoc | 12 +- docs/content/guide/i18n.ngdoc | 56 +++++----- docs/content/guide/ie.ngdoc | 8 +- docs/content/guide/index.ngdoc | 38 +++---- docs/content/guide/interpolation.ngdoc | 12 +- docs/content/guide/introduction.ngdoc | 42 +++---- docs/content/guide/migration.ngdoc | 74 ++++++------- docs/content/guide/module.ngdoc | 12 +- docs/content/guide/production.ngdoc | 4 +- docs/content/guide/providers.ngdoc | 22 ++-- docs/content/guide/scope.ngdoc | 56 +++++----- docs/content/guide/security.ngdoc | 30 ++--- docs/content/guide/services.ngdoc | 20 ++-- docs/content/guide/templates.ngdoc | 12 +- docs/content/guide/unit-testing.ngdoc | 24 ++-- docs/content/misc/contribute.ngdoc | 12 +- docs/content/misc/downloading.ngdoc | 36 +++--- docs/content/misc/faq.ngdoc | 68 ++++++------ docs/content/misc/started.ngdoc | 6 +- docs/content/tutorial/index.ngdoc | 30 ++--- docs/content/tutorial/step_00.ngdoc | 30 ++--- docs/content/tutorial/step_01.ngdoc | 6 +- docs/content/tutorial/step_02.ngdoc | 46 ++++---- docs/content/tutorial/step_03.ngdoc | 22 ++-- docs/content/tutorial/step_04.ngdoc | 14 +-- docs/content/tutorial/step_05.ngdoc | 6 +- docs/content/tutorial/step_06.ngdoc | 8 +- docs/content/tutorial/step_07.ngdoc | 32 +++--- docs/content/tutorial/step_08.ngdoc | 8 +- docs/content/tutorial/step_09.ngdoc | 26 ++--- docs/content/tutorial/step_10.ngdoc | 2 +- docs/content/tutorial/step_11.ngdoc | 6 +- docs/content/tutorial/step_12.ngdoc | 4 +- docs/content/tutorial/step_13.ngdoc | 16 +-- docs/content/tutorial/step_14.ngdoc | 18 +-- docs/content/tutorial/the_end.ngdoc | 4 +- i18n/e2e/runner.html | 2 +- i18n/src/closureSlurper.js | 2 +- images/docs/Diagrams.vdx | 6 +- images/docs/guide/about_controller.graffle | 6 +- images/docs/guide/about_controller.svg | 2 +- images/docs/guide/about_controller.vdx | 12 +- images/docs/guide/about_model.graffle | 6 +- images/docs/guide/about_model.svg | 2 +- images/docs/guide/about_model.vdx | 10 +- images/docs/guide/dom_scope.graffle | 12 +- images/docs/guide/dom_scope.svg | 2 +- images/docs/guide/dom_scope.vdx | 6 +- .../guide/simple_scope.graffle/data.plist | 2 +- lib/grunt/plugins.js | 2 +- protractor-travis-conf.js | 4 +- scripts/bower/publish.sh | 2 +- scripts/bower/unpublish.sh | 2 +- src/Angular.js | 22 ++-- src/angular.bind.js | 2 +- src/auto/injector.js | 10 +- src/jqLite.js | 10 +- src/loader.js | 10 +- src/minErr.js | 2 +- src/ng/animate.js | 2 +- src/ng/browser.js | 6 +- src/ng/compile.js | 44 ++++---- src/ng/controller.js | 2 +- src/ng/directive/attrs.js | 20 ++-- src/ng/directive/form.js | 8 +- src/ng/directive/input.js | 104 +++++++++--------- src/ng/directive/ngBind.js | 6 +- src/ng/directive/ngCloak.js | 4 +- src/ng/directive/ngController.js | 4 +- src/ng/directive/ngCsp.js | 34 +++--- src/ng/directive/ngEventDirs.js | 4 +- src/ng/directive/ngInclude.js | 4 +- src/ng/directive/ngModel.js | 8 +- src/ng/directive/ngModelOptions.js | 2 +- src/ng/directive/ngNonBindable.js | 6 +- src/ng/directive/ngOptions.js | 2 +- src/ng/directive/ngPluralize.js | 10 +- src/ng/directive/ngRepeat.js | 4 +- src/ng/directive/select.js | 6 +- src/ng/directive/validators.js | 8 +- src/ng/exceptionHandler.js | 2 +- src/ng/filter.js | 10 +- src/ng/filter/orderBy.js | 2 +- src/ng/http.js | 16 +-- src/ng/interpolate.js | 10 +- src/ng/interval.js | 2 +- src/ng/locale.js | 2 +- src/ng/location.js | 6 +- src/ng/parse.js | 14 +-- src/ng/q.js | 2 +- src/ng/rootElement.js | 2 +- src/ng/rootScope.js | 14 +-- src/ng/sce.js | 18 +-- src/ng/templateRequest.js | 2 +- src/ng/timeout.js | 2 +- src/ng/window.js | 2 +- src/ngAnimate/animateCss.js | 2 +- src/ngAnimate/animateQueue.js | 2 +- src/ngAnimate/module.js | 16 +-- src/ngComponentRouter/Router.js | 49 ++++----- src/ngCookies/cookieStore.js | 2 +- src/ngCookies/cookies.js | 2 +- src/ngMessageFormat/messageFormatParser.js | 6 +- src/ngMessageFormat/messageFormatService.js | 2 +- src/ngMessages/messages.js | 6 +- src/ngMock/angular-mocks.js | 12 +- src/ngParseExt/module.js | 4 +- src/ngResource/resource.js | 2 +- src/ngRoute/route.js | 2 +- src/ngScenario/Application.js | 2 +- src/ngScenario/output/Html.js | 2 +- src/ngTouch/directive/ngClick.js | 2 +- test/AngularSpec.js | 2 +- .../index.html | 0 .../script.js | 0 ...ec.js => angularjs-already-loaded.spec.js} | 4 +- test/jqLiteSpec.js | 4 +- test/ng/browserSpecs.js | 6 +- test/ng/compileSpec.js | 4 +- test/ng/directive/inputSpec.js | 2 +- test/ngMessageFormat/messageFormatSpec.js | 2 +- test/ngScenario/dslSpec.js | 2 +- 176 files changed, 983 insertions(+), 985 deletions(-) rename test/e2e/fixtures/{angular-already-loaded => angularjs-already-loaded}/index.html (100%) rename test/e2e/fixtures/{angular-already-loaded => angularjs-already-loaded}/script.js (100%) rename test/e2e/tests/{angular-already-loaded.spec.js => angularjs-already-loaded.spec.js} (61%) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 50ed8a2b8f13..0f73c4f67efd 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -20,7 +20,7 @@ -**Which versions of Angular, and which browser / OS are affected by this issue? Did this work in previous versions of Angular? Please also test with the latest stable and snapshot (https://code.angularjs.org/snapshot/) versions.** +**Which versions of AngularJS, and which browser / OS are affected by this issue? Did this work in previous versions of AngularJS? Please also test with the latest stable and snapshot (https://code.angularjs.org/snapshot/) versions.** diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 83def1e87ae7..22849d948da2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -15,7 +15,7 @@ today! Here are the guidelines we'd like you to follow: ## Code of Conduct -Help us keep Angular open and inclusive. Please read and follow our [Code of Conduct][coc]. +Help us keep AngularJS open and inclusive. Please read and follow our [Code of Conduct][coc]. ## Got a Question or Problem? @@ -29,7 +29,7 @@ If you find a bug in the source code or a mistake in the documentation, you can submitting an issue to our [GitHub Repository][github]. Even better you can submit a Pull Request with a fix. -**Localization Issues:** Angular.js uses the [Google Closure I18N library] to generate +**Localization Issues:** AngularJS uses the [Google Closure I18N library] to generate its own I18N files (the ngLocale module). This means that any changes to these files would be lost the next time that we import the library. Since the Closure library i18n data is itself auto-generated from the data of the @@ -81,7 +81,7 @@ quickly: * **Overview of the Issue** - if an error is being thrown a non-minified stack trace helps * **Motivation for or Use Case** - explain why this is a bug for you -* **Angular Version(s)** - is it a regression? +* **AngularJS Version(s)** - is it a regression? * **Browsers and Operating System** - is this a problem with all browsers or only specific ones? * **Reproduce the Error** - provide a live example (using [Plunker][plunker] or [JSFiddle][jsfiddle]) or an unambiguous set of steps. @@ -108,7 +108,7 @@ Before you submit your pull request consider the following guidelines: * Create your patch, **including appropriate test cases**. * Follow our [Coding Rules](#rules). -* Run the full Angular test suite, as described in the [developer documentation][dev-doc], +* Run the full AngularJS test suite, as described in the [developer documentation][dev-doc], and ensure that all tests pass. * Commit your changes using a descriptive commit message that follows our [commit message conventions](#commit) and passes our commit message presubmit hook @@ -132,11 +132,11 @@ Before you submit your pull request consider the following guidelines: git push origin my-fix-branch ``` -In GitHub, send a pull request to `angular:master`. +In GitHub, send a pull request to `angular.js:master`. If we suggest changes, then: * Make the required updates. -* Re-run the Angular test suite to ensure tests are still passing. +* Re-run the AngularJS test suite to ensure tests are still passing. * Commit your changes to your branch (e.g. `my-fix-branch`). * Push the changes to your GitHub repository (this will update your Pull Request). @@ -189,10 +189,10 @@ To ensure consistency throughout the source code, keep these rules in mind as yo * All features or bug fixes **must be tested** by one or more [specs][unit-testing]. * All public API methods **must be documented** with ngdoc, an extended version of jsdoc (we added support for markdown and templating via @ngdoc tag). To see how we document our APIs, please check - out the existing ngdocs and see [this wiki page][ngDocs]. + out the existing source code and see [this wiki page][ngDocs]. * With the exceptions listed below, we follow the rules contained in [Google's JavaScript Style Guide][js-style-guide]: - * **Do not use namespaces**: Instead, wrap the entire angular code base in an anonymous closure and + * **Do not use namespaces**: Instead, wrap the entire AngularJS code base in an anonymous closure and export our API explicitly rather than implicitly. * Wrap all code at **100 characters**. * Instead of complex inheritance hierarchies, we **prefer simple objects**. We use prototypal diff --git a/README.closure.md b/README.closure.md index aa237ef5a508..21ef84770da0 100644 --- a/README.closure.md +++ b/README.closure.md @@ -7,7 +7,7 @@ in its `contrib/externs` directory. The definitions contain externs for use with the Closure compiler (aka JSCompiler). Passing these files to the --externs parameter of a compiler pass allows using type annotations for AngularJS objects. For example, -Angular's $scope objects can be annotated as: +AngularJS's $scope objects can be annotated as: ```js /** @type {angular.Scope} */ var scope = $scope; diff --git a/README.md b/README.md index bc3b9554a61c..c6a8dd5c369c 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ piece of cake. Best of all? It makes development fun! * Contribution guidelines: [CONTRIBUTING.md](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md) * Dashboard: https://dashboard.angularjs.org -##### Looking for Angular 2? Go here: https://github.com/angular/angular +##### Looking for the new Angular? Go here: https://github.com/angular/angular Building AngularJS --------- @@ -80,7 +80,7 @@ HTML is also used to determine the wiring of the app. Special attributes in the to load the app, which components or controllers to use for each element, etc. We specify "what" gets loaded, but not "how". This declarative approach greatly simplifies app development in a sort of WYSIWYG way. Rather than spending time on how the program flows and orchestrating the various -moving parts, we simply define what we want and Angular will take care of the dependencies. +moving parts, we simply define what we want and AngularJS will take care of the dependencies. #### Data Handling made simple Data and Data Models in AngularJS are plain JavaScript objects and one can add and change properties diff --git a/TRIAGING.md b/TRIAGING.md index 99621915b8e4..0dc6ee357232 100644 --- a/TRIAGING.md +++ b/TRIAGING.md @@ -1,6 +1,6 @@ # Triage new issues/PRs on github -This document shows the steps the Angular team is using to triage issues. +This document shows the steps the AngularJS team is using to triage issues. The labels are used later on for [planning releases](#assigning-work). @@ -45,12 +45,12 @@ This process based on the idea of minimizing user pain 1. Label `frequency: *` – How often does this issue come up? How many developers does this affect? Chose just one of the following: * low - obscure issue affecting a handful of developers * moderate - impacts a common usage pattern - * high - impacts most or all Angular apps + * high - impacts most or all AngularJS apps 1. Label `severity: *` - How bad is the issue? Chose just one of the following: * security issue * regression * memory leak - * broken expected use - it's hard or impossible for a developer using Angular to accomplish something that Angular should be able to do + * broken expected use - it's hard or impossible for a developer using AngularJS to accomplish something that AngularJS should be able to do * confusing - unexpected or inconsistent behavior; hard-to-debug * inconvenience - causes ugly/boilerplate code in apps 1. Label `component: *` diff --git a/docs/config/templates/app/indexPage.template.html b/docs/config/templates/app/indexPage.template.html index 602df1619a65..75abb7190280 100644 --- a/docs/config/templates/app/indexPage.template.html +++ b/docs/config/templates/app/indexPage.template.html @@ -76,7 +76,7 @@
- +
From a772b94b0a4429051bf85b01ed74444e7ecfd747 Mon Sep 17 00:00:00 2001 From: Jason Bedard Date: Sun, 18 Jun 2017 17:11:07 -0700 Subject: [PATCH 189/745] chore(benchmarks): add $watchCollection tests --- benchmarks/parsed-expressions-bp/app.js | 15 ++++++++++++ benchmarks/parsed-expressions-bp/main.html | 27 ++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/benchmarks/parsed-expressions-bp/app.js b/benchmarks/parsed-expressions-bp/app.js index 4c95fdd06940..dbe7b5fb93de 100644 --- a/benchmarks/parsed-expressions-bp/app.js +++ b/benchmarks/parsed-expressions-bp/app.js @@ -29,6 +29,21 @@ app.directive('bmPeWatch', function() { }; }); +//Executes the specified expression as a collection watcher +app.directive('bmPeWatchCollection', function() { + return { + restrict: 'A', + compile: function($element, $attrs) { + $element.text($attrs.bmPeWatchCollection); + return function($scope, $element, $attrs) { + $scope.$watchCollection($attrs.bmPeWatchCollection, function(val) { + $element.text(val); + }); + }; + } + }; +}); + app.controller('DataController', function($scope, $rootScope) { var totalRows = 10000; diff --git a/benchmarks/parsed-expressions-bp/main.html b/benchmarks/parsed-expressions-bp/main.html index 63f30b43c1a3..e0e4e85ff0b4 100644 --- a/benchmarks/parsed-expressions-bp/main.html +++ b/benchmarks/parsed-expressions-bp/main.html @@ -60,6 +60,16 @@ + +
  • + + +
  • + +
  • + + +
  • + + + +
    From 65728383f35d8516558ab94a913a0a604579c93f Mon Sep 17 00:00:00 2001 From: Pol Bonastre Date: Fri, 17 Mar 2017 19:00:54 +0100 Subject: [PATCH 190/745] perf(ngOptions): prevent initial options repainting Avoid double execution of `updateOptions()` method, which causes a complete repainting of all `AngularJS Github repository`; + if (error.code === 404) { - if (fileName.split('.').length === 1) { - message = 'Directory listing is not supported'; - } else { - message = 'File not found'; - } + message = 'File or directory not found'; + code = 404; } - return response.status(error.code).send(message); - }); + return response.status(code).send(message); + } + + function getDirectoryListing(path) { + if (!path.endsWith('/')) path += '/'; - function downloadAndSend(downloadSource, downloadDestination) { - return bucket.file(downloadSource).download({ - destination: downloadDestination - }).then(() => { - return response.status(200) + const getFilesOptions = { + delimiter: '/', + autoPaginate: false + }; + + if (path !== '/') getFilesOptions.prefix = path; + + let fileList = []; + let directoryList = []; + + return getContent(getFilesOptions).then(() => { + let contentList = ''; + + directoryList.forEach(directoryPath => { + const dirName = directoryPath.split('/').reverse()[1]; + contentList += `${dirName}/
    `; + }); + + fileList.forEach(file => { + const fileName = file.metadata.name.split('/').pop(); + contentList += `${fileName}
    `; + }); + + // A trailing slash in the base creates correct relative links when the url is accessed + // without trailing slash + const base = request.originalUrl.endsWith('/') ? request.originalUrl : request.originalUrl + '/'; + + let directoryListing = ` + +

    Index of ${path}

    +
    +
    ${contentList}
    `; + + return response + .status(200) .set({ 'Cache-Control': `public, max-age=${BROWSER_CACHE_DURATION}, s-maxage=${CDN_CACHE_DURATION}` }) - .sendFile(downloadDestination); + .send(directoryListing); }); + + function getContent(options) { + return bucket.getFiles(options).then(data => { + const files = data[0]; + const nextQuery = data[1]; + const apiResponse = data[2]; + + if (!files.length && (!apiResponse || !apiResponse.prefixes)) { + return Promise.reject({ + code: 404 + }); + } + + fileList = fileList.concat(files); + + if (apiResponse && apiResponse.prefixes) { + directoryList = directoryList.concat(apiResponse.prefixes); + } + + if (nextQuery) { + // If the results are paged, get the next page + return getContent(nextQuery); + } + + return true; + }); + + } } } diff --git a/scripts/code.angularjs.org-firebase/public/index.html b/scripts/code.angularjs.org-firebase/public/index.html deleted file mode 100644 index fe8e94ca62c8..000000000000 --- a/scripts/code.angularjs.org-firebase/public/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - AngularJS - - - - From aee5d02cb789e178f3f80f95cdabea38e0090501 Mon Sep 17 00:00:00 2001 From: Martin Staffa Date: Mon, 31 Jul 2017 23:31:39 +0200 Subject: [PATCH 228/745] chore(travis): actually skip build on deployment job when from Pull Request --- scripts/travis/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/travis/build.sh b/scripts/travis/build.sh index efcc16d6e08e..f7b33c3129da 100755 --- a/scripts/travis/build.sh +++ b/scripts/travis/build.sh @@ -47,7 +47,7 @@ case "$JOB" in ;; "deploy") # we never deploy on Pull requests, so it's safe to skip the build here - if [[ $TRAVIS_PULL_REQUEST != 'false' ]]; then + if [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then grunt package grunt compress:firebaseCodeDeploy else From 3650723501ca5f50003192bc4f94c77cef711e1a Mon Sep 17 00:00:00 2001 From: andypotts Date: Sun, 30 Jul 2017 17:53:57 +0100 Subject: [PATCH 229/745] docs(guide/concepts): simplify currency exchange API example (YQL --> Fixer.io) Fixes #16130 Closes #16137 --- docs/content/guide/concepts.ngdoc | 19 +++++-------------- docs/content/guide/security.ngdoc | 3 +-- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/docs/content/guide/concepts.ngdoc b/docs/content/guide/concepts.ngdoc index cc64ddb92e0e..b7ed900c5ff5 100644 --- a/docs/content/guide/concepts.ngdoc +++ b/docs/content/guide/concepts.ngdoc @@ -186,7 +186,7 @@ Right now, the `InvoiceController` contains all logic of our example. When the a is a good practice to move view-independent logic from the controller into a {@link services service}, so it can be reused by other parts of the application as well. Later on, we could also change that service to load the exchange rates -from the web, e.g. by calling the Yahoo Finance API, without changing the controller. +from the web, e.g. by calling the [Fixer.io](http://fixer.io) exchange rate API, without changing the controller. Let's refactor our example and move the currency conversion into a service in another file: @@ -300,7 +300,7 @@ to something shorter like `a`. ## Accessing the backend -Let's finish our example by fetching the exchange rates from the Yahoo Finance API. +Let's finish our example by fetching the exchange rates from the [Fixer.io](http://fixer.io) exchange rate API. The following example shows how this is done with AngularJS: @@ -323,10 +323,6 @@ The following example shows how this is done with AngularJS: angular.module('finance3', []) .factory('currencyConverter', ['$http', function($http) { - var YAHOO_FINANCE_URL_PATTERN = - '//query.yahooapis.com/v1/public/yql?q=select * from ' + - 'yahoo.finance.xchange where pair in ("PAIRS")&format=json&' + - 'env=store://datatables.org/alltableswithkeys'; var currencies = ['USD', 'EUR', 'CNY']; var usdToForeignRates = {}; @@ -335,15 +331,10 @@ The following example shows how this is done with AngularJS: }; var refresh = function() { - var url = YAHOO_FINANCE_URL_PATTERN. - replace('PAIRS', 'USD' + currencies.join('","USD')); + var url = 'https://api.fixer.io/latest?base=USD&symbols=' + currencies.join(","); return $http.get(url).then(function(response) { - var newUsdToForeignRates = {}; - angular.forEach(response.data.query.results.rate, function(rate) { - var currency = rate.id.substring(3,6); - newUsdToForeignRates[currency] = window.parseFloat(rate.Rate); - }); - usdToForeignRates = newUsdToForeignRates; + usdToForeignRates = response.data.rates; + usdToForeignRates['USD'] = 1; }); }; diff --git a/docs/content/guide/security.ngdoc b/docs/content/guide/security.ngdoc index e4236de03d07..2a8e6b6feda8 100644 --- a/docs/content/guide/security.ngdoc +++ b/docs/content/guide/security.ngdoc @@ -100,8 +100,7 @@ Protection from JSON Hijacking is provided if the server prefixes all JSON reque AngularJS will automatically strip the prefix before processing it as JSON. For more information please visit {@link $http#json-vulnerability-protection JSON Hijacking Protection}. -Bear in mind that calling `$http.jsonp`, like in [our Yahoo! finance example](https://docs.angularjs.org/guide/concepts#accessing-the-backend), -gives the remote server (and, if the request is not secured, any Man-in-the-Middle attackers) +Bear in mind that calling `$http.jsonp` gives the remote server (and, if the request is not secured, any Man-in-the-Middle attackers) instant remote code execution in your application: the result of these requests is handed off to the browser as regular `'); - } - - function addCSS(path) { - window.document.write(''); - } - - window.onload = function() { - try { - if (previousOnLoad) previousOnLoad(); - } catch (e) { /* empty */ } - angular.scenario.setUpAndRun({}); - }; - - addCSS('../../css/angular-scenario.css'); - addScript('../../lib/jquery/jquery.js'); - window.document.write( - '' - ); - addScript('../angular-bootstrap.js'); - - addScript('Scenario.js'); - addScript('Application.js'); - addScript('Describe.js'); - addScript('Future.js'); - addScript('Runner.js'); - addScript('SpecRunner.js'); - addScript('dsl.js'); - addScript('matchers.js'); - addScript('ObjectModel.js'); - addScript('output/Html.js'); - addScript('output/Json.js'); - addScript('output/Object.js'); - addScript('output/Xml.js'); - - // Create the runner (which also sets up the global API) - window.document.write( - ''); - -})(window.onload); diff --git a/src/ngScenario/angular.prefix b/src/ngScenario/angular.prefix deleted file mode 100644 index 3ccd4537f775..000000000000 --- a/src/ngScenario/angular.prefix +++ /dev/null @@ -1,7 +0,0 @@ -/** - * @license AngularJS v"NG_VERSION_FULL" - * (c) 2010-2017 Google, Inc. http://angularjs.org - * License: MIT - */ -(function(window){ - var _jQuery = window.jQuery.noConflict(true); diff --git a/src/ngScenario/angular.suffix b/src/ngScenario/angular.suffix deleted file mode 100644 index 5c89e61036f3..000000000000 --- a/src/ngScenario/angular.suffix +++ /dev/null @@ -1,22 +0,0 @@ -bindJQuery(); -publishExternalAPI(angular); - -var $runner = new angular.scenario.Runner(window), - scripts = window.document.getElementsByTagName('script'), - script = scripts[scripts.length - 1], - config = {}; - -angular.forEach(script.attributes, function(attr) { - var match = attr.name.match(/ng[:\-](.*)/); - if (match) { - config[match[1]] = attr.value || true; - } -}); - -if (config.autotest) { - JQLite(function() { - angular.scenario.setUpAndRun(config); - }); -} -})(window); - diff --git a/src/ngScenario/dsl.js b/src/ngScenario/dsl.js deleted file mode 100644 index 3849c4515aff..000000000000 --- a/src/ngScenario/dsl.js +++ /dev/null @@ -1,484 +0,0 @@ -'use strict'; - -/* eslint-disable no-invalid-this */ - -/** - * Shared DSL statements that are useful to all scenarios. - */ - - /** - * Usage: - * pause() pauses until you call resume() in the console - */ -angular.scenario.dsl('pause', function() { - return function() { - return this.addFuture('pausing for you to resume', function(done) { - this.emit('InteractivePause', this.spec, this.step); - this.$window.resume = function() { done(); }; - }); - }; -}); - -/** - * Usage: - * sleep(seconds) pauses the test for specified number of seconds - */ -angular.scenario.dsl('sleep', function() { - return function(time) { - return this.addFuture('sleep for ' + time + ' seconds', function(done) { - this.$window.setTimeout(function() { done(null, time * 1000); }, time * 1000); - }); - }; -}); - -/** - * Usage: - * browser().navigateTo(url) Loads the url into the frame - * browser().navigateTo(url, fn) where fn(url) is called and returns the URL to navigate to - * browser().reload() refresh the page (reload the same URL) - * browser().window.href() window.location.href - * browser().window.path() window.location.pathname - * browser().window.search() window.location.search - * browser().window.hash() window.location.hash without # prefix - * browser().location().url() see ng.$location#url - * browser().location().path() see ng.$location#path - * browser().location().search() see ng.$location#search - * browser().location().hash() see ng.$location#hash - */ -angular.scenario.dsl('browser', function() { - var chain = {}; - - chain.navigateTo = function(url, delegate) { - var application = this.application; - return this.addFuture('browser navigate to \'' + url + '\'', function(done) { - if (delegate) { - url = delegate.call(this, url); - } - application.navigateTo(url, function() { - done(null, url); - }, done); - }); - }; - - chain.reload = function() { - var application = this.application; - return this.addFutureAction('browser reload', function($window, $document, done) { - var href = $window.location.href; - application.navigateTo(href, function() { - done(null, href); - }, done); - }); - }; - - chain.window = function() { - var api = {}; - - api.href = function() { - return this.addFutureAction('window.location.href', function($window, $document, done) { - done(null, $window.location.href); - }); - }; - - api.path = function() { - return this.addFutureAction('window.location.path', function($window, $document, done) { - done(null, $window.location.pathname); - }); - }; - - api.search = function() { - return this.addFutureAction('window.location.search', function($window, $document, done) { - done(null, $window.location.search); - }); - }; - - api.hash = function() { - return this.addFutureAction('window.location.hash', function($window, $document, done) { - done(null, $window.location.hash.replace('#', '')); - }); - }; - - return api; - }; - - chain.location = function() { - var api = {}; - - api.url = function() { - return this.addFutureAction('$location.url()', function($window, $document, done) { - done(null, $document.injector().get('$location').url()); - }); - }; - - api.path = function() { - return this.addFutureAction('$location.path()', function($window, $document, done) { - done(null, $document.injector().get('$location').path()); - }); - }; - - api.search = function() { - return this.addFutureAction('$location.search()', function($window, $document, done) { - done(null, $document.injector().get('$location').search()); - }); - }; - - api.hash = function() { - return this.addFutureAction('$location.hash()', function($window, $document, done) { - done(null, $document.injector().get('$location').hash()); - }); - }; - - return api; - }; - - return function() { - return chain; - }; -}); - -/** - * Usage: - * expect(future).{matcher} where matcher is one of the matchers defined - * with angular.scenario.matcher - * - * ex. expect(binding("name")).toEqual("Elliott") - */ -angular.scenario.dsl('expect', function() { - var chain = angular.extend({}, angular.scenario.matcher); - - chain.not = function() { - this.inverse = true; - return chain; - }; - - return function(future) { - this.future = future; - return chain; - }; -}); - -/** - * Usage: - * using(selector, label) scopes the next DSL element selection - * - * ex. - * using('#foo', "'Foo' text field").input('bar') - */ -angular.scenario.dsl('using', function() { - return function(selector, label) { - this.selector = _jQuery.trim((this.selector || '') + ' ' + selector); - if (angular.isString(label) && label.length) { - this.label = label + ' ( ' + this.selector + ' )'; - } else { - this.label = this.selector; - } - return this.dsl; - }; -}); - -/** - * Usage: - * binding(name) returns the value of the first matching binding - */ -angular.scenario.dsl('binding', function() { - return function(name) { - return this.addFutureAction('select binding \'' + name + '\'', - function($window, $document, done) { - var values = $document.elements().bindings($window.angular.element, name); - if (!values.length) { - return done('Binding selector \'' + name + '\' did not match.'); - } - done(null, values[0]); - }); - }; -}); - -/** - * Usage: - * input(name).enter(value) enters value in input with specified name - * input(name).check() checks checkbox - * input(name).select(value) selects the radio button with specified name/value - * input(name).val() returns the value of the input. - */ -angular.scenario.dsl('input', function() { - var chain = {}; - - // Support: IE 9-11 only - // IE9 implements 'input' event it's so fubared that we rather pretend that it doesn't have - // it. In particular the event is not fired when backspace or delete key are pressed or - // when cut operation is performed. - // IE10+ implements 'input' event but it erroneously fires under various situations, - // e.g. when placeholder changes, or a form is focused. - var supportInputEvent = 'oninput' in window.document.createElement('div') && !msie; - - chain.enter = function(value, event) { - return this.addFutureAction('input \'' + this.name + '\' enter \'' + value + '\'', - function($window, $document, done) { - var input = $document.elements('[ng\\:model="$1"]', this.name).filter(':input'); - input.val(value); - input.trigger(event || (supportInputEvent ? 'input' : 'change')); - done(); - }); - }; - - chain.check = function() { - return this.addFutureAction('checkbox \'' + this.name + '\' toggle', - function($window, $document, done) { - var input = $document.elements('[ng\\:model="$1"]', this.name).filter(':checkbox'); - input.trigger('click'); - done(); - }); - }; - - chain.select = function(value) { - return this.addFutureAction('radio button \'' + this.name + '\' toggle \'' + value + '\'', - function($window, $document, done) { - var input = $document. - elements('[ng\\:model="$1"][value="$2"]', this.name, value).filter(':radio'); - input.trigger('click'); - done(); - }); - }; - - chain.val = function() { - return this.addFutureAction('return input val', function($window, $document, done) { - var input = $document.elements('[ng\\:model="$1"]', this.name).filter(':input'); - done(null,input.val()); - }); - }; - - return function(name) { - this.name = name; - return chain; - }; -}); - - -/** - * Usage: - * repeater('#products table', 'Product List').count() number of rows - * repeater('#products table', 'Product List').row(1) all bindings in row as an array - * repeater('#products table', 'Product List').column('product.name') all values across all rows - * in an array - */ -angular.scenario.dsl('repeater', function() { - var chain = {}; - - chain.count = function() { - return this.addFutureAction('repeater \'' + this.label + '\' count', - function($window, $document, done) { - try { - done(null, $document.elements().length); - } catch (e) { - done(null, 0); - } - }); - }; - - chain.column = function(binding) { - return this.addFutureAction('repeater \'' + this.label + '\' column \'' + binding + '\'', - function($window, $document, done) { - done(null, $document.elements().bindings($window.angular.element, binding)); - }); - }; - - chain.row = function(index) { - return this.addFutureAction('repeater \'' + this.label + '\' row \'' + index + '\'', - function($window, $document, done) { - var matches = $document.elements().slice(index, index + 1); - if (!matches.length) { - return done('row ' + index + ' out of bounds'); - } - done(null, matches.bindings($window.angular.element)); - }); - }; - - return function(selector, label) { - this.dsl.using(selector, label); - return chain; - }; -}); - -/** - * Usage: - * select(name).option('value') select one option - * select(name).options('value1', 'value2', ...) select options from a multi select - */ -angular.scenario.dsl('select', function() { - var chain = {}; - - chain.option = function(value) { - return this.addFutureAction('select \'' + this.name + '\' option \'' + value + '\'', - function($window, $document, done) { - var select = $document.elements('select[ng\\:model="$1"]', this.name); - var option = select.find('option[value="' + value + '"]'); - if (option.length) { - select.val(value); - } else { - option = select.find('option').filter(function() { - return _jQuery(this).text() === value; - }); - if (!option.length) { - option = select.find('option:contains("' + value + '")'); - } - if (option.length) { - select.val(option.val()); - } else { - return done('option \'' + value + '\' not found'); - } - } - select.trigger('change'); - done(); - }); - }; - - chain.options = function() { - var values = arguments; - return this.addFutureAction('select \'' + this.name + '\' options \'' + values + '\'', - function($window, $document, done) { - var select = $document.elements('select[multiple][ng\\:model="$1"]', this.name); - select.val(values); - select.trigger('change'); - done(); - }); - }; - - return function(name) { - this.name = name; - return chain; - }; -}); - -/** - * Usage: - * element(selector, label).count() get the number of elements that match selector - * element(selector, label).click() clicks an element - * element(selector, label).mouseover() mouseover an element - * element(selector, label).mousedown() mousedown an element - * element(selector, label).mouseup() mouseup an element - * element(selector, label).query(fn) executes fn(selectedElements, done) - * element(selector, label).{method}() gets the value (as defined by jQuery, ex. val) - * element(selector, label).{method}(value) sets the value (as defined by jQuery, ex. val) - * element(selector, label).{method}(key) gets the value (as defined by jQuery, ex. attr) - * element(selector, label).{method}(key, value) sets the value (as defined by jQuery, ex. attr) - */ -angular.scenario.dsl('element', function() { - var KEY_VALUE_METHODS = ['attr', 'css', 'prop']; - var VALUE_METHODS = [ - 'val', 'text', 'html', 'height', 'innerHeight', 'outerHeight', 'width', - 'innerWidth', 'outerWidth', 'position', 'scrollLeft', 'scrollTop', 'offset' - ]; - var chain = {}; - - chain.count = function() { - return this.addFutureAction('element \'' + this.label + '\' count', - function($window, $document, done) { - try { - done(null, $document.elements().length); - } catch (e) { - done(null, 0); - } - }); - }; - - chain.click = function() { - return this.addFutureAction('element \'' + this.label + '\' click', - function($window, $document, done) { - var elements = $document.elements(); - var href = elements.attr('href'); - var eventProcessDefault = elements.trigger('click')[0]; - - if (href && elements[0].nodeName.toLowerCase() === 'a' && eventProcessDefault) { - this.application.navigateTo(href, function() { - done(); - }, done); - } else { - done(); - } - }); - }; - - chain.dblclick = function() { - return this.addFutureAction('element \'' + this.label + '\' dblclick', - function($window, $document, done) { - var elements = $document.elements(); - var href = elements.attr('href'); - var eventProcessDefault = elements.trigger('dblclick')[0]; - - if (href && elements[0].nodeName.toLowerCase() === 'a' && eventProcessDefault) { - this.application.navigateTo(href, function() { - done(); - }, done); - } else { - done(); - } - }); - }; - - chain.mouseover = function() { - return this.addFutureAction('element \'' + this.label + '\' mouseover', - function($window, $document, done) { - var elements = $document.elements(); - elements.trigger('mouseover'); - done(); - }); - }; - - chain.mousedown = function() { - return this.addFutureAction('element \'' + this.label + '\' mousedown', - function($window, $document, done) { - var elements = $document.elements(); - elements.trigger('mousedown'); - done(); - }); - }; - - chain.mouseup = function() { - return this.addFutureAction('element \'' + this.label + '\' mouseup', - function($window, $document, done) { - var elements = $document.elements(); - elements.trigger('mouseup'); - done(); - }); - }; - - chain.query = function(fn) { - return this.addFutureAction('element ' + this.label + ' custom query', - function($window, $document, done) { - fn.call(this, $document.elements(), done); - }); - }; - - angular.forEach(KEY_VALUE_METHODS, function(methodName) { - chain[methodName] = function(name, value) { - var args = arguments, - futureName = (args.length === 1) - ? 'element \'' + this.label + '\' get ' + methodName + ' \'' + name + '\'' - : 'element \'' + this.label + '\' set ' + methodName + ' \'' + name + '\' to \'' + - value + '\''; - - return this.addFutureAction(futureName, function($window, $document, done) { - var element = $document.elements(); - done(null, element[methodName].apply(element, args)); - }); - }; - }); - - angular.forEach(VALUE_METHODS, function(methodName) { - chain[methodName] = function(value) { - var args = arguments, - futureName = (args.length === 0) - ? 'element \'' + this.label + '\' ' + methodName - : 'element \'' + this.label + '\' set ' + methodName + ' to \'' + value + '\''; - - return this.addFutureAction(futureName, function($window, $document, done) { - var element = $document.elements(); - done(null, element[methodName].apply(element, args)); - }); - }; - }); - - return function(selector, label) { - this.dsl.using(selector, label); - return chain; - }; -}); diff --git a/src/ngScenario/matchers.js b/src/ngScenario/matchers.js deleted file mode 100644 index f2dea6f1de40..000000000000 --- a/src/ngScenario/matchers.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict'; - -/** - * Matchers for implementing specs. Follows the Jasmine spec conventions. - */ - -angular.scenario.matcher('toEqual', /** @this */ function(expected) { - return angular.equals(this.actual, expected); -}); - -angular.scenario.matcher('toBe', /** @this */ function(expected) { - return this.actual === expected; -}); - -angular.scenario.matcher('toBeDefined', /** @this */ function() { - return angular.isDefined(this.actual); -}); - -angular.scenario.matcher('toBeTruthy', /** @this */ function() { - return this.actual; -}); - -angular.scenario.matcher('toBeFalsy', /** @this */ function() { - return !this.actual; -}); - -angular.scenario.matcher('toMatch', /** @this */ function(expected) { - return new RegExp(expected).test(this.actual); -}); - -angular.scenario.matcher('toBeNull', /** @this */ function() { - return this.actual === null; -}); - -angular.scenario.matcher('toContain', /** @this */ function(expected) { - return includes(this.actual, expected); -}); - -angular.scenario.matcher('toBeLessThan', /** @this */ function(expected) { - return this.actual < expected; -}); - -angular.scenario.matcher('toBeGreaterThan', /** @this */ function(expected) { - return this.actual > expected; -}); diff --git a/src/ngScenario/output/Html.js b/src/ngScenario/output/Html.js deleted file mode 100644 index dcd87a3f76b5..000000000000 --- a/src/ngScenario/output/Html.js +++ /dev/null @@ -1,171 +0,0 @@ -'use strict'; - -/** - * User Interface for the Scenario Runner. - * - * TODO(esprehn): This should be refactored now that ObjectModel exists - * to use AngularJS bindings for the UI. - */ -angular.scenario.output('html', function(context, runner, model) { - var specUiMap = {}, - lastStepUiMap = {}; - - context.append( - '' + - '
    ' + - '
    ' + - '
    ' - ); - - runner.on('InteractivePause', function(spec) { - var ui = lastStepUiMap[spec.id]; - ui.find('.test-title'). - html('paused... resume when ready.'); - }); - - runner.on('SpecBegin', function(spec) { - var ui = findContext(spec); - ui.find('> .tests').append( - '
  • ' - ); - ui = ui.find('> .tests li:last'); - ui.append( - '
    ' + - '

    ' + - ' ' + - ' ' + - '

    ' + - '
    ' + - '
    ' + - '
      ' + - '
      ' - ); - ui.find('> .test-info .test-name').text(spec.name); - ui.find('> .test-info').click(function() { - var scrollpane = ui.find('> .scrollpane'); - var actions = scrollpane.find('> .test-actions'); - var name = context.find('> .test-info .test-name'); - if (actions.find(':visible').length) { - actions.hide(); - name.removeClass('open').addClass('closed'); - } else { - actions.show(); - scrollpane.attr('scrollTop', scrollpane.attr('scrollHeight')); - name.removeClass('closed').addClass('open'); - } - }); - - specUiMap[spec.id] = ui; - }); - - runner.on('SpecError', function(spec, error) { - var ui = specUiMap[spec.id]; - ui.append('
      ');
      -    ui.find('> pre').text(formatException(error));
      -  });
      -
      -  runner.on('SpecEnd', function(spec) {
      -    var ui = specUiMap[spec.id];
      -    spec = model.getSpec(spec.id);
      -    ui.removeClass('status-pending');
      -    ui.addClass('status-' + spec.status);
      -    ui.find('> .test-info .timer-result').text(spec.duration + 'ms');
      -    if (spec.status === 'success') {
      -      ui.find('> .test-info .test-name').addClass('closed');
      -      ui.find('> .scrollpane .test-actions').hide();
      -    }
      -    updateTotals(spec.status);
      -  });
      -
      -  runner.on('StepBegin', function(spec, step) {
      -    var ui = specUiMap[spec.id];
      -    spec = model.getSpec(spec.id);
      -    step = spec.getLastStep();
      -    ui.find('> .scrollpane .test-actions').append('
    1. '); - var stepUi = lastStepUiMap[spec.id] = ui.find('> .scrollpane .test-actions li:last'); - stepUi.append( - '
      ' + - '
      ' - ); - stepUi.find('> .test-title').text(step.name); - var scrollpane = stepUi.parents('.scrollpane'); - scrollpane.attr('scrollTop', scrollpane.attr('scrollHeight')); - }); - - runner.on('StepFailure', function(spec, step, error) { - var ui = lastStepUiMap[spec.id]; - addError(ui, step.line, error); - }); - - runner.on('StepError', function(spec, step, error) { - var ui = lastStepUiMap[spec.id]; - addError(ui, step.line, error); - }); - - runner.on('StepEnd', function(spec, step) { - var stepUi = lastStepUiMap[spec.id]; - spec = model.getSpec(spec.id); - step = spec.getLastStep(); - stepUi.find('.timer-result').text(step.duration + 'ms'); - stepUi.removeClass('status-pending'); - stepUi.addClass('status-' + step.status); - var scrollpane = specUiMap[spec.id].find('> .scrollpane'); - scrollpane.attr('scrollTop', scrollpane.attr('scrollHeight')); - }); - - /** - * Finds the context of a spec block defined by the passed definition. - * - * @param {Object} The definition created by the Describe object. - */ - function findContext(spec) { - var currentContext = context.find('#specs'); - angular.forEach(model.getDefinitionPath(spec), function(defn) { - var id = 'describe-' + defn.id; - if (!context.find('#' + id).length) { - currentContext.find('> .test-children').append( - '
      ' + - '

      ' + - '
      ' + - '
        ' + - '
        ' - ); - context.find('#' + id).find('> h2').text('describe: ' + defn.name); - } - currentContext = context.find('#' + id); - }); - return context.find('#describe-' + spec.definition.id); - } - - /** - * Updates the test counter for the status. - * - * @param {string} the status. - */ - function updateTotals(status) { - var legend = context.find('#status-legend .status-' + status); - var parts = legend.text().split(' '); - var value = (parts[0] * 1) + 1; - legend.text(value + ' ' + parts[1]); - } - - /** - * Add an error to a step. - * - * @param {Object} The JQuery wrapped context - * @param {function()} fn() that should return the file/line number of the error - * @param {Object} the error. - */ - function addError(context, line, error) { - context.find('.test-title').append('
        ');
        -    var message = _jQuery.trim(line() + '\n\n' + formatException(error));
        -    context.find('.test-title pre:last').text(message);
        -  }
        -});
        diff --git a/src/ngScenario/output/Json.js b/src/ngScenario/output/Json.js
        deleted file mode 100644
        index c024d923aab9..000000000000
        --- a/src/ngScenario/output/Json.js
        +++ /dev/null
        @@ -1,10 +0,0 @@
        -'use strict';
        -
        -/**
        - * Generates JSON output into a context.
        - */
        -angular.scenario.output('json', function(context, runner, model) {
        -  model.on('RunnerEnd', function() {
        -    context.text(angular.toJson(model.value));
        -  });
        -});
        diff --git a/src/ngScenario/output/Object.js b/src/ngScenario/output/Object.js
        deleted file mode 100644
        index 621b816f3253..000000000000
        --- a/src/ngScenario/output/Object.js
        +++ /dev/null
        @@ -1,8 +0,0 @@
        -'use strict';
        -
        -/**
        - * Creates a global value $result with the result of the runner.
        - */
        -angular.scenario.output('object', function(context, runner, model) {
        -  runner.$window.$result = model.value;
        -});
        diff --git a/src/ngScenario/output/Xml.js b/src/ngScenario/output/Xml.js
        deleted file mode 100644
        index cfd04f5e529d..000000000000
        --- a/src/ngScenario/output/Xml.js
        +++ /dev/null
        @@ -1,54 +0,0 @@
        -'use strict';
        -
        -/**
        - * Generates XML output into a context.
        - */
        -angular.scenario.output('xml', function(context, runner, model) {
        -  var $ = function(args) {
        -    // eslint-disable-next-line new-cap
        -    return new context.init(args);
        -  };
        -  model.on('RunnerEnd', function() {
        -    var scenario = $('');
        -    context.append(scenario);
        -    serializeXml(scenario, model.value);
        -  });
        -
        -  /**
        -   * Convert the tree into XML.
        -   *
        -   * @param {Object} context jQuery context to add the XML to.
        -   * @param {Object} tree node to serialize
        -   */
        -  function serializeXml(context, tree) {
        -     angular.forEach(tree.children, function(child) {
        -       var describeContext = $('');
        -       describeContext.attr('id', child.id);
        -       describeContext.attr('name', child.name);
        -       context.append(describeContext);
        -       serializeXml(describeContext, child);
        -     });
        -     var its = $('');
        -     context.append(its);
        -     angular.forEach(tree.specs, function(spec) {
        -       var it = $('');
        -       it.attr('id', spec.id);
        -       it.attr('name', spec.name);
        -       it.attr('duration', spec.duration);
        -       it.attr('status', spec.status);
        -       its.append(it);
        -       angular.forEach(spec.steps, function(step) {
        -         var stepContext = $('');
        -         stepContext.attr('name', step.name);
        -         stepContext.attr('duration', step.duration);
        -         stepContext.attr('status', step.status);
        -         it.append(stepContext);
        -         if (step.error) {
        -           var error = $('');
        -           stepContext.append(error);
        -           error.text(formatException(step.error));
        -         }
        -       });
        -     });
        -   }
        -});
        diff --git a/test/ng/directive/inputSpec.js b/test/ng/directive/inputSpec.js
        index afc869074a78..9c58807345d3 100644
        --- a/test/ng/directive/inputSpec.js
        +++ b/test/ng/directive/inputSpec.js
        @@ -422,8 +422,7 @@ describe('input', function() {
         
                     scope.field = 'fake field';
                     scope.$watch('field', function() {
        -              // We need to use _originalTrigger since trigger is modified by AngularJS Scenario.
        -              inputElm._originalTrigger('change');
        +              inputElm.trigger('change');
                     });
                     scope.$apply();
                   };
        diff --git a/test/ngScenario/ApplicationSpec.js b/test/ngScenario/ApplicationSpec.js
        deleted file mode 100644
        index 176f5b0a8ce0..000000000000
        --- a/test/ngScenario/ApplicationSpec.js
        +++ /dev/null
        @@ -1,244 +0,0 @@
        -'use strict';
        -
        -describe('angular.scenario.Application', function() {
        -  var $window;
        -  var app, frames;
        -
        -  function callLoadHandlers(app) {
        -    var handler = app.getFrame_().triggerHandler('load');
        -  }
        -
        -  beforeEach(function() {
        -    window.document.body.innerHTML = '';
        -    frames = _jQuery('
        '); - _jQuery(window.document.body).append(frames); - app = new angular.scenario.Application(frames); - }); - - - afterEach(function() { - _jQuery('iframe').off(); // cleanup any leftover onload handlers - window.document.body.innerHTML = ''; - }); - - - it('should return new $window and $document after navigateTo', function() { - var called; - var testWindow, testDocument, counter = 0; - app.getWindow_ = function() { - return {x:counter++, document:{x:counter++}}; - }; - app.navigateTo('http://www.google.com/'); - app.executeAction(function($window, $document) { - testWindow = $window; - testDocument = $document; - }); - app.navigateTo('http://www.google.com/'); - app.executeAction(function($window, $document) { - expect($window).not.toEqual(testWindow); - expect($document).not.toEqual(testDocument); - called = true; - }); - expect(called).toBeTruthy(); - }); - - it('should execute callback with correct arguments', function() { - var called; - var testWindow = {document: {}}; - app.getWindow_ = function() { - return testWindow; - }; - app.executeAction(function($window, $document) { - expect(this).toEqual(app); - expect($document).toEqual(_jQuery($window.document)); - expect($window).toEqual(testWindow); - called = true; - }); - expect(called).toBeTruthy(); - }); - - it('should use a new iframe each time', function() { - app.navigateTo('http://localhost/'); - var frame = app.getFrame_(); - frame.attr('test', true); - app.navigateTo('http://localhost/'); - expect(app.getFrame_().attr('test')).toBeFalsy(); - }); - - it('should call error handler if document not accessible', function() { - var called; - app.getWindow_ = function() { - return {}; - }; - app.navigateTo('http://localhost/', angular.noop, function(error) { - expect(error).toMatch(/Sandbox Error/); - called = true; - }); - callLoadHandlers(app); - expect(called).toBeTruthy(); - }); - - it('should call error handler if navigating to about:blank', function() { - var called; - app.navigateTo('about:blank', angular.noop, function(error) { - expect(error).toMatch(/Sandbox Error/); - called = true; - }); - expect(called).toBeTruthy(); - }); - - it('should remove old iframes', function() { - app.navigateTo('http://localhost/#foo'); - frames.find('iframe')[0].id = 'test'; - - app.navigateTo('http://localhost/#bar'); - var iframes = frames.find('iframe'); - - expect(iframes.length).toEqual(1); - expect(iframes[0].src).toEqual('http://localhost/#bar'); - expect(iframes[0].id).toBeFalsy(); - }); - - it('should URL update description bar', function() { - app.navigateTo('http://localhost/'); - var anchor = frames.find('> h2 a'); - expect(anchor.attr('href')).toEqual('http://localhost/'); - expect(anchor.text()).toEqual('http://localhost/'); - }); - - it('should call onload handler when frame loads', function() { - var called; - app.getWindow_ = function() { - return {document: {}}; - }; - app.navigateTo('http://localhost/', function($window, $document) { - called = true; - }); - callLoadHandlers(app); - expect(called).toBeTruthy(); - }); - - it('should set rootElement when navigateTo instigates bootstrap', inject(function($injector, $browser) { - var called; - var testWindow = { - document: jqLite('
        ')[0], - angular: { - element: jqLite, - service: {}, - resumeBootstrap: noop - } - }; - jqLite(testWindow.document).data('$injector', $injector); - var resumeBootstrapSpy = spyOn(testWindow.angular, 'resumeBootstrap').and.returnValue($injector); - - var injectorGet = $injector.get; - spyOn($injector, 'get').and.callFake(function(name) { - switch (name) { - case '$rootElement': return jqLite(testWindow.document); - default: return injectorGet(name); - } - }); - - app.getWindow_ = function() { - return testWindow; - }; - app.navigateTo('http://localhost/', noop); - callLoadHandlers(app); - expect(app.rootElement).toBe(testWindow.document); - expect(resumeBootstrapSpy).toHaveBeenCalled(); - dealoc(testWindow.document); - })); - - it('should set setup resumeDeferredBootstrap if resumeBootstrap is not yet defined', inject(function($injector, $browser) { - var called; - var testWindow = { - document: jqLite('
        ')[0], - angular: { - element: jqLite, - service: {}, - resumeBootstrap: null - } - }; - jqLite(testWindow.document).data('$injector', $injector); - - var injectorGet = $injector.get; - var injectorSpy = spyOn($injector, 'get').and.callFake(function(name) { - switch (name) { - case '$rootElement': return jqLite(testWindow.document); - default: return injectorGet(name); - } - }); - - app.getWindow_ = function() { - return testWindow; - }; - app.navigateTo('http://localhost/', noop); - expect(testWindow.angular.resumeDeferredBootstrap).toBeUndefined(); - callLoadHandlers(app); - expect(testWindow.angular.resumeDeferredBootstrap).toBeDefined(); - expect(app.rootElement).toBeUndefined(); - expect(injectorSpy).not.toHaveBeenCalled(); - - var resumeBootstrapSpy = spyOn(testWindow.angular, 'resumeBootstrap').and.returnValue($injector); - testWindow.angular.resumeDeferredBootstrap(); - expect(app.rootElement).toBe(testWindow.document); - expect(resumeBootstrapSpy).toHaveBeenCalled(); - expect(injectorSpy).toHaveBeenCalledWith('$rootElement'); - dealoc(testWindow.document); - })); - - it('should wait for pending requests in executeAction', inject(function($injector, $browser) { - var called, polled; - var handlers = []; - var testWindow = { - document: jqLite('
        ')[0], - angular: { - element: jqLite, - service: {} - } - }; - $browser.notifyWhenNoOutstandingRequests = function(fn) { - handlers.push(fn); - }; - jqLite(testWindow.document).data('$injector', $injector); - app.getWindow_ = function() { - return testWindow; - }; - app.executeAction(function($window, $document) { - expect($window).toEqual(testWindow); - expect($document).toBeDefined(); - expect($document[0].className).toEqual('test-foo'); - }); - expect(handlers.length).toEqual(1); - handlers[0](); - dealoc(testWindow.document); - })); - - it('should allow explicit rootElement', inject(function($injector, $browser) { - var called, polled; - var handlers = []; - var testWindow = { - document: jqLite('
        ')[0], - angular: { - element: jqLite, - service: {} - } - }; - $browser.notifyWhenNoOutstandingRequests = function(fn) { - handlers.push(fn); - }; - app.rootElement = testWindow.document; - jqLite(testWindow.document).data('$injector', $injector); - app.getWindow_ = function() { - return testWindow; - }; - app.executeAction(function($window, $document) { - expect($window).toEqual(testWindow); - expect($document).toBeDefined(); - expect($document[0].className).toEqual('test-foo'); - }); - expect(handlers.length).toEqual(1); - handlers[0](); - dealoc(testWindow.document); - })); -}); diff --git a/test/ngScenario/DescribeSpec.js b/test/ngScenario/DescribeSpec.js deleted file mode 100644 index b911ab75031a..000000000000 --- a/test/ngScenario/DescribeSpec.js +++ /dev/null @@ -1,123 +0,0 @@ -'use strict'; - -describe('angular.scenario.Describe', function() { - var log; - var root; - - beforeEach(function() { - root = new angular.scenario.Describe(); - - /** - * Simple callback logging system. Use to assert proper order of calls. - */ - log = function(text) { - log.text = log.text + text; - }; - log.fn = function(text) { - return function(done) { - log(text); - (done || angular.noop)(); - }; - }; - log.reset = function() { - log.text = ''; - }; - log.reset(); - }); - - it('should handle basic nested case', function() { - root.describe('A', function() { - this.beforeEach(log.fn('{')); - this.afterEach(log.fn('}')); - this.it('1', log.fn('1')); - this.describe('B', function() { - this.beforeEach(log.fn('(')); - this.afterEach(log.fn(')')); - this.it('2', log.fn('2')); - }); - }); - var specs = root.getSpecs(); - expect(specs.length).toEqual(2); - - expect(specs[0].name).toEqual('2'); - specs[0].before(); - specs[0].body(); - specs[0].after(); - expect(log.text).toEqual('{(2)}'); - - log.reset(); - expect(specs[1].name).toEqual('1'); - specs[1].before(); - specs[1].body(); - specs[1].after(); - expect(log.text).toEqual('{1}'); - }); - - it('should link nested describe blocks with parent and children', function() { - root.describe('A', function() { - this.it('1', angular.noop); - this.describe('B', function() { - this.it('2', angular.noop); - this.describe('C', function() { - this.it('3', angular.noop); - }); - }); - }); - var specs = root.getSpecs(); - expect(specs[2].definition.parent).toEqual(root); - expect(specs[0].definition.parent).toEqual(specs[2].definition.children[0]); - }); - - it('should not process xit and xdescribe', function() { - root.describe('A', function() { - this.xit('1', angular.noop); - this.xdescribe('B', function() { - this.it('2', angular.noop); - this.describe('C', function() { - this.it('3', angular.noop); - }); - }); - }); - var specs = root.getSpecs(); - expect(specs.length).toEqual(0); - }); - - - it('should only return iit and ddescribe if present', function() { - root.describe('A', function() { - this.it('1', angular.noop); - this.iit('2', angular.noop); - this.describe('B', function() { - this.it('3', angular.noop); - this.ddescribe('C', function() { - this.it('4', angular.noop); - this.describe('D', function() { - this.it('5', angular.noop); - }); - }); - }); - }); - var specs = root.getSpecs(); - expect(specs.length).toEqual(3); - expect(specs[0].name).toEqual('5'); - expect(specs[1].name).toEqual('4'); - expect(specs[2].name).toEqual('2'); - }); - - it('should create uniqueIds in the tree', function() { - angular.scenario.Describe.id = 0; - var a = new angular.scenario.Describe(); - var b = new angular.scenario.Describe(); - expect(a.id).not.toEqual(b.id); - }); - - it('should create uniqueIds for each spec', function() { - var d = new angular.scenario.Describe(); - d.it('fake', function() {}); - d.it('fake', function() {}); - - expect(d.its[0].id).toBeDefined(); - expect(d.its[1].id).toBeDefined(); - expect(d.its[0].id).not.toEqual(d.its[1].id); - }); -}); diff --git a/test/ngScenario/FutureSpec.js b/test/ngScenario/FutureSpec.js deleted file mode 100644 index 9ae284dc8e17..000000000000 --- a/test/ngScenario/FutureSpec.js +++ /dev/null @@ -1,77 +0,0 @@ -'use strict'; - -describe('angular.scenario.Future', function() { - var future; - - it('should set the sane defaults', function() { - var behavior = function() {}; - var future = new angular.scenario.Future('test name', behavior, 'foo'); - expect(future.name).toEqual('test name'); - expect(future.behavior).toEqual(behavior); - expect(future.line).toEqual('foo'); - expect(future.value).toBeUndefined(); - expect(future.fulfilled).toBeFalsy(); - expect(future.parser).toEqual(angular.identity); - }); - - it('should be fulfilled after execution and done callback', function() { - var future = new angular.scenario.Future('test name', function(done) { - done(); - }); - future.execute(angular.noop); - expect(future.fulfilled).toBeTruthy(); - }); - - it('should take callback with (error, result) and forward', function() { - var future = new angular.scenario.Future('test name', function(done) { - done(10, 20); - }); - future.execute(function(error, result) { - expect(error).toEqual(10); - expect(result).toEqual(20); - }); - }); - - it('should use error as value if provided', function() { - var future = new angular.scenario.Future('test name', function(done) { - done(10, 20); - }); - future.execute(angular.noop); - expect(future.value).toEqual(10); - }); - - it('should parse json with fromJson', function() { - var future = new angular.scenario.Future('test name', function(done) { - done(null, '{"test": "foo"}'); - }); - future.fromJson().execute(angular.noop); - expect(future.value).toEqual({test: 'foo'}); - }); - - it('should convert to json with toJson', function() { - var future = new angular.scenario.Future('test name', function(done) { - done(null, {test: 'foo'}); - }); - future.toJson().execute(angular.noop); - expect(future.value).toEqual('{"test":"foo"}'); - }); - - it('should convert with custom parser', function() { - var future = new angular.scenario.Future('test name', function(done) { - done(null, 'foo'); - }); - future.parsedWith(function(value) { - return value.toUpperCase(); - }).execute(angular.noop); - expect(future.value).toEqual('FOO'); - }); - - it('should pass error if parser fails', function() { - var future = new angular.scenario.Future('test name', function(done) { - done(null, '{'); - }); - future.fromJson().execute(function(error, result) { - expect(error).toBeDefined(); - }); - }); -}); diff --git a/test/ngScenario/ObjectModelSpec.js b/test/ngScenario/ObjectModelSpec.js deleted file mode 100644 index 749041451753..000000000000 --- a/test/ngScenario/ObjectModelSpec.js +++ /dev/null @@ -1,333 +0,0 @@ -'use strict'; - -describe('angular.scenario.ObjectModel', function() { - var model; - var runner; - var spec, step; - - function buildSpec(id, name, definitions) { - var spec = { - id: id, - name: name, - definition: { - name: definitions.shift() - } - }; - var currentDef = spec.definition; - - forEach(definitions, function(defName) { - currentDef.parent = { - name: defName - }; - currentDef = currentDef.parent; - }); - - return spec; - } - - function buildStep(name, line) { - return { - name: name || 'test step', - line: function() { return line || ''; } - }; - } - - beforeEach(function() { - spec = buildSpec(1, 'test spec', ['describe 1']); - step = buildStep(); - runner = new angular.scenario.testing.MockRunner(); - model = new angular.scenario.ObjectModel(runner); - }); - - it('should value default empty value', function() { - expect(model.value).toEqual({ - name: '', - children: {} - }); - }); - - it('should add spec and create describe blocks on SpecBegin event', function() { - runner.emit('SpecBegin', buildSpec(1, 'test spec', ['describe 2', 'describe 1'])); - - expect(model.value.children['describe 1']).toBeDefined(); - expect(model.value.children['describe 1'].children['describe 2']).toBeDefined(); - expect(model.value.children['describe 1'].children['describe 2'].specs['test spec']).toBeDefined(); - }); - - it('should set fullDefinitionName on SpecBegin event', function() { - runner.emit('SpecBegin', buildSpec(1, 'fake spec', ['describe 2'])); - var spec = model.getSpec(1); - - expect(spec.fullDefinitionName).toBeDefined(); - expect(spec.fullDefinitionName).toEqual('describe 2'); - }); - - it('should set fullDefinitionName on SpecBegin event (join more names by space)', function() { - runner.emit('SpecBegin', buildSpec(1, 'fake spec', ['describe 2', 'describe 1'])); - var spec = model.getSpec(1); - - expect(spec.fullDefinitionName).toEqual('describe 1 describe 2'); - }); - - it('should add step to spec on StepBegin', function() { - runner.emit('SpecBegin', spec); - runner.emit('StepBegin', spec, step); - runner.emit('StepEnd', spec, step); - runner.emit('SpecEnd', spec); - - expect(model.value.children['describe 1'].specs['test spec'].steps.length).toEqual(1); - }); - - it('should update spec timer duration on SpecEnd event', function() { - runner.emit('SpecBegin', spec); - runner.emit('SpecEnd', spec); - - expect(model.value.children['describe 1'].specs['test spec'].duration).toBeDefined(); - }); - - it('should update step timer duration on StepEnd event', function() { - runner.emit('SpecBegin', spec); - runner.emit('StepBegin', spec, step); - runner.emit('StepEnd', spec, step); - runner.emit('SpecEnd', spec); - - expect(model.value.children['describe 1'].specs['test spec'].steps[0].duration).toBeDefined(); - }); - - it('should set spec status on SpecEnd to success if no status set', function() { - runner.emit('SpecBegin', spec); - runner.emit('SpecEnd', spec); - - expect(model.value.children['describe 1'].specs['test spec'].status).toEqual('success'); - }); - - it('should set status to error after SpecError', function() { - runner.emit('SpecBegin', spec); - runner.emit('SpecError', spec, 'error'); - - expect(model.value.children['describe 1'].specs['test spec'].status).toEqual('error'); - }); - - it('should set spec status to failure if step fails', function() { - runner.emit('SpecBegin', spec); - runner.emit('StepBegin', spec, step); - runner.emit('StepEnd', spec, step); - runner.emit('StepBegin', spec, step); - runner.emit('StepFailure', spec, step, 'error'); - runner.emit('StepEnd', spec, step); - runner.emit('StepBegin', spec, step); - runner.emit('StepEnd', spec, step); - runner.emit('SpecEnd', spec); - - expect(model.value.children['describe 1'].specs['test spec'].status).toEqual('failure'); - }); - - it('should set spec status to error if step errors', function() { - runner.emit('SpecBegin', spec); - runner.emit('StepBegin', spec, step); - runner.emit('StepError', spec, step, 'error'); - runner.emit('StepEnd', spec, step); - runner.emit('StepBegin', spec, step); - runner.emit('StepFailure', spec, step, 'error'); - runner.emit('StepEnd', spec, step); - runner.emit('SpecEnd', spec); - - expect(model.value.children['describe 1'].specs['test spec'].status).toEqual('error'); - }); - - describe('events', function() { - var Spec = angular.scenario.ObjectModel.Spec, - Step = angular.scenario.ObjectModel.Step, - callback; - - beforeEach(function() { - callback = jasmine.createSpy('listener'); - }); - - it('should provide method for registering a listener', function() { - expect(model.on).toBeDefined(); - expect(model.on instanceof Function).toBe(true); - }); - - it('should forward SpecBegin event', function() { - model.on('SpecBegin', callback); - runner.emit('SpecBegin', spec); - - expect(callback).toHaveBeenCalled(); - }); - - it('should forward SpecBegin event with ObjectModel.Spec as a param', function() { - model.on('SpecBegin', callback); - runner.emit('SpecBegin', spec); - - expect(callback.calls.mostRecent().args[0] instanceof Spec).toBe(true); - expect(callback.calls.mostRecent().args[0].name).toEqual(spec.name); - }); - - it('should forward SpecError event', function() { - model.on('SpecError', callback); - runner.emit('SpecBegin', spec); - runner.emit('SpecError', spec, {}); - - expect(callback).toHaveBeenCalled(); - }); - - it('should forward SpecError event with ObjectModel.Spec and error as a params', function() { - var error = {}; - model.on('SpecError', callback); - runner.emit('SpecBegin', spec); - runner.emit('SpecError', spec, error); - - var param = callback.calls.mostRecent().args[0]; - expect(param instanceof Spec).toBe(true); - expect(param.name).toEqual(spec.name); - expect(param.status).toEqual('error'); - expect(param.error).toBe(error); - }); - - it('should forward SpecEnd event', function() { - model.on('SpecEnd', callback); - runner.emit('SpecBegin', spec); - runner.emit('SpecEnd', spec); - - expect(callback).toHaveBeenCalled(); - }); - - it('should forward SpecEnd event with ObjectModel.Spec as a param', function() { - model.on('SpecEnd', callback); - runner.emit('SpecBegin', spec); - runner.emit('SpecEnd', spec); - - expect(callback.calls.mostRecent().args[0] instanceof Spec).toBe(true); - expect(callback.calls.mostRecent().args[0].name).toEqual(spec.name); - }); - - it('should forward StepBegin event', function() { - model.on('StepBegin', callback); - runner.emit('SpecBegin', spec); - runner.emit('StepBegin', spec, step); - - expect(callback).toHaveBeenCalled(); - }); - - it('should forward StepBegin event with Spec and Step as params', function() { - model.on('StepBegin', callback); - runner.emit('SpecBegin', spec); - runner.emit('StepBegin', spec, step); - - var params = callback.calls.mostRecent().args; - expect(params[0] instanceof Spec).toBe(true); - expect(params[0].name).toEqual(spec.name); - expect(params[1] instanceof Step).toBe(true); - }); - - it('should forward StepError event', function() { - model.on('StepError', callback); - runner.emit('SpecBegin', spec); - runner.emit('StepBegin', spec, step); - runner.emit('StepError', spec, step, {}); - - expect(callback).toHaveBeenCalled(); - }); - - it('should forward StepError event with Spec, Step and error as params', function() { - var error = {}; - model.on('StepError', callback); - runner.emit('SpecBegin', spec); - runner.emit('StepBegin', spec, step); - runner.emit('StepError', spec, step, error); - - var params = callback.calls.mostRecent().args; - expect(params[0] instanceof Spec).toBe(true); - expect(params[0].name).toEqual(spec.name); - expect(params[1] instanceof Step).toBe(true); - expect(params[1].status).toEqual('error'); - expect(params[2]).toBe(error); - }); - - it('should forward StepFailure event', function() { - model.on('StepFailure', callback); - runner.emit('SpecBegin', spec); - runner.emit('StepBegin', spec, step); - runner.emit('StepFailure', spec, step, {}); - - expect(callback).toHaveBeenCalled(); - }); - - it('should forward StepFailure event with Spec, Step and error as params', function() { - var error = {}; - model.on('StepFailure', callback); - runner.emit('SpecBegin', spec); - runner.emit('StepBegin', spec, step); - runner.emit('StepFailure', spec, step, error); - - var params = callback.calls.mostRecent().args; - expect(params[0] instanceof Spec).toBe(true); - expect(params[0].name).toEqual(spec.name); - expect(params[1] instanceof Step).toBe(true); - expect(params[1].status).toEqual('failure'); - expect(params[2]).toBe(error); - }); - - it('should forward StepEnd event', function() { - model.on('StepEnd', callback); - runner.emit('SpecBegin', spec); - runner.emit('StepBegin', spec, step); - runner.emit('StepEnd', spec, step); - - expect(callback).toHaveBeenCalled(); - }); - - it('should forward StepEnd event with Spec and Step as params', function() { - model.on('StepEnd', callback); - runner.emit('SpecBegin', spec); - runner.emit('StepBegin', spec, step); - runner.emit('StepEnd', spec, step); - - var params = callback.calls.mostRecent().args; - expect(params[0] instanceof Spec).toBe(true); - expect(params[0].name).toEqual(spec.name); - expect(params[1] instanceof Step).toBe(true); - }); - - it('should forward RunnerEnd event', function() { - model.on('RunnerEnd', callback); - runner.emit('RunnerEnd'); - expect(callback).toHaveBeenCalled(); - }); - - it('should set error of first failure', function() { - var error = 'first-error', - step2 = buildStep(); - - model.on('SpecEnd', function(spec) { - expect(spec.error).toBeDefined(); - expect(spec.error).toBe(error); - }); - - runner.emit('SpecBegin', spec); - runner.emit('StepBegin', spec, step); - runner.emit('StepFailure', spec, step, error); - runner.emit('StepBegin', spec, step2); - runner.emit('StepFailure', spec, step2, 'second-error'); - runner.emit('SpecEnd', spec); - }); - - it('should set line number of first failure', function() { - var step = buildStep('fake', 'first-line'), - step2 = buildStep('fake2', 'second-line'); - - model.on('SpecEnd', function(spec) { - expect(spec.line).toBeDefined(); - expect(spec.line).toBe('first-line'); - }); - - runner.emit('SpecBegin', spec); - runner.emit('StepBegin', spec, step); - runner.emit('StepFailure', spec, step, null); - runner.emit('StepBegin', spec, step2); - runner.emit('StepFailure', spec, step2, null); - runner.emit('SpecEnd', spec); - }); - }); -}); diff --git a/test/ngScenario/RunnerSpec.js b/test/ngScenario/RunnerSpec.js deleted file mode 100644 index 3de151a55d27..000000000000 --- a/test/ngScenario/RunnerSpec.js +++ /dev/null @@ -1,116 +0,0 @@ -'use strict'; - -/** - * Mock spec runner. - */ -function MockSpecRunner() {} -MockSpecRunner.prototype.run = function(spec, specDone) { - spec.before.call(this); - spec.body.call(this); - spec.after.call(this); - specDone(); -}; - -MockSpecRunner.prototype.addFuture = function(name, fn, line) { - return {name: name, fn: fn, line: line}; -}; - -describe('angular.scenario.Runner', function() { - var $window; - var runner; - - beforeEach(function() { - // Trick to get the scope out of a DSL statement - angular.scenario.dsl('dslAddFuture', function() { - return function() { - return this.addFuture('future name', angular.noop); - }; - }); - // Trick to get the scope out of a DSL statement - angular.scenario.dsl('dslScope', function() { - var scope = this; - return function() { return scope; }; - }); - // Trick to get the scope out of a DSL statement - angular.scenario.dsl('dslChain', function() { - return function() { - this.chained = 0; - this.chain = function() { this.chained++; return this; }; - return this; - }; - }); - $window = { - location: {} - }; - runner = new angular.scenario.Runner($window); - runner.on('SpecError', angular.mock.rethrow); - runner.on('StepError', angular.mock.rethrow); - }); - - afterEach(function() { - delete angular.scenario.dsl.dslScope; - delete angular.scenario.dsl.dslChain; - }); - - it('should publish the functions in the public API', function() { - angular.forEach(runner.api, function(fn, name) { - var func; - if (name in $window) { - func = $window[name]; - } - expect(angular.isFunction(func)).toBeTruthy(); - }); - }); - - it('should construct valid describe trees with public API', function() { - var before = []; - var after = []; - $window.describe('A', function() { - $window.beforeEach(function() { before.push('A'); }); - $window.afterEach(function() { after.push('A'); }); - $window.it('1', angular.noop); - $window.describe('B', function() { - $window.beforeEach(function() { before.push('B'); }); - $window.afterEach(function() { after.push('B'); }); - $window.it('2', angular.noop); - $window.describe('C', function() { - $window.beforeEach(function() { before.push('C'); }); - $window.afterEach(function() { after.push('C'); }); - $window.it('3', angular.noop); - }); - }); - }); - var specs = runner.rootDescribe.getSpecs(); - specs[0].before(); - specs[0].body(); - specs[0].after(); - expect(before).toEqual(['A', 'B', 'C']); - expect(after).toEqual(['C', 'B', 'A']); - expect(specs[2].definition.parent).toEqual(runner.rootDescribe); - expect(specs[0].definition.parent).toEqual(specs[2].definition.children[0]); - }); - - it('should publish the DSL statements to the $window', function() { - $window.describe('describe', function() { - $window.it('1', function() { - expect($window.dslScope).toBeDefined(); - }); - }); - runner.run(null/*application*/); - }); - - it('should create a new scope for each DSL chain', function() { - $window.describe('describe', function() { - $window.it('1', function() { - var scope = $window.dslScope(); - scope.test = 'foo'; - expect($window.dslScope().test).toBeUndefined(); - }); - $window.it('2', function() { - var scope = $window.dslChain().chain().chain(); - expect(scope.chained).toEqual(2); - }); - }); - runner.run(null/*application*/); - }); -}); diff --git a/test/ngScenario/ScenarioSpec.js b/test/ngScenario/ScenarioSpec.js deleted file mode 100644 index d3451a2ba327..000000000000 --- a/test/ngScenario/ScenarioSpec.js +++ /dev/null @@ -1,44 +0,0 @@ -'use strict'; - -describe('ScenarioSpec: Compilation', function() { - var element; - - afterEach(function() { - dealoc(element); - }); - - - describe('compilation', function() { - it('should compile dom node and return scope', inject(function($rootScope, $compile) { - var node = jqLite('
        {{b=a+1}}
        ')[0]; - element = $compile(node)($rootScope); - $rootScope.$digest(); - expect($rootScope.a).toEqual(1); - expect($rootScope.b).toEqual(2); - })); - - it('should compile jQuery node and return scope', inject(function($rootScope, $compile) { - element = $compile(jqLite('
        {{a=123}}
        '))($rootScope); - $rootScope.$digest(); - expect(jqLite(element).text()).toEqual('123'); - })); - - it('should compile text node and return scope', inject(function($rootScope, $compile) { - element = $compile('
        {{a=123}}
        ')($rootScope); - $rootScope.$digest(); - expect(jqLite(element).text()).toEqual('123'); - })); - }); - - describe('jQuery', function() { - it('should exist on the angular.scenario object', function() { - expect(angular.scenario.jQuery).toBeDefined(); - }); - - it('should have common jQuery methods', function() { - var jQuery = angular.scenario.jQuery; - expect(typeof jQuery).toEqual('function'); - expect(typeof jQuery('
        ').html).toEqual('function'); - }); - }); -}); diff --git a/test/ngScenario/SpecRunnerSpec.js b/test/ngScenario/SpecRunnerSpec.js deleted file mode 100644 index 2e102ae2ea98..000000000000 --- a/test/ngScenario/SpecRunnerSpec.js +++ /dev/null @@ -1,177 +0,0 @@ -'use strict'; - -/** - * Mock Application - */ -function ApplicationMock($window) { - this.$window = $window; -} -ApplicationMock.prototype = { - executeAction: function(callback) { - callback.call(this.$window, _jQuery(this.$window.document), this.$window); - } -}; - -describe('angular.scenario.SpecRunner', function() { - var $window, $root, log; - var runner; - - function createSpec(name, body) { - return { - name: name, - before: angular.noop, - body: body || angular.noop, - after: angular.noop - }; - } - - beforeEach(inject(function($rootScope) { - log = []; - $window = {}; - $window.setTimeout = function(fn, timeout) { - fn(); - }; - $root = $rootScope; - $root.emit = function(eventName) { - log.push(eventName); - }; - $root.on = function(eventName) { - log.push('Listener Added for ' + eventName); - }; - $root.application = new ApplicationMock($window); - $root.$window = $window; - runner = $root.$new(); - - var Cls = angular.scenario.SpecRunner; - for (var name in Cls.prototype) { - runner[name] = angular.bind(runner, Cls.prototype[name]); - } - - Cls.call(runner); - })); - - it('should bind futures to the spec', function() { - runner.addFuture('test future', function(done) { - this.value = 10; - done(); - }); - runner.futures[0].execute(angular.noop); - expect(runner.value).toEqual(10); - }); - - it('should pass done to future action behavior', function() { - runner.addFutureAction('test future', function($window, $document, done) { - expect(angular.isFunction(done)).toBeTruthy(); - done(10, 20); - }); - runner.futures[0].execute(function(error, result) { - expect(error).toEqual(10); - expect(result).toEqual(20); - }); - }); - - it('should execute spec function and notify UI', function() { - var finished; - var spec = createSpec('test spec', function() { - this.test = 'some value'; - }); - runner.addFuture('test future', function(done) { - done(); - }); - runner.run(spec, function() { - finished = true; - }); - expect(runner.test).toEqual('some value'); - expect(finished).toBeTruthy(); - expect(log).toEqual([ - 'SpecBegin', - 'StepBegin', - 'StepEnd', - 'SpecEnd' - ]); - }); - - it('should execute notify UI on spec setup error', function() { - var finished; - var spec = createSpec('test spec', function() { - throw new Error('message'); - }); - runner.run(spec, function() { - finished = true; - }); - expect(finished).toBeTruthy(); - expect(log).toEqual([ - 'SpecBegin', - 'SpecError', - 'SpecEnd' - ]); - }); - - it('should execute notify UI on step failure', function() { - var finished; - var spec = createSpec('test spec'); - runner.addFuture('test future', function(done) { - done('failure message'); - }); - runner.run(spec, function() { - finished = true; - }); - expect(finished).toBeTruthy(); - expect(log).toEqual([ - 'SpecBegin', - 'StepBegin', - 'StepFailure', - 'StepEnd', - 'SpecEnd' - ]); - }); - - it('should execute notify UI on step error', function() { - var finished; - var spec = createSpec('test spec', function() { - this.addFuture('test future', function(done) { - throw new Error('error message'); - }); - }); - runner.run(spec, function() { - finished = true; - }); - expect(finished).toBeTruthy(); - expect(log).toEqual([ - 'SpecBegin', - 'StepBegin', - 'StepError', - 'StepEnd', - 'SpecEnd' - ]); - }); - - it('should run after handlers even if error in body of spec', function() { - var finished, after; - var spec = createSpec('test spec', function() { - this.addFuture('body', function(done) { - throw new Error('error message'); - }); - }); - spec.after = function() { - this.addFuture('after', function(done) { - after = true; - done(); - }); - }; - runner.run(spec, function() { - finished = true; - }); - expect(finished).toBeTruthy(); - expect(after).toBeTruthy(); - expect(log).toEqual([ - 'SpecBegin', - 'StepBegin', - 'StepError', - 'StepEnd', - 'StepBegin', - 'StepEnd', - 'SpecEnd' - ]); - }); -}); diff --git a/test/ngScenario/dslSpec.js b/test/ngScenario/dslSpec.js deleted file mode 100644 index 6eb5da68db0c..000000000000 --- a/test/ngScenario/dslSpec.js +++ /dev/null @@ -1,789 +0,0 @@ -'use strict'; - -describe('angular.scenario.dsl', function() { - var element; - var $window, $root; - var eventLog; - - afterEach(function() { - dealoc(element); - }); - - beforeEach(module('ngSanitize')); - - beforeEach(inject(function($injector) { - eventLog = []; - $window = { - document: window.document.body, - angular: new angular.scenario.testing.MockAngular() - }; - jqLite($window.document).data('$injector', $injector).attr('ng-app', '').addClass('html'); - $root = $injector.get('$rootScope'); - $root.emit = function(eventName) { - eventLog.push(eventName); - }; - $root.on = function(eventName) { - eventLog.push('Listener Added for ' + eventName); - }; - $root.futures = []; - $root.futureLog = []; - $root.$window = $window; - $root.addFuture = function(name, fn) { - this.futures.push(name); - fn.call(this, function(error, result) { - $root.futureError = error; - $root.futureResult = result; - $root.futureLog.push(name); - }); - }; - $root.dsl = {}; - angular.forEach(angular.scenario.dsl, function(fn, name) { - $root.dsl[name] = function() { - return fn.call($root).apply($root, arguments); - }; - }); - $root.application = new angular.scenario.Application(jqLite($window.document)); - $root.application.getWindow_ = function() { - return $window; - }; - $root.application.navigateTo = function(url, callback) { - $window.location = url; - callback(); - }; - // Just use the real one since it delegates to this.addFuture - $root.addFutureAction = angular.scenario. - SpecRunner.prototype.addFutureAction; - jqLite($window.document).empty(); - })); - - afterEach(function() { - jqLite($window.document).removeData('$injector'); - }); - - describe('Pause', function() { - it('should pause until resume to complete', function() { - expect($window.resume).toBeUndefined(); - $root.dsl.pause(); - expect(angular.isFunction($window.resume)).toBeTruthy(); - expect($root.futureLog).toEqual([]); - $window.resume(); - expect($root.futureLog). - toEqual(['pausing for you to resume']); - expect(eventLog).toContain('InteractivePause'); - }); - }); - - describe('Sleep', function() { - beforeEach(function() { - $root.$window.setTimeout = function(fn, value) { - $root.timerValue = value; - fn(); - }; - }); - - it('should sleep for specified seconds', function() { - $root.dsl.sleep(10); - expect($root.timerValue).toEqual(10000); - expect($root.futureResult).toEqual(10000); - }); - }); - - describe('Expect', function() { - it('should chain and execute matcher', function() { - var future = {value: 10}; - var result = $root.dsl.expect(future); - result.toEqual(10); - expect($root.futureError).toBeUndefined(); - expect($root.futureResult).toBeUndefined(); - result = $root.dsl.expect(future); - result.toEqual(20); - expect($root.futureError).toBeDefined(); - }); - }); - - describe('Browser', function() { - describe('Reload', function() { - it('should navigateTo', function() { - $window.location = { - href: '#foo' - }; - $root.dsl.browser().reload(); - expect($root.futureResult).toEqual('#foo'); - expect($window.location).toEqual('#foo'); - }); - }); - - describe('NavigateTo', function() { - it('should allow a string url', function() { - $root.dsl.browser().navigateTo('http://myurl'); - expect($window.location).toEqual('http://myurl'); - expect($root.futureResult).toEqual('http://myurl'); - }); - - it('should allow a future url', function() { - $root.dsl.browser().navigateTo('http://myurl', function() { - return 'http://futureUrl/'; - }); - expect($window.location).toEqual('http://futureUrl/'); - expect($root.futureResult).toEqual('http://futureUrl/'); - }); - - it('should complete if AngularJS is missing from app frame', function() { - delete $window.angular; - $root.dsl.browser().navigateTo('http://myurl'); - expect($window.location).toEqual('http://myurl'); - expect($root.futureResult).toEqual('http://myurl'); - }); - }); - - describe('window', function() { - beforeEach(function() { - $window.location = { - href: 'http://myurl/some/path?foo=10#/bar?x=2', - pathname: '/some/path', - search: '?foo=10', - hash: '#bar?x=2' - }; - }); - - it('should return full URL for href', function() { - $root.dsl.browser().window().href(); - expect($root.futureResult).toEqual($window.location.href); - }); - - it('should return the pathname', function() { - $root.dsl.browser().window().path(); - expect($root.futureResult).toEqual($window.location.pathname); - }); - - it('should return the search part', function() { - $root.dsl.browser().window().search(); - expect($root.futureResult).toEqual($window.location.search); - }); - - it('should return the hash without the #', function() { - $root.dsl.browser().window().hash(); - expect($root.futureResult).toEqual('bar?x=2'); - }); - }); - - describe('location', function() { - beforeEach(inject(function($injector) { - angular.extend($injector.get('$location'), { - url: function() {return '/path?search=a#hhh';}, - path: function() {return '/path';}, - search: function() {return {search: 'a'};}, - hash: function() {return 'hhh';} - }); - })); - - it('should return full url', function() { - $root.dsl.browser().location().url(); - expect($root.futureResult).toEqual('/path?search=a#hhh'); - }); - - it('should return the pathname', function() { - $root.dsl.browser().location().path(); - expect($root.futureResult).toEqual('/path'); - }); - - it('should return the query string as an object', function() { - $root.dsl.browser().location().search(); - expect($root.futureResult).toEqual({search: 'a'}); - }); - - it('should return the hash without the #', function() { - $root.dsl.browser().location().hash(); - expect($root.futureResult).toEqual('hhh'); - }); - }); - }); - - describe('Element Finding', function() { - var doc; - beforeEach(inject(function($injector) { - doc = _jQuery($window.document).append('
        ').find('.body'); - })); - - describe('Select', function() { - it('should select single option', function() { - doc.append( - '' - ); - $root.dsl.select('test').option('A'); - expect(doc.find('[ng-model="test"]').val()).toEqual('A'); - }); - - it('should select single option using data-ng', function() { - doc.append( - '' - ); - $root.dsl.select('test').option('A'); - expect(doc.find('[data-ng-model="test"]').val()).toEqual('A'); - }); - - it('should select single option using x-ng', function() { - doc.append( - '' - ); - $root.dsl.select('test').option('A'); - expect(doc.find('[x-ng-model="test"]').val()).toEqual('A'); - }); - - it('should select option by exact name', function() { - doc.append( - '' - ); - $root.dsl.select('test').option('one'); - expect(doc.find('[ng-model="test"]').val()).toEqual('D'); - }); - - it('should select option by name if no exact match and name contains value', function() { - doc.append( - '' - ); - $root.dsl.select('test').option('one'); - expect(doc.find('[ng-model="test"]').val()).toEqual('A'); - }); - - it('should select multiple options', function() { - doc.append( - '' - ); - $root.dsl.select('test').options('A', 'B'); - expect(doc.find('[ng-model="test"]').val()).toEqual(['A','B']); - }); - - it('should fail to select multiple options on non-multiple select', function() { - doc.append(''); - $root.dsl.select('test').options('A', 'B'); - expect($root.futureError).toMatch(/did not match/); - }); - - it('should fail to select an option that does not exist', function() { - doc.append( - '' - ); - $root.dsl.select('test').option('three'); - expect($root.futureError).toMatch(/not found/); - }); - }); - - describe('Element', function() { - it('should execute click', function() { - var clicked; - // Hash is important, otherwise we actually - // go to a different page and break the runner - doc.append(''); - doc.find('a').click(function() { - clicked = true; - }); - $root.dsl.element('a').click(); - }); - - it('should navigate page if click on anchor', function() { - expect($window.location).not.toEqual('#foo'); - doc.append(''); - $root.dsl.element('a').click(); - expect($window.location).toMatch(/#foo$/); - }); - - it('should not navigate if click event was cancelled', function() { - var initLocation = $window.location, - elm = jqLite(''); - - doc.append(elm); - elm.on('click', function(event) { - event.preventDefault(); - }); - - $root.dsl.element('a').click(); - expect($window.location).toBe(initLocation); - dealoc(elm); - }); - - it('should execute dblclick', function() { - var clicked; - // Hash is important, otherwise we actually - // go to a different page and break the runner - doc.append(''); - doc.find('a').dblclick(function() { - clicked = true; - }); - $root.dsl.element('a').dblclick(); - }); - - it('should navigate page if dblclick on anchor', function() { - expect($window.location).not.toEqual('#foo'); - doc.append(''); - $root.dsl.element('a').dblclick(); - expect($window.location).toMatch(/#foo$/); - }); - - it('should not navigate if dblclick event was cancelled', function() { - var initLocation = $window.location, - elm = jqLite(''); - - doc.append(elm); - elm.on('dblclick', function(event) { - event.preventDefault(); - }); - - $root.dsl.element('a').dblclick(); - expect($window.location).toBe(initLocation); - dealoc(elm); - }); - - it('should execute mouseover', function() { - var mousedOver; - doc.append('
        '); - doc.find('div').mouseover(function() { - mousedOver = true; - }); - $root.dsl.element('div').mouseover(); - expect(mousedOver).toBe(true); - }); - - it('should bubble up the mouseover event', function() { - var mousedOver; - doc.append('
        '); - doc.find('#outer').mouseover(function() { - mousedOver = true; - }); - $root.dsl.element('#inner').mouseover(); - expect(mousedOver).toBe(true); - }); - - it('should execute mousedown', function() { - var mousedDown; - doc.append('
        '); - doc.find('div').mousedown(function() { - mousedDown = true; - }); - $root.dsl.element('div').mousedown(); - expect(mousedDown).toBe(true); - }); - - it('should bubble up the mousedown event', function() { - var mousedDown; - doc.append('
        '); - doc.find('#outer').mousedown(function() { - mousedDown = true; - }); - $root.dsl.element('#inner').mousedown(); - expect(mousedDown).toBe(true); - }); - - it('should execute mouseup', function() { - var mousedUp; - doc.append('
        '); - doc.find('div').mouseup(function() { - mousedUp = true; - }); - $root.dsl.element('div').mouseup(); - expect(mousedUp).toBe(true); - }); - - it('should bubble up the mouseup event', function() { - var mousedUp; - doc.append('
        '); - doc.find('#outer').mouseup(function() { - mousedUp = true; - }); - $root.dsl.element('#inner').mouseup(); - expect(mousedUp).toBe(true); - }); - - it('should count matching elements', function() { - doc.append(''); - $root.dsl.element('span').count(); - expect($root.futureResult).toEqual(2); - }); - - it('should return count of 0 if no matching elements', function() { - $root.dsl.element('span').count(); - expect($root.futureResult).toEqual(0); - }); - - it('should get attribute', function() { - doc.append('
        '); - $root.dsl.element('#test').attr('class'); - expect($root.futureResult).toEqual('foo'); - }); - - it('should set attribute', function() { - doc.append('
        '); - $root.dsl.element('#test').attr('class', 'bam'); - expect(doc.find('#test').attr('class')).toEqual('bam'); - }); - - it('should get property', function() { - doc.append('
        '); - $root.dsl.element('#test').prop('className'); - expect($root.futureResult).toEqual('foo'); - }); - - it('should set property', function() { - doc.append('
        '); - $root.dsl.element('#test').prop('className', 'bam'); - expect(doc.find('#test').prop('className')).toEqual('bam'); - }); - - it('should get css', function() { - doc.append('
        '); - $root.dsl.element('#test').css('height'); - expect($root.futureResult).toMatch(/30px/); - }); - - it('should set css', function() { - doc.append('
        '); - $root.dsl.element('#test').css('height', '20px'); - expect(doc.find('#test').css('height')).toEqual('20px'); - }); - - it('should add all jQuery key/value methods', function() { - var METHODS = ['css', 'attr']; - var chain = $root.dsl.element('input'); - angular.forEach(METHODS, function(name) { - expect(angular.isFunction(chain[name])).toBeTruthy(); - }); - }); - - it('should get val', function() { - doc.append(''); - $root.dsl.element('input').val(); - expect($root.futureResult).toEqual('bar'); - }); - - it('should set val', function() { - doc.append(''); - $root.dsl.element('input').val('baz'); - expect(doc.find('input').val()).toEqual('baz'); - }); - - it('should use correct future name for generated set methods', function() { - doc.append(''); - $root.dsl.element('input').val(false); - expect($root.futures.pop()).toMatch(/element 'input' set val/); - }); - - it('should use correct future name for generated get methods', function() { - doc.append(''); - $root.dsl.element('input').val(); - expect($root.futures.pop()).toMatch(/element 'input' val/); - }); - - it('should add all jQuery property methods', function() { - var METHODS = [ - 'val', 'text', 'html', 'height', 'innerHeight', 'outerHeight', 'width', - 'innerWidth', 'outerWidth', 'position', 'scrollLeft', 'scrollTop', 'offset' - ]; - var chain = $root.dsl.element('input'); - angular.forEach(METHODS, function(name) { - expect(angular.isFunction(chain[name])).toBeTruthy(); - }); - }); - - it('should execute custom query', function() { - doc.append(''); - $root.dsl.element('#test').query(function(elements, done) { - done(null, elements.attr('href')); - }); - expect($root.futureResult).toEqual('http://example.com/myUrl'); - }); - - it('should use the selector as label if none is given', function() { - $root.dsl.element('mySelector'); - expect($root.label).toEqual('mySelector'); - }); - - it('should include the selector in paren when a label is given', function() { - $root.dsl.element('mySelector', 'myLabel'); - expect($root.label).toEqual('myLabel ( mySelector )'); - }); - }); - - describe('Repeater', function() { - var chain; - beforeEach(inject(function($compile, $rootScope) { - element = $compile( - '
        • {{i.name}} {{i.gender}}
        ')($rootScope); - $rootScope.items = [{name:'misko', gender:'male'}, {name:'felisa', gender:'female'}]; - $rootScope.$apply(); - doc.append(element); - chain = $root.dsl.repeater('ul li'); - })); - - it('should get the row count', function() { - chain.count(); - expect($root.futureResult).toEqual(2); - }); - - it('should return 0 if repeater doesnt match', inject(function($rootScope) { - $rootScope.items = []; - $rootScope.$apply(); - chain.count(); - expect($root.futureResult).toEqual(0); - })); - - it('should get a row of bindings', function() { - chain.row(1); - expect($root.futureResult).toEqual(['felisa', 'female']); - }); - - it('should get a column of bindings', function() { - chain.column('i.gender'); - expect($root.futureResult).toEqual(['male', 'female']); - }); - - it('should use the selector as label if none is given', function() { - expect($root.label).toEqual('ul li'); - }); - - it('should include the selector in paren when a label is given', function() { - $root.dsl.repeater('mySelector', 'myLabel'); - expect($root.label).toEqual('myLabel ( ul li mySelector )'); - }); - }); - - describe('Binding', function() { - var compile; - - beforeEach(inject(function($compile, $rootScope) { - compile = function(html, value) { - element = $compile(html)($rootScope); - doc.append(element); - $rootScope.foo = {bar: value || 'some value'}; - $rootScope.$apply(); - }; - })); - - - it('should select binding in interpolation', function() { - compile('{{ foo.bar }}'); - $root.dsl.binding('foo.bar'); - expect($root.futureResult).toEqual('some value'); - }); - - it('should select binding in multiple interpolations', function() { - compile('{{ foo.bar }}
        {{ true }}
        '); - $root.dsl.binding('foo.bar'); - expect($root.futureResult).toEqual('some value'); - - $root.dsl.binding('true'); - expect($root.futureResult).toEqual('true'); - }); - - it('should select binding by name', function() { - compile(''); - $root.dsl.binding('foo.bar'); - expect($root.futureResult).toEqual('some value'); - }); - - it('should select binding by regexp', function() { - compile('some value'); - $root.dsl.binding(/^foo\..+/); - expect($root.futureResult).toEqual('some value'); - }); - - it('should return innerHTML for all the other elements', function() { - compile('
        ', 'some value'); - $root.dsl.binding('foo.bar'); - expect($root.futureResult.toLowerCase()).toEqual('some value'); - }); - - it('should select binding in template by name', function() { - compile('
        ', 'bar');
        -        $root.dsl.binding('foo.bar');
        -        expect($root.futureResult).toEqual('bar');
        -      });
        -
        -      it('should match bindings by substring match', function() {
        -        compile('
        ', 'binding value');
        -        $root.dsl.binding('foo . bar');
        -        expect($root.futureResult).toEqual('binding value');
        -      });
        -
        -      it('should return error if no bindings in document', function() {
        -        $root.dsl.binding('foo.bar');
        -        expect($root.futureError).toMatch(/did not match/);
        -      });
        -
        -      it('should return error if no binding matches', function() {
        -        compile('some value');
        -        $root.dsl.binding('foo.bar');
        -        expect($root.futureError).toMatch(/did not match/);
        -      });
        -    });
        -
        -    describe('Using', function() {
        -      it('should prefix selector in $document.elements()', function() {
        -        var chain;
        -        doc.append(
        -          '
        ' + - '
        ' - ); - chain = $root.dsl.using('div#test2'); - chain.input('test.input').enter('foo'); - var inputs = _jQuery('input[ng-model="test.input"]'); - expect(inputs.first().val()).toEqual('something'); - expect(inputs.last().val()).toEqual('foo'); - }); - - it('should use the selector as label if none is given', function() { - $root.dsl.using('mySelector'); - expect($root.label).toEqual('mySelector'); - }); - - it('should include the selector in paren when a label is given', function() { - $root.dsl.using('mySelector', 'myLabel'); - expect($root.label).toEqual('myLabel ( mySelector )'); - }); - - }); - - describe('Input', function() { - it('should change value in text input', function(done) { - inject(function($compile) { - var job = createAsync(done); - job - .runs(function() { - element = $compile('')($root); - doc.append(element); - var chain = $root.dsl.input('test.input'); - chain.enter('foo'); - expect(_jQuery('input[ng-model="test.input"]').val()).toEqual('foo'); - }) - // cleanup the event queue - .waits(0) - .runs(function() { - expect($root.test.input).toBe('foo'); - }) - .done(); - job.start(); - }); - }); - - it('should change value in text input in dash form', function() { - doc.append(''); - var chain = $root.dsl.input('test.input'); - chain.enter('foo'); - expect(_jQuery('input[ng-model="test.input"]').val()).toEqual('foo'); - }); - it('should change value in text input in data-ng form', function() { - doc.append(''); - var chain = $root.dsl.input('test.input'); - chain.enter('foo'); - expect(_jQuery('input[data-ng-model="test.input"]').val()).toEqual('foo'); - }); - it('should change value in text input in x-ng form', function() { - doc.append(''); - var chain = $root.dsl.input('test.input'); - chain.enter('foo'); - expect(_jQuery('input[x-ng-model="test.input"]').val()).toEqual('foo'); - }); - - - - it('should return error if no input exists', function() { - var chain = $root.dsl.input('test.input'); - chain.enter('foo'); - expect($root.futureError).toMatch(/did not match/); - }); - - it('should toggle checkbox state', function() { - doc.append(''); - expect(_jQuery('input[ng-model="test.input"]'). - prop('checked')).toBe(true); - var chain = $root.dsl.input('test.input'); - chain.check(); - expect(_jQuery('input[ng-model="test.input"]'). - prop('checked')).toBe(false); - $window.angular.reset(); - chain.check(); - expect(_jQuery('input[ng-model="test.input"]'). - prop('checked')).toBe(true); - }); - - it('should return error if checkbox did not match', function() { - var chain = $root.dsl.input('test.input'); - chain.check(); - expect($root.futureError).toMatch(/did not match/); - }); - - it('should select option from radio group', function() { - doc.append( - '' + - '' - ); - // HACK! We don't know why this is sometimes false on chrome - _jQuery('input[ng\\:model="test.input"][value="bar"]').prop('checked', true); - expect(_jQuery('input[ng\\:model="test.input"][value="bar"]'). - prop('checked')).toBe(true); - expect(_jQuery('input[ng\\:model="test.input"][value="foo"]'). - prop('checked')).toBe(false); - var chain = $root.dsl.input('test.input'); - chain.select('foo'); - expect(_jQuery('input[ng\\:model="test.input"][value="bar"]'). - prop('checked')).toBe(false); - expect(_jQuery('input[ng\\:model="test.input"][value="foo"]'). - prop('checked')).toBe(true); - }); - - it('should return error if radio button did not match', function() { - var chain = $root.dsl.input('test.input'); - chain.select('foo'); - expect($root.futureError).toMatch(/did not match/); - }); - - describe('val', function() { - it('should return value in text input', function() { - doc.append(''); - $root.dsl.input('test.input').val(); - expect($root.futureResult).toEqual('something'); - }); - }); - }); - - describe('Textarea', function() { - - it('should change value in textarea', function() { - doc.append(''); - var chain = $root.dsl.input('test.textarea'); - chain.enter('foo'); - expect(_jQuery('textarea[ng-model="test.textarea"]').val()).toEqual('foo'); - }); - - it('should return error if no textarea exists', function() { - var chain = $root.dsl.input('test.textarea'); - chain.enter('foo'); - expect($root.futureError).toMatch(/did not match/); - }); - }); - }); -}); diff --git a/test/ngScenario/e2e/.eslintrc.json b/test/ngScenario/e2e/.eslintrc.json deleted file mode 100644 index 8df3459845a9..000000000000 --- a/test/ngScenario/e2e/.eslintrc.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "root": true, - "extends": "../../../.eslintrc-node.json", - - "env": { - "jasmine": true, - "protractor": true - } -} diff --git a/test/ngScenario/e2e/Runner-compiled.html b/test/ngScenario/e2e/Runner-compiled.html deleted file mode 100644 index 530fef96233a..000000000000 --- a/test/ngScenario/e2e/Runner-compiled.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/test/ngScenario/e2e/Runner.html b/test/ngScenario/e2e/Runner.html deleted file mode 100644 index f5d03ca5e4bc..000000000000 --- a/test/ngScenario/e2e/Runner.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/test/ngScenario/e2e/style.css b/test/ngScenario/e2e/style.css deleted file mode 100644 index 26540becebb7..000000000000 --- a/test/ngScenario/e2e/style.css +++ /dev/null @@ -1,11 +0,0 @@ -th { - text-align: left; -} - -tr { - border: 1px solid black; -} - -.redbox { - background-color: red; -} diff --git a/test/ngScenario/e2e/widgets-scenario.js b/test/ngScenario/e2e/widgets-scenario.js deleted file mode 100644 index 40b176d1b30a..000000000000 --- a/test/ngScenario/e2e/widgets-scenario.js +++ /dev/null @@ -1,69 +0,0 @@ -/* global using: false, binding: false, input: false, select: false, repeater: false */ -'use strict'; - -describe('widgets', function() { - it('should verify that basic widgets work', function() { - browser().navigateTo('widgets.html'); - - using('#text-basic-box').input('text.basic').enter('Carlos'); - expect(binding('text.basic')).toEqual('Carlos'); - input('text.basic').enter('Carlos Santana'); - expect(binding('text.basic')).not().toEqual('Carlos Boozer'); - - input('text.password').enter('secret'); - expect(binding('text.password')).toEqual('secret'); - - expect(binding('text.hidden')).toEqual('hiddenValue'); - - expect(binding('gender')).toEqual('male'); - input('gender').select('female'); - expect(using('#gender-box').binding('gender')).toEqual('female'); - - expect(repeater('#repeater-row ul li').count()).toEqual(2); - expect(repeater('#repeater-row ul li').row(1)).toEqual(['adam']); - expect(repeater('#repeater-row ul li').column('name')).toEqual(['misko', 'adam']); - - select('select').option('B'); - expect(binding('select')).toEqual('B'); - - select('multiselect').options('A', 'C'); - expect(binding('multiselect').fromJson()).toEqual(['A', 'C']); - - expect(binding('button').fromJson()).toEqual({'count': 0}); - expect(binding('form').fromJson()).toEqual({'count': 0}); - - element('form a', '\'action\' link').click(); - expect(binding('button').fromJson()).toEqual({'count': 1}); - - element('input[value="submit input"]', '\'submit input\' button').click(); - expect(binding('button').fromJson()).toEqual({'count': 2}); - expect(binding('form').fromJson()).toEqual({'count': 1}); - - element('button:contains("submit button")', '\'submit button\' button').click(); - expect(binding('button').fromJson()).toEqual({'count': 2}); - expect(binding('form').fromJson()).toEqual({'count': 2}); - - element('input[value="button"]', '\'button\' button').click(); - expect(binding('button').fromJson()).toEqual({'count': 3}); - - element('input[type="image"]', 'form image').click(); - expect(binding('button').fromJson()).toEqual({'count': 4}); - - /** - * Custom value parser for futures. - */ - function checkboxParser(value) { - // eslint-disable-next-line no-undef - return angular.fromJson(value.substring(value.indexOf('=') + 1)); - } - - input('checkbox.tea').check(); - expect(binding('checkbox').parsedWith(checkboxParser)).toEqual({coffee: false, tea: false}); - input('checkbox.coffee').check(); - expect(binding('checkbox').parsedWith(checkboxParser)).toEqual({coffee: true, tea: false}); - input('checkbox.tea').check(); - input('checkbox.tea').check(); - input('checkbox.tea').check(); - expect(binding('checkbox').parsedWith(checkboxParser)).toEqual({coffee: true, tea: true}); - }); -}); diff --git a/test/ngScenario/e2e/widgets.html b/test/ngScenario/e2e/widgets.html deleted file mode 100644 index 5fdae881cf68..000000000000 --- a/test/ngScenario/e2e/widgets.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        DescriptionTestResult
        Input text field
        basic - - text.basic={{text.basic}}
        passwordtext.password={{text.password}}
        hiddentext.hidden={{text.hidden}}
        Input selection field
        radio - Female
        - Male -
        gender={{gender}}
        checkbox - Tea
        - Coffee -
        -
        checkbox={{checkbox}}
        -
        select - - select={{select}}
        multiselect - - multiselect={{multiselect}}
        Buttons
        ng-change
        ng-click
        -
        -
        -
        - -
        - action -
        -
        button={{button}} form={{form}}
        Repeaters
        ng-repeat -
          -
        • {{name}}
        • -
        -
        - - diff --git a/test/ngScenario/matchersSpec.js b/test/ngScenario/matchersSpec.js deleted file mode 100644 index 7b68d2b9b731..000000000000 --- a/test/ngScenario/matchersSpec.js +++ /dev/null @@ -1,51 +0,0 @@ -'use strict'; - -describe('angular.scenario.matchers', function() { - var matchers; - - function expectMatcher(value, test) { - delete matchers.error; - delete matchers.future.value; - if (isDefined(value)) { - matchers.future.value = value; - } - test(); - expect(matchers.error).toBeUndefined(); - } - - beforeEach(function() { - /** - * Mock up the future system wrapped around matchers. - * - * @see Scenario.js#angular.scenario.matcher - */ - matchers = { - future: { name: 'test' } - }; - matchers.addFuture = function(name, callback) { - callback(function(error) { - matchers.error = error; - }); - }; - angular.extend(matchers, angular.scenario.matcher); - }); - - it('should handle basic matching', function() { - expectMatcher(10, function() { matchers.toEqual(10); }); - expectMatcher('value', function() { matchers.toBeDefined(); }); - expectMatcher([1], function() { matchers.toBeTruthy(); }); - expectMatcher('', function() { matchers.toBeFalsy(); }); - expectMatcher(0, function() { matchers.toBeFalsy(); }); - expectMatcher('foo', function() { matchers.toMatch('.o.'); }); - expectMatcher(null, function() { matchers.toBeNull(); }); - expectMatcher([1, 2, 3], function() { matchers.toContain(2); }); - expectMatcher(3, function() { matchers.toBeLessThan(10); }); - expectMatcher(3, function() { matchers.toBeGreaterThan(-5); }); - }); - - it('should have toHaveClass matcher', function() { - var e = angular.element('
        '); - expect(e).not.toHaveClass('none'); - expect(e).toHaveClass('abc'); - }); -}); diff --git a/test/ngScenario/mocks.js b/test/ngScenario/mocks.js deleted file mode 100644 index 849d78d9bba9..000000000000 --- a/test/ngScenario/mocks.js +++ /dev/null @@ -1,33 +0,0 @@ -'use strict'; - -angular.scenario.testing = angular.scenario.testing || {}; - -angular.scenario.testing.MockAngular = function() { - this.reset(); - this.element = jqLite; -}; - -angular.scenario.testing.MockAngular.prototype.reset = function() { - this.log = []; -}; - -angular.scenario.testing.MockAngular.prototype.poll = function() { - this.log.push('$browser.poll()'); - return this; -}; - -angular.scenario.testing.MockRunner = function() { - this.listeners = []; -}; - -angular.scenario.testing.MockRunner.prototype.on = function(eventName, fn) { - this.listeners[eventName] = this.listeners[eventName] || []; - this.listeners[eventName].push(fn); -}; - -angular.scenario.testing.MockRunner.prototype.emit = function(eventName) { - var args = Array.prototype.slice.call(arguments, 1); - angular.forEach(this.listeners[eventName] || [], function(fn) { - fn.apply(this, args); - }); -}; diff --git a/test/ngScenario/output/HtmlSpec.js b/test/ngScenario/output/HtmlSpec.js deleted file mode 100644 index 541d4d4afadf..000000000000 --- a/test/ngScenario/output/HtmlSpec.js +++ /dev/null @@ -1,127 +0,0 @@ -'use strict'; - -describe('angular.scenario.output.html', function() { - var runner, model, spec, step, listeners, ui, context; - - beforeEach(function() { - listeners = []; - spec = { - name: 'test spec', - definition: { - id: 10, - name: 'child', - children: [], - parent: { - id: 20, - name: 'parent', - children: [] - } - } - }; - step = { - name: 'some step', - line: function() { return 'unknown:-1'; } - }; - runner = new angular.scenario.testing.MockRunner(); - model = new angular.scenario.ObjectModel(runner); - context = _jQuery('
        '); - ui = angular.scenario.output.html(context, runner, model); - }); - - it('should create nested describe context', function() { - runner.emit('SpecBegin', spec); - expect(context.find('#describe-20 #describe-10 > h2').text()). - toEqual('describe: child'); - expect(context.find('#describe-20 > h2').text()).toEqual('describe: parent'); - expect(context.find('#describe-10 .tests > li .test-info .test-name').text()). - toEqual('test spec'); - expect(context.find('#describe-10 .tests > li').hasClass('status-pending')). - toBeTruthy(); - }); - - it('should add link on InteractivePause', function() { - runner.emit('SpecBegin', spec); - runner.emit('StepBegin', spec, step); - runner.emit('StepEnd', spec, step); - runner.emit('StepBegin', spec, step); - runner.emit('InteractivePause', spec, step); - expect(context.find('.test-actions .test-title:first').text()).toEqual('some step'); - expect(lowercase(context.find('.test-actions .test-title:last').html())).toEqual( - 'paused... resume when ready.' - ); - }); - - it('should update totals when steps complete', function() { - // Failure - for (var i = 0; i < 3; ++i) { - runner.emit('SpecBegin', spec); - runner.emit('StepBegin', spec, step); - runner.emit('StepFailure', spec, step, 'error'); - runner.emit('StepEnd', spec, step); - runner.emit('SpecEnd', spec); - } - - // Error - runner.emit('SpecBegin', spec); - runner.emit('SpecError', spec, 'error'); - runner.emit('SpecEnd', spec); - - // Error - runner.emit('SpecBegin', spec); - runner.emit('StepBegin', spec, step); - runner.emit('StepError', spec, step, 'error'); - runner.emit('StepEnd', spec, step); - runner.emit('SpecEnd', spec); - - // Success - runner.emit('SpecBegin', spec); - runner.emit('StepBegin', spec, step); - runner.emit('StepEnd', spec, step); - runner.emit('SpecEnd', spec); - - expect(parseInt(context.find('#status-legend .status-failure').text(), 10)). - toEqual(3); - expect(parseInt(context.find('#status-legend .status-error').text(), 10)). - toEqual(2); - expect(parseInt(context.find('#status-legend .status-success').text(), 10)). - toEqual(1); - }); - - it('should update timer when test completes', function() { - // Success - runner.emit('SpecBegin', spec); - runner.emit('StepBegin', spec, step); - runner.emit('StepEnd', spec, step); - runner.emit('SpecEnd', spec); - - // Failure - runner.emit('SpecBegin', spec); - runner.emit('StepBegin', spec, step); - runner.emit('StepFailure', spec, step, 'error'); - runner.emit('StepEnd', spec, step); - runner.emit('SpecEnd', spec); - - // Error - runner.emit('SpecBegin', spec); - runner.emit('SpecError', spec, 'error'); - runner.emit('SpecEnd', spec); - - context.find('#describe-10 .tests > li .test-info .timer-result'). - each(function(index, timer) { - expect(timer.innerHTML).toMatch(/ms$/); - } - ); - }); - - it('should include line if provided', function() { - runner.emit('SpecBegin', spec); - runner.emit('StepBegin', spec, step); - runner.emit('StepFailure', spec, step, 'error'); - runner.emit('StepEnd', spec, step); - runner.emit('SpecEnd', spec); - - var errorHtml = context.find('#describe-10 .tests li pre').html(); - expect(errorHtml.indexOf('unknown:-1')).toEqual(0); - }); - -}); diff --git a/test/ngScenario/output/jsonSpec.js b/test/ngScenario/output/jsonSpec.js deleted file mode 100644 index 06caf91cae99..000000000000 --- a/test/ngScenario/output/jsonSpec.js +++ /dev/null @@ -1,37 +0,0 @@ -'use strict'; - -describe('angular.scenario.output.json', function() { - var output, context; - var runner, model, $window; - var spec, step; - - beforeEach(function() { - $window = {}; - context = _jQuery('
        '); - runner = new angular.scenario.testing.MockRunner(); - model = new angular.scenario.ObjectModel(runner); - output = angular.scenario.output.json(context, runner, model); - spec = { - name: 'test spec', - definition: { - id: 10, - name: 'describe' - } - }; - step = { - name: 'some step', - line: function() { return 'unknown:-1'; } - }; - }); - - it('should put json in context on RunnerEnd', function() { - runner.emit('SpecBegin', spec); - runner.emit('StepBegin', spec, step); - runner.emit('StepEnd', spec, step); - runner.emit('SpecEnd', spec); - runner.emit('RunnerEnd'); - - expect(angular.fromJson(context.html()).children['describe'] - .specs['test spec'].status).toEqual('success'); - }); -}); diff --git a/test/ngScenario/output/objectSpec.js b/test/ngScenario/output/objectSpec.js deleted file mode 100644 index d92c939d4be2..000000000000 --- a/test/ngScenario/output/objectSpec.js +++ /dev/null @@ -1,40 +0,0 @@ -'use strict'; - -describe('angular.scenario.output.object', function() { - var output; - var runner, model, $window; - var spec, step; - - beforeEach(function() { - $window = {}; - runner = new angular.scenario.testing.MockRunner(); - model = new angular.scenario.ObjectModel(runner); - runner.$window = $window; - output = angular.scenario.output.object(null, runner, model); - spec = { - name: 'test spec', - definition: { - id: 10, - name: 'describe', - children: [] - } - }; - step = { - name: 'some step', - line: function() { return 'unknown:-1'; } - }; - }); - - it('should create a global variable $result', function() { - expect($window.$result).toBeDefined(); - }); - - it('should maintain live state in $result', function() { - runner.emit('SpecBegin', spec); - runner.emit('StepBegin', spec, step); - runner.emit('StepEnd', spec, step); - - expect($window.$result.children['describe'] - .specs['test spec'].steps[0].duration).toBeDefined(); - }); -}); diff --git a/test/ngScenario/output/xmlSpec.js b/test/ngScenario/output/xmlSpec.js deleted file mode 100644 index 32646417cb1d..000000000000 --- a/test/ngScenario/output/xmlSpec.js +++ /dev/null @@ -1,49 +0,0 @@ -'use strict'; - -describe('angular.scenario.output.xml', function() { - var output, context; - var runner, model, $window; - var spec, step; - - beforeEach(function() { - $window = {}; - context = _jQuery('
        '); - runner = new angular.scenario.testing.MockRunner(); - model = new angular.scenario.ObjectModel(runner); - output = angular.scenario.output.xml(context, runner, model); - spec = { - name: 'test spec', - definition: { - id: 10, - name: 'describe' - } - }; - step = { - name: 'some step', - line: function() { return 'unknown:-1'; } - }; - }); - - it('should create XML nodes for object model', function() { - runner.emit('SpecBegin', spec); - runner.emit('StepBegin', spec, step); - runner.emit('StepEnd', spec, step); - runner.emit('SpecEnd', spec); - runner.emit('RunnerEnd'); - expect(context.find('it').attr('status')).toEqual('success'); - expect(context.find('it step').attr('status')).toEqual('success'); - }); - - it('should output errors to the XML', function() { - runner.emit('SpecBegin', spec); - runner.emit('StepBegin', spec, step); - runner.emit('StepFailure', spec, step, 'error reason'); - runner.emit('StepEnd', spec, step); - runner.emit('SpecEnd', spec); - runner.emit('RunnerEnd'); - - expect(context.find('it').attr('status')).toEqual('failure'); - expect(context.find('it step').attr('status')).toEqual('failure'); - expect(context.find('it step').text()).toEqual('error reason'); - }); -}); diff --git a/yarn.lock b/yarn.lock index 551d4e915d41..3685e09df137 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3644,10 +3644,6 @@ karma-junit-reporter@^1.2.0: path-is-absolute "^1.0.0" xmlbuilder "8.2.2" -karma-ng-scenario@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/karma-ng-scenario/-/karma-ng-scenario-1.0.0.tgz#03315b27ee866f40443cf88bfebf7963f86543e1" - karma-sauce-launcher@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/karma-sauce-launcher/-/karma-sauce-launcher-1.2.0.tgz#6f2558ddef3cf56879fa27540c8ae9f8bfd16bca" From 167766a5dd277adc42301e2e177816a6fb9a58f6 Mon Sep 17 00:00:00 2001 From: Martin Staffa Date: Fri, 3 Nov 2017 17:57:41 +0100 Subject: [PATCH 321/745] docs(*): add browserTrigger docs; remove references to scenario runner --- docs/content/guide/e2e-testing.ngdoc | 6 ---- src/ng/browser.js | 1 - src/ngMock/browserTrigger.js | 53 +++++++++++++++++++++++++--- 3 files changed, 48 insertions(+), 12 deletions(-) diff --git a/docs/content/guide/e2e-testing.ngdoc b/docs/content/guide/e2e-testing.ngdoc index 4593d10716d3..9d1fa32fcee6 100644 --- a/docs/content/guide/e2e-testing.ngdoc +++ b/docs/content/guide/e2e-testing.ngdoc @@ -5,12 +5,6 @@ # E2E Testing -
        -**Note:** In the past, end-to-end testing could be done with a deprecated tool called -[AngularJS Scenario Runner](http://code.angularjs.org/1.2.16/docs/guide/e2e-testing). That tool -is now in maintenance mode. -
        - As applications grow in size and complexity, it becomes unrealistic to rely on manual testing to verify the correctness of new features, catch bugs and notice regressions. Unit tests are the first line of defense for catching bugs, but sometimes issues come up with integration diff --git a/src/ng/browser.js b/src/ng/browser.js index 3f5f125ed4c3..d5fbc9b6054a 100644 --- a/src/ng/browser.js +++ b/src/ng/browser.js @@ -67,7 +67,6 @@ function Browser(window, document, $log, $sniffer) { /** * @private - * Note: this method is used only by scenario runner * TODO(vojta): prefix this method with $$ ? * @param {function()} callback Function that will be called when no outstanding request */ diff --git a/src/ngMock/browserTrigger.js b/src/ngMock/browserTrigger.js index 13b2592fea03..07dbbc677e20 100644 --- a/src/ngMock/browserTrigger.js +++ b/src/ngMock/browserTrigger.js @@ -2,13 +2,56 @@ (function() { /** - * Triggers a browser event. Attempts to choose the right event if one is - * not specified. + * @ngdoc function + * @name browserTrigger + * @description + * + * This is a global (window) function that is only available when the {@link ngMock} module is + * included. + * + * It can be used to trigger a native browser event on an element, which is useful for unit testing. + * * * @param {Object} element Either a wrapped jQuery/jqLite node or a DOMElement - * @param {string} eventType Optional event type - * @param {Object=} eventData An optional object which contains additional event data (such as x,y - * coordinates, keys, etc...) that are passed into the event when triggered + * @param {string=} eventType Optional event type. If none is specified, the function tries + * to determine the right event type for the element, e.g. `change` for + * `input[text]`. + * @param {Object=} eventData An optional object which contains additional event data that is used + * when creating the event: + * + * - `bubbles`: [Event.bubbles](https://developer.mozilla.org/docs/Web/API/Event/bubbles). + * Not applicable to all events. + * + * - `cancelable`: [Event.cancelable](https://developer.mozilla.org/docs/Web/API/Event/cancelable). + * Not applicable to all events. + * + * - `charcode`: [charCode](https://developer.mozilla.org/docs/Web/API/KeyboardEvent/charcode) + * for keyboard events (keydown, keypress, and keyup). + * + * - `elapsedTime`: the elapsedTime for + * [TransitionEvent](https://developer.mozilla.org/docs/Web/API/TransitionEvent) + * and [AnimationEvent](https://developer.mozilla.org/docs/Web/API/AnimationEvent). + * + * - `keycode`: [keyCode](https://developer.mozilla.org/docs/Web/API/KeyboardEvent/keycode) + * for keyboard events (keydown, keypress, and keyup). + * + * - `keys`: an array of possible modifier keys (ctrl, alt, shift, meta) for + * [MouseEvent](https://developer.mozilla.org/docs/Web/API/MouseEvent) and + * keyboard events (keydown, keypress, and keyup). + * + * - `relatedTarget`: the + * [relatedTarget](https://developer.mozilla.org/docs/Web/API/MouseEvent/relatedTarget) + * for [MouseEvent](https://developer.mozilla.org/docs/Web/API/MouseEvent). + * + * - `which`: [which](https://developer.mozilla.org/docs/Web/API/KeyboardEvent/which) + * for keyboard events (keydown, keypress, and keyup). + * + * - `x`: x-coordinates for [MouseEvent](https://developer.mozilla.org/docs/Web/API/MouseEvent) + * and [TouchEvent](https://developer.mozilla.org/docs/Web/API/TouchEvent). + * + * - `y`: y-coordinates for [MouseEvent](https://developer.mozilla.org/docs/Web/API/MouseEvent) + * and [TouchEvent](https://developer.mozilla.org/docs/Web/API/TouchEvent). + * */ window.browserTrigger = function browserTrigger(element, eventType, eventData) { if (element && !element.nodeName) element = element[0]; From 7df29521d8c1c494f615c49d6c2e1e267e3a6be5 Mon Sep 17 00:00:00 2001 From: Martin Staffa Date: Fri, 3 Nov 2017 17:58:36 +0100 Subject: [PATCH 322/745] refactor($location): remove obsolete workaround for Firefox bug The bug was fixed in Firefox 48: https://bugzilla.mozilla.org/show_bug.cgi?id=684208, and only affected the scenario runner --- src/ng/location.js | 2 -- src/ngMock/browserTrigger.js | 21 +-------------------- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/src/ng/location.js b/src/ng/location.js index 63cdbb84f0d1..09f08c09cdfe 100644 --- a/src/ng/location.js +++ b/src/ng/location.js @@ -938,8 +938,6 @@ function $LocationProvider() { // update location manually if ($location.absUrl() !== $browser.url()) { $rootScope.$apply(); - // hack to work around FF6 bug 684208 when scenario runner clicks on links - $window.angular['ff-684208-preventDefault'] = true; } } } diff --git a/src/ngMock/browserTrigger.js b/src/ngMock/browserTrigger.js index 07dbbc677e20..196772d1e3e9 100644 --- a/src/ngMock/browserTrigger.js +++ b/src/ngMock/browserTrigger.js @@ -147,30 +147,11 @@ if (!evnt) return; - var originalPreventDefault = evnt.preventDefault, - appWindow = element.ownerDocument.defaultView, - fakeProcessDefault = true, - finalProcessDefault, - angular = appWindow.angular || {}; - - // igor: temporary fix for https://bugzilla.mozilla.org/show_bug.cgi?id=684208 - angular['ff-684208-preventDefault'] = false; - evnt.preventDefault = function() { - fakeProcessDefault = false; - return originalPreventDefault.apply(evnt, arguments); - }; - if (!eventData.bubbles || supportsEventBubblingInDetachedTree() || isAttachedToDocument(element)) { - element.dispatchEvent(evnt); + return element.dispatchEvent(evnt); } else { triggerForPath(element, evnt); } - - finalProcessDefault = !(angular['ff-684208-preventDefault'] || !fakeProcessDefault); - - delete angular['ff-684208-preventDefault']; - - return finalProcessDefault; }; function supportsTouchEvents() { From 240a3ddbf12a9bb79754031be95dae4b6bd2dded Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Mon, 18 Dec 2017 14:48:15 +0200 Subject: [PATCH 323/745] feat($resource): add support for `request` and `requestError` interceptors (#15674) This commit adds `request` and `requestError` interceptors for `$resource`, as per the documentation found for `$http` interceptors. It is important to note that returning an error at this stage of the request - before the call to `$http` - will completely bypass any global interceptors and/or recovery handlers, as those are added to a separate context. This is intentional; intercepting a request before it is passed to `$http` indicates that the resource itself has made a decision, and that it accepts the responsibility for recovery. Closes #5146 BREAKING CHANGE: Previously, calling a `$resource` method would synchronously call `$http`. Now, it will be called asynchronously (regardless if a `request`/`requestError` interceptor has been defined. This is not expected to affect applications at runtime, since the overall operation is asynchronous already, but may affect assertions in tests. For example, if you want to assert that `$http` has been called with specific arguments as a result of a `$resource` call, you now need to run a `$digest` first, to ensure the (possibly empty) request interceptor promise has been resolved. Before: ```js it('...', function() { $httpBackend.expectGET('/api/things').respond(...); var Things = $resource('/api/things'); Things.query(); expect($http).toHaveBeenCalledWith(...); }); ``` After: ```js it('...', function() { $httpBackend.expectGET('/api/things').respond(...); var Things = $resource('/api/things'); Things.query(); $rootScope.$digest(); expect($http).toHaveBeenCalledWith(...); }); ``` --- src/ngResource/resource.js | 23 ++- test/ngResource/resourceSpec.js | 271 +++++++++++++++++++++++++++++++- 2 files changed, 284 insertions(+), 10 deletions(-) diff --git a/src/ngResource/resource.js b/src/ngResource/resource.js index 55760d2f77e9..c8a79274ca2b 100644 --- a/src/ngResource/resource.js +++ b/src/ngResource/resource.js @@ -185,11 +185,12 @@ function shallowClearAndCopy(src, dst) { * for more information. * - **`responseType`** - `{string}` - see * [requestType](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#responseType). - * - **`interceptor`** - `{Object=}` - The interceptor object has two optional methods - - * `response` and `responseError`. Both `response` and `responseError` interceptors get called - * with `http response` object. See {@link ng.$http $http interceptors}. In addition, the - * resource instance or array object is accessible by the `resource` property of the - * `http response` object. + * - **`interceptor`** - `{Object=}` - The interceptor object has four optional methods - + * `request`, `requestError`, `response`, and `responseError`. See + * {@link ng.$http $http interceptors} for details. Note that `request`/`requestError` + * interceptors are applied before calling `$http`, thus before any global `$http` interceptors. + * The resource instance or array object is accessible by the `resource` property of the + * `http response` object passed to response interceptors. * Keep in mind that the associated promise will be resolved with the value returned by the * response interceptor, if one is specified. The default response interceptor returns * `response.resource` (i.e. the resource instance or array). @@ -707,6 +708,9 @@ angular.module('ngResource', ['ng']). var isInstanceCall = this instanceof Resource; var value = isInstanceCall ? data : (action.isArray ? [] : new Resource(data)); var httpConfig = {}; + var requestInterceptor = action.interceptor && action.interceptor.request || undefined; + var requestErrorInterceptor = action.interceptor && action.interceptor.requestError || + undefined; var responseInterceptor = action.interceptor && action.interceptor.response || defaultResponseInterceptor; var responseErrorInterceptor = action.interceptor && action.interceptor.responseError || @@ -743,7 +747,14 @@ angular.module('ngResource', ['ng']). extend({}, extractParams(data, action.params || {}), params), action.url); - var promise = $http(httpConfig).then(function(response) { + // Start the promise chain + var promise = $q. + resolve(httpConfig). + then(requestInterceptor). + catch(requestErrorInterceptor). + then($http); + + promise = promise.then(function(response) { var data = response.data; if (data) { diff --git a/test/ngResource/resourceSpec.js b/test/ngResource/resourceSpec.js index c472ad63f9f4..00fce4b662a8 100644 --- a/test/ngResource/resourceSpec.js +++ b/test/ngResource/resourceSpec.js @@ -3,7 +3,7 @@ describe('resource', function() { describe('basic usage', function() { - var $resource, CreditCard, callback, $httpBackend, resourceProvider; + var $resource, CreditCard, callback, $httpBackend, resourceProvider, $q; beforeEach(module('ngResource')); @@ -14,6 +14,7 @@ describe('basic usage', function() { beforeEach(inject(function($injector) { $httpBackend = $injector.get('$httpBackend'); $resource = $injector.get('$resource'); + $q = $injector.get('$q'); CreditCard = $resource('/CreditCard/:id:verb', {id:'@id.key'}, { charge:{ method:'post', @@ -1129,6 +1130,188 @@ describe('basic usage', function() { }); + describe('requestInterceptor', function() { + var rejectReason = {'lol':'cat'}; + var successSpy, failureSpy; + + beforeEach(function() { + successSpy = jasmine.createSpy('successSpy'); + failureSpy = jasmine.createSpy('failureSpy'); + }); + + it('should allow per action request interceptor that gets full configuration', function() { + var CreditCard = $resource('/CreditCard', {}, { + query: { + method: 'get', + isArray: true, + interceptor: { + request: function(httpConfig) { + callback(httpConfig); + return httpConfig; + } + } + } + }); + + $httpBackend.expect('GET', '/CreditCard').respond([{id: 1}]); + + var resource = CreditCard.query(); + resource.$promise.then(successSpy, failureSpy); + + $httpBackend.flush(); + expect(callback).toHaveBeenCalledOnce(); + expect(successSpy).toHaveBeenCalledOnce(); + expect(failureSpy).not.toHaveBeenCalled(); + + expect(callback).toHaveBeenCalledWith({ + 'method': 'get', + 'url': '/CreditCard' + }); + }); + + it('should call $http with the value returned from requestInterceptor', function() { + var CreditCard = $resource('/CreditCard', {}, { + query: { + method: 'get', + isArray: true, + interceptor: { + request: function(httpConfig) { + httpConfig.url = '/DebitCard'; + return httpConfig; + } + } + } + }); + + $httpBackend.expect('GET', '/DebitCard').respond([{id: 1}]); + + var resource = CreditCard.query(); + resource.$promise.then(successSpy, failureSpy); + + $httpBackend.flush(); + expect(successSpy).toHaveBeenCalledOnceWith(jasmine.arrayContaining([ + jasmine.objectContaining({id: 1}) + ])); + expect(failureSpy).not.toHaveBeenCalled(); + }); + + it('should abort the operation if the requestInterceptor rejects the operation', function() { + var CreditCard = $resource('/CreditCard', {}, { + query: { + method: 'get', + isArray: true, + interceptor: { + request: function() { + return $q.reject(rejectReason); + } + } + } + }); + + var resource = CreditCard.query(); + resource.$promise.then(successSpy, failureSpy); + + // Make sure all promises resolve. + $rootScope.$apply(); + + // Ensure the resource promise was rejected + expect(resource.$resolved).toBeTruthy(); + expect(successSpy).not.toHaveBeenCalled(); + expect(failureSpy).toHaveBeenCalledOnceWith(rejectReason); + + // Ensure that no requests were made. + $httpBackend.verifyNoOutstandingRequest(); + }); + + it('should call requestErrorInterceptor if requestInterceptor rejects the operation', function() { + var CreditCard = $resource('/CreditCard', {}, { + query: { + method: 'get', + isArray: true, + interceptor: { + request: function() { + return $q.reject(rejectReason); + }, + requestError: function(rejection) { + callback(rejection); + return $q.reject(rejection); + } + } + } + }); + + var resource = CreditCard.query(); + resource.$promise.then(successSpy, failureSpy); + $rootScope.$digest(); + + expect(callback).toHaveBeenCalledOnceWith(rejectReason); + expect(successSpy).not.toHaveBeenCalled(); + expect(failureSpy).toHaveBeenCalledOnceWith(rejectReason); + + // Ensure that no requests were made. + $httpBackend.verifyNoOutstandingRequest(); + }); + + it('should abort the operation if a requestErrorInterceptor rejects the operation', function() { + var CreditCard = $resource('/CreditCard', {}, { + query: { + method: 'get', + isArray: true, + interceptor: { + request: function() { + return $q.reject(rejectReason); + }, + requestError: function(rejection) { + return $q.reject(rejection); + } + } + } + }); + + var resource = CreditCard.query(); + resource.$promise.then(successSpy, failureSpy); + $rootScope.$apply(); + + expect(resource.$resolved).toBeTruthy(); + expect(successSpy).not.toHaveBeenCalled(); + expect(failureSpy).toHaveBeenCalledOnceWith(rejectReason); + + // Ensure that no requests were made. + $httpBackend.verifyNoOutstandingRequest(); + }); + + it('should continue the operation if a requestErrorInterceptor rescues it', function() { + var CreditCard = $resource('/CreditCard', {}, { + query: { + method: 'get', + isArray: true, + interceptor: { + request: function(httpConfig) { + return $q.reject(httpConfig); + }, + requestError: function(httpConfig) { + return $q.resolve(httpConfig); + } + } + } + }); + + $httpBackend.expect('GET', '/CreditCard').respond([{id: 1}]); + + var resource = CreditCard.query(); + resource.$promise.then(successSpy, failureSpy); + $httpBackend.flush(); + + expect(resource.$resolved).toBeTruthy(); + expect(successSpy).toHaveBeenCalledOnceWith(jasmine.arrayContaining([ + jasmine.objectContaining({id: 1}) + ])); + expect(failureSpy).not.toHaveBeenCalled(); + + $httpBackend.verifyNoOutstandingRequest(); + }); + }); + it('should allow per action response interceptor that gets full response', function() { CreditCard = $resource('/CreditCard', {}, { query: { @@ -1584,6 +1767,7 @@ describe('extra params', function() { var $http; var $httpBackend; var $resource; + var $rootScope; beforeEach(module('ngResource')); @@ -1593,10 +1777,11 @@ describe('extra params', function() { }); })); - beforeEach(inject(function(_$http_, _$httpBackend_, _$resource_) { + beforeEach(inject(function(_$http_, _$httpBackend_, _$resource_, _$rootScope_) { $http = _$http_; $httpBackend = _$httpBackend_; $resource = _$resource_; + $rootScope = _$rootScope_; })); afterEach(function() { @@ -1610,6 +1795,7 @@ describe('extra params', function() { var R = $resource('/:foo'); R.get({foo: 'bar', baz: 'qux'}); + $rootScope.$digest(); expect($http).toHaveBeenCalledWith(jasmine.objectContaining({params: {baz: 'qux'}})); }); @@ -1624,7 +1810,7 @@ describe('extra params', function() { }); describe('errors', function() { - var $httpBackend, $resource, $q; + var $httpBackend, $resource, $q, $rootScope; beforeEach(module(function($exceptionHandlerProvider) { $exceptionHandlerProvider.mode('log'); @@ -1636,6 +1822,7 @@ describe('errors', function() { $httpBackend = $injector.get('$httpBackend'); $resource = $injector.get('$resource'); $q = $injector.get('$q'); + $rootScope = $injector.get('$rootScope'); })); @@ -1838,6 +2025,81 @@ describe('handling rejections', function() { expect($exceptionHandler.errors[0]).toMatch(/^Error: should be caught/); } ); + + describe('requestInterceptor', function() { + var rejectReason = {'lol':'cat'}; + var $q, $rootScope; + var successSpy, failureSpy, callback; + + beforeEach(inject(function(_$q_, _$rootScope_) { + $q = _$q_; + $rootScope = _$rootScope_; + + successSpy = jasmine.createSpy('successSpy'); + failureSpy = jasmine.createSpy('failureSpy'); + callback = jasmine.createSpy(); + })); + + it('should call requestErrorInterceptor if requestInterceptor throws an error', function() { + var CreditCard = $resource('/CreditCard', {}, { + query: { + method: 'get', + isArray: true, + interceptor: { + request: function() { + throw rejectReason; + }, + requestError: function(rejection) { + callback(rejection); + return $q.reject(rejection); + } + } + } + }); + + var resource = CreditCard.query(); + resource.$promise.then(successSpy, failureSpy); + $rootScope.$apply(); + + expect(callback).toHaveBeenCalledOnce(); + expect(callback).toHaveBeenCalledWith(rejectReason); + expect(successSpy).not.toHaveBeenCalled(); + expect(failureSpy).toHaveBeenCalledOnce(); + expect(failureSpy).toHaveBeenCalledWith(rejectReason); + + // Ensure that no requests were made. + $httpBackend.verifyNoOutstandingRequest(); + }); + + it('should abort the operation if a requestErrorInterceptor throws an exception', function() { + var CreditCard = $resource('/CreditCard', {}, { + query: { + method: 'get', + isArray: true, + interceptor: { + request: function() { + return $q.reject(); + }, + requestError: function() { + throw rejectReason; + } + } + } + }); + + var resource = CreditCard.query(); + resource.$promise.then(successSpy, failureSpy); + $rootScope.$apply(); + + expect(resource.$resolved).toBeTruthy(); + expect(successSpy).not.toHaveBeenCalled(); + expect(failureSpy).toHaveBeenCalledOnce(); + expect(failureSpy).toHaveBeenCalledWith(rejectReason); + + // Ensure that no requests were made. + $httpBackend.verifyNoOutstandingRequest(); + }); + }); }); describe('cancelling requests', function() { @@ -1902,7 +2164,7 @@ describe('cancelling requests', function() { ); it('should use `cancellable` value if passed a non-numeric `timeout` in an action', - inject(function($log, $q) { + inject(function($log, $q, $rootScope) { spyOn($log, 'debug'); $httpBackend.whenGET('/CreditCard').respond({}); @@ -1915,6 +2177,7 @@ describe('cancelling requests', function() { }); var creditCard = CreditCard.get(); + $rootScope.$digest(); expect(creditCard.$cancelRequest).toBeDefined(); expect(httpSpy.calls.argsFor(0)[0].timeout).toEqual(jasmine.any($q)); expect(httpSpy.calls.argsFor(0)[0].timeout.then).toBeDefined(); From 22450e5b7c8486a721db74be32333007273ba584 Mon Sep 17 00:00:00 2001 From: Martin Staffa Date: Mon, 18 Dec 2017 15:17:56 +0100 Subject: [PATCH 324/745] docs(CHANGELOG.md): add changes for 1.6.8 --- CHANGELOG.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85809d7573ba..2fb3c1064bea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,25 @@ + +# 1.6.8 beneficial-tincture (2017-12-18) + + +## Bug Fixes +- **$location:** + - always decode special chars in `$location.url(value)` + ([2bdf71](https://github.com/angular/angular.js/commit/2bdf7126878c87474bb7588ce093d0a3c57b0026)) + - decode non-component special chars in Hashbang URLS + ([57b626](https://github.com/angular/angular.js/commit/57b626a673b7530399d3377dfe770165bec35f8a)) +- **ngModelController:** allow $overrideModelOptions to set updateOn + ([55516d](https://github.com/angular/angular.js/commit/55516da2dfc7c5798dce24e9fa930c5ac90c900c), + [#16351](https://github.com/angular/angular.js/issues/16351), + [#16364](https://github.com/angular/angular.js/issues/16364)) + + +## New Features +- **$parse:** add a hidden interface to retrieve an expression's AST + ([f33d95](https://github.com/angular/angular.js/commit/f33d95cfcff6fd0270f92a142df8794cca2013ad), + [#16253](https://github.com/angular/angular.js/issues/16253), + [#16260](https://github.com/angular/angular.js/issues/16260)) + # 1.6.7 imperial-backstroke (2017-11-24) From 62743a54b79187e6c1325c0f6dec0f474147881d Mon Sep 17 00:00:00 2001 From: Georgios Kalpakas Date: Wed, 7 Sep 2016 23:40:38 +0300 Subject: [PATCH 325/745] feat(currencyFilter): trim whitespace around an empty currency symbol In most locales, this won't make a difference (since they do not have whitespace around their currency symbols). In locales where there is a whitespace separating the currency symbol from the number, it makes sense to also remove such whitespace if the user specified an empty currency symbol (indicating they just want the number). Fixes #15018 Closes #15085 Closes #15105 --- src/ng/filter/filters.js | 5 ++++- test/ng/filter/filtersSpec.js | 13 +++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/ng/filter/filters.js b/src/ng/filter/filters.js index 5a79a7799929..482b31897c79 100644 --- a/src/ng/filter/filters.js +++ b/src/ng/filter/filters.js @@ -68,11 +68,14 @@ function currencyFilter($locale) { fractionSize = formats.PATTERNS[1].maxFrac; } + // If the currency symbol is empty, trim whitespace around the symbol + var currencySymbolRe = !currencySymbol ? /\s*\u00A4\s*/g : /\u00A4/g; + // if null or undefined pass it through return (amount == null) ? amount : formatNumber(amount, formats.PATTERNS[1], formats.GROUP_SEP, formats.DECIMAL_SEP, fractionSize). - replace(/\u00A4/g, currencySymbol); + replace(currencySymbolRe, currencySymbol); }; } diff --git a/test/ng/filter/filtersSpec.js b/test/ng/filter/filtersSpec.js index 8e3a54a0b2df..0646dfa656af 100644 --- a/test/ng/filter/filtersSpec.js +++ b/test/ng/filter/filtersSpec.js @@ -186,6 +186,19 @@ describe('filters', function() { expect(currency(1.07)).toBe('$1.1'); })); + + it('should trim whitespace around the currency symbol if it is empty', + inject(function($locale) { + var pattern = $locale.NUMBER_FORMATS.PATTERNS[1]; + pattern.posPre = pattern.posSuf = ' \u00A4 '; + pattern.negPre = pattern.negSuf = ' - \u00A4 - '; + + expect(currency(+1.07, '$')).toBe(' $ 1.07 $ '); + expect(currency(-1.07, '$')).toBe(' - $ - 1.07 - $ - '); + expect(currency(+1.07, '')).toBe('1.07'); + expect(currency(-1.07, '')).toBe(' -- 1.07 -- '); + }) + ); }); describe('number', function() { From 9a521cb3ad223f4f21e7f616138ec9eb5466fcb6 Mon Sep 17 00:00:00 2001 From: Frederik Prijck Date: Tue, 19 Dec 2017 18:29:53 +0100 Subject: [PATCH 326/745] docs(PULL_REQUEST_TEMPLATE.md): fix broken links in PR template Closes #16377 --- .github/PULL_REQUEST_TEMPLATE.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index d4c3f81373a3..c10156c9502e 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,4 +1,4 @@ - + **What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)** @@ -16,8 +16,8 @@ **Please check if the PR fulfills these requirements** -- [ ] The commit message follows our [guidelines](../DEVELOPERS.md#commits) -- [ ] Fix/Feature: [Docs](../DEVELOPERS.md#documentation) have been added/updated +- [ ] The commit message follows our [guidelines](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#commits) +- [ ] Fix/Feature: [Docs](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#documentation) have been added/updated - [ ] Fix/Feature: Tests have been added; existing tests pass **Other information**: From 96dd35afb6156746c8e62e2e1c51feb42931328f Mon Sep 17 00:00:00 2001 From: Georgii Dolzhykov Date: Fri, 29 Dec 2017 15:30:31 +0200 Subject: [PATCH 327/745] docs(ngModel.NgModelController): correct description for `$viewChangeListeners` It was misleading. Closes #16382 --- src/ng/directive/ngModel.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ng/directive/ngModel.js b/src/ng/directive/ngModel.js index 7802d05177e6..b9aa13ce13ea 100644 --- a/src/ng/directive/ngModel.js +++ b/src/ng/directive/ngModel.js @@ -127,8 +127,10 @@ var ngModelMinErr = minErr('ngModel'); * }; * ``` * - * @property {Array.} $viewChangeListeners Array of functions to execute whenever the - * view value has changed. It is called with no arguments, and its return value is ignored. + * @property {Array.} $viewChangeListeners Array of functions to execute whenever + * a change to {@link ngModel.NgModelController#$viewValue `$viewValue`} has caused a change + * to {@link ngModel.NgModelController#$modelValue `$modelValue`}. + * It is called with no arguments, and its return value is ignored. * This can be used in place of additional $watches against the model value. * * @property {Object} $error An object hash with all failing validator ids as keys. From e942e1e988d71b86bade392ef53eeee108e92861 Mon Sep 17 00:00:00 2001 From: Sergey Kryvets Date: Fri, 29 Dec 2017 10:48:35 -0600 Subject: [PATCH 328/745] docs(developers.md): update node version as specified in package.json Closes #16384 --- DEVELOPERS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEVELOPERS.md b/DEVELOPERS.md index d70897f9ddb9..38a7214516b3 100644 --- a/DEVELOPERS.md +++ b/DEVELOPERS.md @@ -18,7 +18,7 @@ machine: * [Git](http://git-scm.com/): The [Github Guide to Installing Git][git-setup] is a good source of information. -* [Node.js v6.x (LTS)](http://nodejs.org): We use Node to generate the documentation, run a +* [Node.js v8.x (LTS)](http://nodejs.org): We use Node to generate the documentation, run a development web server, run tests, and generate distributable files. Depending on your system, you can install Node either from source or as a pre-packaged bundle. From 88cb9af59487171d1e2728800dcd45f66057517e Mon Sep 17 00:00:00 2001 From: Martin Staffa Date: Wed, 3 Jan 2018 18:19:05 +0100 Subject: [PATCH 329/745] docs(DEVELOPERS.md): improve testing section --- DEVELOPERS.md | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/DEVELOPERS.md b/DEVELOPERS.md index 38a7214516b3..9155a5597f71 100644 --- a/DEVELOPERS.md +++ b/DEVELOPERS.md @@ -1,6 +1,7 @@ # Developing AngularJS * [Development Setup](#setup) +* [Running Tests](#tests) * [Coding Rules](#rules) * [Commit Message Guidelines](#commits) * [Writing Documentation](#documentation) @@ -107,6 +108,8 @@ HTTP server. For this purpose, we have made available a local web server based o http://localhost:8000/build/docs/ ``` +## Running Tests + ### Running the Unit Test Suite We write unit and integration tests with Jasmine and execute them with Karma. To run all of the @@ -116,7 +119,7 @@ tests once on Chrome run: yarn grunt test:unit ``` -To run the tests on other browsers (Chrome, ChromeCanary, Firefox and Safari are pre-configured) use: +To run the tests on other browsers (Chrome and Firefox are pre-configured) use: ```shell yarn grunt test:unit --browsers=Chrome,Firefox @@ -124,16 +127,19 @@ yarn grunt test:unit --browsers=Chrome,Firefox **Note:** there should be _no spaces between browsers_. `Chrome, Firefox` is INVALID. +If you want to test locally on Safari, Internet Explorer, or Edge, you must install +the respective `karma--launcher` from npm. + If you have a Saucelabs or Browserstack account, you can also run the unit tests on these services -via our pre-defined customLaunchers. +via our pre-defined customLaunchers. See the [karma config file](/karma-shared.conf.js) for all pre-configured browsers. -For example, to run the whole unit test suite: +For example, to run the whole unit test suite on selected browsers: ```shell # Browserstack -yarn grunt test:unit --browsers=BS_Chrome,BS_Firefox,BS_Safari,BS_IE_9,BS_IE_10,BS_IE_11,BS_EDGE,BS_iOS_8,BS_iOS_9,BS_iOS_10 +yarn grunt test:unit --browsers=BS_Chrome,BS_Firefox,BS_Safari,BS_IE_9,BS_IE_10,BS_IE_11,BS_EDGE,BS_iOS_10 # Saucelabs -yarn grunt test:unit --browsers=BS_Chrome,BS_Firefox,BS_Safari,BS_IE_9,BS_IE_10,BS_IE_11,BS_EDGE,BS_iOS_8,BS_iOS_9,BS_iOS_10 +yarn grunt test:unit --browsers=SL_Chrome,SL_Firefox,SL_Safari,SL_IE_9,SL_IE_10,SL_IE_11,SL_EDGE,SL_iOS_10 ``` Running these commands requires you to set up [Karma Browserstack][karma-browserstack] or @@ -483,4 +489,4 @@ You can see an example of a well-defined example [in the `ngRepeat` documentatio [karma-browserstack]: https://github.com/karma-runner/karma-browserstack-launcher [karma-saucelabs]: https://github.com/karma-runner/karma-sauce-launcher [unit-testing]: https://docs.angularjs.org/guide/unit-testing -[yarn-install]: https://yarnpkg.com/en/docs/install \ No newline at end of file +[yarn-install]: https://yarnpkg.com/en/docs/install From 07d84dd85f44f773766dba6db5ff99e2dd1ad69c Mon Sep 17 00:00:00 2001 From: Martin Staffa Date: Fri, 5 Jan 2018 15:47:22 +0100 Subject: [PATCH 330/745] chore(*): update copyright year Closes #16386 --- LICENSE | 2 +- docs/config/templates/app/indexPage.template.html | 2 +- src/angular.prefix | 2 +- src/loader.prefix | 2 +- src/module.prefix | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/LICENSE b/LICENSE index 4b589a7e7dfa..91f064493681 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License -Copyright (c) 2010-2017 Google, Inc. http://angularjs.org +Copyright (c) 2010-2018 Google, Inc. http://angularjs.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/docs/config/templates/app/indexPage.template.html b/docs/config/templates/app/indexPage.template.html index 10883c828e02..44ef6ebd7b1a 100644 --- a/docs/config/templates/app/indexPage.template.html +++ b/docs/config/templates/app/indexPage.template.html @@ -209,7 +209,7 @@

        {{ key }}

        Back to top

        - Super-powered by Google ©2010-2017 + Super-powered by Google ©2010-2018 ( diff --git a/src/angular.prefix b/src/angular.prefix index dc77488d1c01..387ae6789295 100644 --- a/src/angular.prefix +++ b/src/angular.prefix @@ -1,6 +1,6 @@ /** * @license AngularJS v"NG_VERSION_FULL" - * (c) 2010-2017 Google, Inc. http://angularjs.org + * (c) 2010-2018 Google, Inc. http://angularjs.org * License: MIT */ (function(window) { diff --git a/src/loader.prefix b/src/loader.prefix index 9488eb1bef74..70f68fe8c896 100644 --- a/src/loader.prefix +++ b/src/loader.prefix @@ -1,6 +1,6 @@ /** * @license AngularJS v"NG_VERSION_FULL" - * (c) 2010-2017 Google, Inc. http://angularjs.org + * (c) 2010-2018 Google, Inc. http://angularjs.org * License: MIT */ 'use strict'; diff --git a/src/module.prefix b/src/module.prefix index 4f6d33bd8914..499a524355a2 100644 --- a/src/module.prefix +++ b/src/module.prefix @@ -1,6 +1,6 @@ /** * @license AngularJS v"NG_VERSION_FULL" - * (c) 2010-2017 Google, Inc. http://angularjs.org + * (c) 2010-2018 Google, Inc. http://angularjs.org * License: MIT */ (function(window, angular) { From d253c9d45c69705e80dce519b2c393424b2d5e85 Mon Sep 17 00:00:00 2001 From: Martin Staffa Date: Wed, 3 Jan 2018 15:40:14 +0100 Subject: [PATCH 331/745] test($sanitize): skip nextSibling clobber test on Edge 16 In some circumstances, Edge 16 will not throw on clobbered elements, because the nextSibling property is null. The exact cause is currently unknown. --- test/ngSanitize/sanitizeSpec.js | 41 ++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/test/ngSanitize/sanitizeSpec.js b/test/ngSanitize/sanitizeSpec.js index 2bab68093181..aa659e5844e2 100644 --- a/test/ngSanitize/sanitizeSpec.js +++ b/test/ngSanitize/sanitizeSpec.js @@ -246,24 +246,37 @@ describe('HTML', function() { .toEqual('

        text1text2

        '); }); - it('should throw on clobbered elements', function() { - inject(function($sanitize) { - expect(function() { - $sanitize('
        '); - }).toThrowMinErr('$sanitize', 'elclob'); + describe('clobbered elements', function() { - expect(function() { - $sanitize('
        '); - }).toThrowMinErr('$sanitize', 'elclob'); + it('should throw on a form with an input named "parentNode"', function() { + inject(function($sanitize) { - expect(function() { - $sanitize('
        '); - }).toThrowMinErr('$sanitize', 'elclob'); + expect(function() { + $sanitize('
        '); + }).toThrowMinErr('$sanitize', 'elclob'); - expect(function() { - $sanitize('
        '); - }).toThrowMinErr('$sanitize', 'elclob'); + expect(function() { + $sanitize('
        '); + }).toThrowMinErr('$sanitize', 'elclob'); + }); }); + + if (!/Edge\/16/.test(window.navigator.userAgent)) { + // Skip test on Edge 16 due to browser bug. + it('should throw on a form with an input named "nextSibling"', function() { + inject(function($sanitize) { + + expect(function() { + $sanitize('
        '); + }).toThrowMinErr('$sanitize', 'elclob'); + + expect(function() { + $sanitize('
        '); + }).toThrowMinErr('$sanitize', 'elclob'); + + }); + }); + } }); // See https://github.com/cure53/DOMPurify/blob/a992d3a75031cb8bb032e5ea8399ba972bdf9a65/src/purify.js#L439-L449 From 89881578614c5954943e5b83a27c8ba748e50ce2 Mon Sep 17 00:00:00 2001 From: Martin Staffa Date: Fri, 5 Jan 2018 21:35:26 +0100 Subject: [PATCH 332/745] chore(node): update jasmine to 2.8.0, and adjust tests --- package.json | 2 +- test/AngularSpec.js | 5 ++++- yarn.lock | 6 +++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index bb62da46e9c6..8210024c53fe 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "gulp-sourcemaps": "^1.2.2", "gulp-uglify": "^1.0.1", "gulp-util": "^3.0.1", - "jasmine-core": "2.5.2", + "jasmine-core": "^2.8.0", "jasmine-node": "^2.0.0", "jasmine-reporters": "^2.2.0", "jquery": "^3.2.1", diff --git a/test/AngularSpec.js b/test/AngularSpec.js index bb8ca7a8def6..c10b92e01179 100644 --- a/test/AngularSpec.js +++ b/test/AngularSpec.js @@ -1035,10 +1035,13 @@ describe('angular', function() { } - var originalFunction; + var originalPrototype = window.Function.prototype; beforeEach(function() { spyOn(window, 'Function'); + // Jasmine 2.7+ doesn't support spying on Function, so we have restore the prototype + // as Jasmine will use Function internally + window.Function.prototype = originalPrototype; }); afterEach(function() { diff --git a/yarn.lock b/yarn.lock index 3685e09df137..dd52d0028982 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3489,7 +3489,11 @@ jade@0.26.3: commander "0.6.1" mkdirp "0.3.0" -jasmine-core@2.5.2, jasmine-core@~2.5.2: +jasmine-core@^2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e" + +jasmine-core@~2.5.2: version "2.5.2" resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.5.2.tgz#6f61bd79061e27f43e6f9355e44b3c6cab6ff297" From 8da3aef91c33cd15b465bbaaf2e1ceca90aa2aab Mon Sep 17 00:00:00 2001 From: Martin Staffa Date: Fri, 5 Jan 2018 22:05:15 +0100 Subject: [PATCH 333/745] chore(node): update karma to 2.0.0 Also reduce karma log level on Travis to INFO. Before, the log level was DEBUG, but it seems that prior to karma 2.0.0, the debug messages were not outoput on Karma, so this simply restores the status quo (and prevents cluttering the log). --- karma-shared.conf.js | 1 - package.json | 2 +- yarn.lock | 1802 +++++++++++++++++++++++++++++++++--------- 3 files changed, 1447 insertions(+), 358 deletions(-) diff --git a/karma-shared.conf.js b/karma-shared.conf.js index 88c297b8fbf7..d9a68a56dd80 100644 --- a/karma-shared.conf.js +++ b/karma-shared.conf.js @@ -181,7 +181,6 @@ module.exports = function(config, specificOptions) { if (process.env.TRAVIS) { var buildLabel = 'TRAVIS #' + process.env.TRAVIS_BUILD_NUMBER + ' (' + process.env.TRAVIS_BUILD_ID + ')'; - config.logLevel = config.LOG_DEBUG; // Karma (with socket.io 1.x) buffers by 50 and 50 tests can take a long time on IEs;-) config.browserNoActivityTimeout = 120000; diff --git a/package.json b/package.json index 8210024c53fe..fe7ab23e569e 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "jasmine-node": "^2.0.0", "jasmine-reporters": "^2.2.0", "jquery": "^3.2.1", - "karma": "^1.7.0", + "karma": "^2.0.0", "karma-browserstack-launcher": "^1.2.0", "karma-chrome-launcher": "^2.1.1", "karma-firefox-launcher": "^1.0.1", diff --git a/yarn.lock b/yarn.lock index dd52d0028982..9816298d76f3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -43,7 +43,11 @@ JSONStream@~0.8.3, JSONStream@~0.8.4: jsonparse "0.0.5" through ">=2.2.7 <3" -abbrev@1, abbrev@~1.0.4: +abbrev@1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" + +abbrev@~1.0.4: version "1.0.9" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.0.9.tgz#91b4792588a7738c25f35dd6f63752a2f8776135" @@ -80,6 +84,10 @@ acorn@^3.0.4, acorn@^3.1.0: version "3.3.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" +addressparser@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/addressparser/-/addressparser-1.0.1.tgz#47afbe1a2a9262191db6838e4fd1d39b40821746" + adm-zip@0.4.4: version "0.4.4" resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.4.tgz#a61ed5ae6905c3aea58b3a657d25033091052736" @@ -110,6 +118,22 @@ ajv@^4.7.0: co "^4.6.0" json-stable-stringify "^1.0.1" +ajv@^4.9.1: + version "4.11.8" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536" + dependencies: + co "^4.6.0" + json-stable-stringify "^1.0.1" + +ajv@^5.1.0: + version "5.5.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" + dependencies: + co "^4.6.0" + fast-deep-equal "^1.0.0" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.3.0" + align-text@^0.1.1, align-text@^0.1.3: version "0.1.4" resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" @@ -165,15 +189,15 @@ ansi-styles@^2.2.1: resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" anymatch@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.0.tgz#a3e52fa39168c825ff57b0248126ce5a8ff95507" + version "1.3.2" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a" dependencies: - arrify "^1.0.0" micromatch "^2.1.5" + normalize-path "^2.0.0" aproba@^1.0.3: - version "1.1.0" - resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.1.0.tgz#4d8f047a318604e18e3c06a0e52230d3d19f147b" + version "1.2.0" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" archiver-utils@^1.3.0: version "1.3.0" @@ -209,11 +233,11 @@ archy@^1.0.0: resolved "https://registry.yarnpkg.com/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40" are-we-there-yet@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.2.tgz#80e470e95a084794fe1899262c5667c6e88de1b3" + version "1.1.4" + resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz#bb5dca382bb94f05e15194373d16fd3ba1ca110d" dependencies: delegates "^1.0.0" - readable-stream "^2.0.0 || ^1.1.13" + readable-stream "^2.0.6" argparse@^1.0.2: version "1.0.9" @@ -228,8 +252,8 @@ arr-diff@^2.0.0: arr-flatten "^1.0.1" arr-flatten@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.0.1.tgz#e5ffe54d45e19f32f216e91eb99c8ce892bb604b" + version "1.1.0" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" array-differ@^1.0.0: version "1.0.0" @@ -273,9 +297,9 @@ array-unique@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" -arraybuffer.slice@0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/arraybuffer.slice/-/arraybuffer.slice-0.0.6.tgz#f33b2159f0532a3f3107a272c0ccfbd1ad2979ca" +arraybuffer.slice@~0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz#3bbc4275dd584cc1b10809b89d4e8b63a69e7675" arrify@^1.0.0: version "1.0.1" @@ -301,6 +325,10 @@ asn1@~0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.3.tgz#dac8787713c9966849fc8180777ebe9c1ddf3b86" +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + assert-plus@^0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.1.5.tgz#ee74009413002d84cec7219c6ac811812e723160" @@ -309,9 +337,11 @@ assert-plus@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234" -assert-plus@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" +assert@^1.4.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/assert/-/assert-1.4.1.tgz#99912d591836b5a6f5b345c0f07eefc08fc65d91" + dependencies: + util "0.10.3" assert@~1.1.0: version "1.1.2" @@ -319,6 +349,10 @@ assert@~1.1.0: dependencies: util "0.10.3" +ast-types@0.x.x: + version "0.10.1" + resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.10.1.tgz#f52fca9715579a14f841d67d7f8d25432ab6a3dd" + astw@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/astw/-/astw-2.0.0.tgz#08121ac8288d35611c0ceec663f6cd545604897d" @@ -329,6 +363,10 @@ async-each@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" +async-limiter@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" + async@1.5.2, async@^1.5.2, async@~1.5.2: version "1.5.2" resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" @@ -357,6 +395,12 @@ async@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/async/-/async-1.0.0.tgz#f8fc04ca3a13784ade9e1641af98578cfbd647a9" +async@~2.1.2: + version "2.1.5" + resolved "https://registry.yarnpkg.com/async/-/async-2.1.5.tgz#e587c68580994ac67fc56ff86d3ac56bdbe810bc" + dependencies: + lodash "^4.14.0" + asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -373,10 +417,20 @@ aws-sign2@~0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.6.0.tgz#14342dd38dbcc94d0e5b87d763cd63612c0e794f" -aws4@^1.2.1: +aws-sign2@~0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" + +aws4@^1.2.1, aws4@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e" +axios@^0.15.3: + version "0.15.3" + resolved "https://registry.yarnpkg.com/axios/-/axios-0.15.3.tgz#2c9d638b2e191a08ea1d6cc988eadd6ba5bdc053" + dependencies: + follow-redirects "1.0.0" + babel-code-frame@^6.16.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4" @@ -389,9 +443,9 @@ backo2@1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/backo2/-/backo2-1.0.2.tgz#31ab1ac8b129363463e35b3ebb69f4dfcfba7947" -balanced-match@^0.4.1: - version "0.4.2" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838" +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" base64-arraybuffer@0.1.5: version "0.1.5" @@ -401,6 +455,10 @@ base64-js@0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-0.0.7.tgz#54400dc91d696cec32a8a47902f971522fee8f48" +base64-js@^1.0.2: + version "1.2.1" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.2.1.tgz#a91947da1f4a516ea38e5b4ec0ec3773675e0886" + base64id@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/base64id/-/base64id-1.0.0.tgz#47688cb99bb6804f0e06d3e763b1c32e57d8e6b6" @@ -434,8 +492,8 @@ better-assert@~1.0.0: callsite "1.0.0" binary-extensions@^1.0.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.8.0.tgz#48ec8d16df4377eae5fa5884682480af4d95c774" + version "1.11.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.11.0.tgz#46aa1751fb6a2f93ee5e689bb1087d4b14c6c205" "binary@>= 0.3.0 < 1", binary@~0.3.0: version "0.3.0" @@ -456,6 +514,12 @@ bl@^1.0.0: dependencies: readable-stream "^2.0.5" +bl@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/bl/-/bl-1.1.2.tgz#fdca871a99713aa00d19e3bbba41c44787a65398" + dependencies: + readable-stream "~2.0.5" + blob@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/blob/-/blob-0.0.4.tgz#bcf13052ca54463f30f9fc7e95b9a47630a94921" @@ -472,7 +536,11 @@ blocking-proxy@0.0.5: dependencies: minimist "^1.2.0" -bluebird@^3.3.0, bluebird@^3.4.6: +bluebird@^3.3.0: + version "3.5.1" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.1.tgz#d9551f9de98f1fcda1e683d17ee91a0602ee2eb9" + +bluebird@^3.4.6: version "3.4.7" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.4.7.tgz#f72d760be09b7f76d08ed8fae98b289a8d05fab3" @@ -481,19 +549,19 @@ bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0: resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.6.tgz#53344adb14617a13f6e8dd2ce28905d1c0ba3215" body-parser@^1.16.1: - version "1.17.1" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.17.1.tgz#75b3bc98ddd6e7e0d8ffe750dfaca5c66993fa47" - dependencies: - bytes "2.4.0" - content-type "~1.0.2" - debug "2.6.1" - depd "~1.1.0" - http-errors "~1.6.1" - iconv-lite "0.4.15" + version "1.18.2" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.18.2.tgz#87678a19d84b47d859b83199bd59bce222b10454" + dependencies: + bytes "3.0.0" + content-type "~1.0.4" + debug "2.6.9" + depd "~1.1.1" + http-errors "~1.6.2" + iconv-lite "0.4.19" on-finished "~2.3.0" - qs "6.4.0" - raw-body "~2.2.0" - type-is "~1.6.14" + qs "6.5.1" + raw-body "2.3.2" + type-is "~1.6.15" boom@0.4.x: version "0.4.2" @@ -507,6 +575,18 @@ boom@2.x.x: dependencies: hoek "2.x.x" +boom@4.x.x: + version "4.3.1" + resolved "https://registry.yarnpkg.com/boom/-/boom-4.3.1.tgz#4f8a3005cb4a7e3889f749030fd25b96e01d2e31" + dependencies: + hoek "4.x.x" + +boom@5.x.x: + version "5.2.0" + resolved "https://registry.yarnpkg.com/boom/-/boom-5.2.0.tgz#5dd9da6ee3a5f302077436290cb717d3f4a54e02" + dependencies: + hoek "4.x.x" + bootstrap@3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-3.1.1.tgz#17e14ed261c0fcd9b52ea9aa6420f6d51cd5fa77" @@ -599,11 +679,11 @@ bower@~1.3.9: update-notifier "0.2.0" which "~1.0.5" -brace-expansion@^1.0.0: - version "1.1.6" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.6.tgz#7197d7eaa9b87e648390ea61fc66c84427420df9" +brace-expansion@^1.0.0, brace-expansion@^1.1.7: + version "1.1.8" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.8.tgz#c07b211c7c952ec1f8efd51a77ef0d1d3990a292" dependencies: - balanced-match "^0.4.1" + balanced-match "^1.0.0" concat-map "0.0.1" braces@^0.1.2: @@ -635,7 +715,17 @@ browser-pack@^3.2.0: through2 "~0.5.1" umd "^2.1.0" -browser-resolve@^1.3.0, browser-resolve@^1.7.0: +browser-pack@^6.0.1: + version "6.0.2" + resolved "https://registry.yarnpkg.com/browser-pack/-/browser-pack-6.0.2.tgz#f86cd6cef4f5300c8e63e07a4d512f65fbff4531" + dependencies: + JSONStream "^1.0.3" + combine-source-map "~0.7.1" + defined "^1.0.0" + through2 "^2.0.0" + umd "^3.0.0" + +browser-resolve@^1.11.0, browser-resolve@^1.3.0, browser-resolve@^1.7.0: version "1.11.2" resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.2.tgz#8ff09b0a2c421718a1051c260b32e48f442938ce" dependencies: @@ -692,6 +782,64 @@ browserify-zlib@~0.1.2: dependencies: pako "~0.2.0" +browserify-zlib@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/browserify-zlib/-/browserify-zlib-0.2.0.tgz#2869459d9aa3be245fe8fe2ca1f46e2e7f54d73f" + dependencies: + pako "~1.0.5" + +browserify@^14.5.0: + version "14.5.0" + resolved "https://registry.yarnpkg.com/browserify/-/browserify-14.5.0.tgz#0bbbce521acd6e4d1d54d8e9365008efb85a9cc5" + dependencies: + JSONStream "^1.0.3" + assert "^1.4.0" + browser-pack "^6.0.1" + browser-resolve "^1.11.0" + browserify-zlib "~0.2.0" + buffer "^5.0.2" + cached-path-relative "^1.0.0" + concat-stream "~1.5.1" + console-browserify "^1.1.0" + constants-browserify "~1.0.0" + crypto-browserify "^3.0.0" + defined "^1.0.0" + deps-sort "^2.0.0" + domain-browser "~1.1.0" + duplexer2 "~0.1.2" + events "~1.1.0" + glob "^7.1.0" + has "^1.0.0" + htmlescape "^1.1.0" + https-browserify "^1.0.0" + inherits "~2.0.1" + insert-module-globals "^7.0.0" + labeled-stream-splicer "^2.0.0" + module-deps "^4.0.8" + os-browserify "~0.3.0" + parents "^1.0.1" + path-browserify "~0.0.0" + process "~0.11.0" + punycode "^1.3.2" + querystring-es3 "~0.2.0" + read-only-stream "^2.0.0" + readable-stream "^2.0.2" + resolve "^1.1.4" + shasum "^1.0.0" + shell-quote "^1.6.1" + stream-browserify "^2.0.0" + stream-http "^2.0.0" + string_decoder "~1.0.0" + subarg "^1.0.0" + syntax-error "^1.1.1" + through2 "^2.0.0" + timers-browserify "^1.0.1" + tty-browserify "~0.0.0" + url "~0.11.0" + util "~0.10.1" + vm-browserify "~0.0.1" + xtend "^4.0.0" + browserify@~7.0.0: version "7.0.3" resolved "https://registry.yarnpkg.com/browserify/-/browserify-7.0.3.tgz#b839f84ed22c24b67f79af68002e5684c73d534e" @@ -784,6 +932,13 @@ buffer@^2.3.0: ieee754 "^1.1.4" is-array "^1.0.1" +buffer@^5.0.2: + version "5.0.8" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.0.8.tgz#84daa52e7cf2fa8ce4195bc5cf0f7809e0930b24" + dependencies: + base64-js "^1.0.2" + ieee754 "^1.1.4" + buffers@~0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/buffers/-/buffers-0.1.1.tgz#b24579c3bed4d6d396aeee6d9a8ae7f5482ab7bb" @@ -794,17 +949,37 @@ bufferstreams@^1.1.1: dependencies: readable-stream "^2.0.2" +buildmail@4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/buildmail/-/buildmail-4.0.1.tgz#877f7738b78729871c9a105e3b837d2be11a7a72" + dependencies: + addressparser "1.0.1" + libbase64 "0.1.0" + libmime "3.0.0" + libqp "1.1.0" + nodemailer-fetch "1.6.0" + nodemailer-shared "1.1.0" + punycode "1.4.1" + builtin-modules@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" +builtin-status-codes@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" + builtins@~0.0.3: version "0.0.7" resolved "https://registry.yarnpkg.com/builtins/-/builtins-0.0.7.tgz#355219cd6cf18dbe7c01cc7fd2dce765cfdc549a" -bytes@2.4.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/bytes/-/bytes-2.4.0.tgz#7d97196f9d5baf7f6935e25985549edd2a6c2339" +bytes@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" + +cached-path-relative@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/cached-path-relative/-/cached-path-relative-1.0.1.tgz#d09c4b52800aa4c078e2dd81a869aac90d2e54e7" cachedir@^1.1.0: version "1.1.1" @@ -862,6 +1037,10 @@ caseless@~0.11.0: version "0.11.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.11.0.tgz#715b96ea9841593cc33067923f5ec60ebda4f7d7" +caseless@~0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" + caseless@~0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.6.0.tgz#8167c1ab8397fb5bb95f96d28e5a81c50f247ac4" @@ -973,7 +1152,22 @@ chmodr@0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/chmodr/-/chmodr-0.1.0.tgz#e09215a1d51542db2a2576969765bcf6125583eb" -chokidar@^1.4.1, chokidar@^1.6.0: +chokidar@^1.4.1: + version "1.7.0" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" + dependencies: + anymatch "^1.3.0" + async-each "^1.0.0" + glob-parent "^2.0.0" + inherits "^2.0.1" + is-binary-path "^1.0.0" + is-glob "^2.0.0" + path-is-absolute "^1.0.0" + readdirp "^2.0.0" + optionalDependencies: + fsevents "^1.0.0" + +chokidar@^1.6.0: version "1.6.1" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.6.1.tgz#2f4447ab5e96e50fb3d789fd90d4c72e0e4c70c2" dependencies: @@ -998,6 +1192,10 @@ circular-json@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.1.tgz#be8b36aefccde8b3ca7aa2d6afc07a37242c0d2d" +circular-json@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.4.0.tgz#c448ea998b7fe31ecf472ec29c6b608e2e2a62fd" + cli-color@~0.3.2: version "0.3.3" resolved "https://registry.yarnpkg.com/cli-color/-/cli-color-0.3.3.tgz#12d5bdd158ff8a0b0db401198913c03df069f6f5" @@ -1065,6 +1263,10 @@ co@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" +co@~3.0.6: + version "3.0.6" + resolved "https://registry.yarnpkg.com/co/-/co-3.0.6.tgz#1445f226c5eb956138e68c9ac30167ea7d2e6bda" + code-point-at@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" @@ -1116,6 +1318,15 @@ combine-source-map@~0.6.1: lodash.memoize "~3.0.3" source-map "~0.4.2" +combine-source-map@~0.7.1: + version "0.7.2" + resolved "https://registry.yarnpkg.com/combine-source-map/-/combine-source-map-0.7.2.tgz#0870312856b307a87cc4ac486f3a9a62aeccc09e" + dependencies: + convert-source-map "~1.1.0" + inline-source-map "~0.6.0" + lodash.memoize "~3.0.3" + source-map "~0.5.3" + combined-stream@^1.0.5, combined-stream@~1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.5.tgz#938370a57b4a51dea2c77c15d5c5fdf895164009" @@ -1136,12 +1347,16 @@ commander@2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.3.0.tgz#fd430e889832ec353b9acd1de217c11cb3eef873" -commander@>=1.1, commander@^2.9.0: +commander@>=1.1: version "2.9.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" dependencies: graceful-readlink ">= 1.0.0" +commander@^2.9.0: + version "2.12.2" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.12.2.tgz#0f5946c427ed9ec0d91a46bb9def53e54650e555" + commitizen@^2.3.0: version "2.9.5" resolved "https://registry.yarnpkg.com/commitizen/-/commitizen-2.9.5.tgz#f9605c8c1170eef86331676b5b5f12ab595bf498" @@ -1180,10 +1395,6 @@ component-bind@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/component-bind/-/component-bind-1.0.0.tgz#00c608ab7dcd93897c0009651b1d3a8e1e73bbd1" -component-emitter@1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.1.2.tgz#296594f2753daa63996d2af08d15a95116c9aec3" - component-emitter@1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" @@ -1213,6 +1424,14 @@ concat-stream@^1.4.6, concat-stream@^1.4.7, concat-stream@~1.4.1, concat-stream@ readable-stream "~1.1.9" typedarray "~0.0.5" +concat-stream@~1.5.0, concat-stream@~1.5.1: + version "1.5.2" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.5.2.tgz#708978624d856af41a5a741defdd261da752c266" + dependencies: + inherits "~2.0.1" + readable-stream "~2.0.0" + typedarray "~0.0.5" + concat-with-sourcemaps@^1.0.0: version "1.0.4" resolved "https://registry.yarnpkg.com/concat-with-sourcemaps/-/concat-with-sourcemaps-1.0.4.tgz#f55b3be2aeb47601b10a2d5259ccfb70fd2f1dd6" @@ -1253,13 +1472,13 @@ connect@^3.4.0: utils-merge "1.0.0" connect@^3.6.0: - version "3.6.1" - resolved "https://registry.yarnpkg.com/connect/-/connect-3.6.1.tgz#b7760693a74f0454face1d9378edb3f885b43227" + version "3.6.5" + resolved "https://registry.yarnpkg.com/connect/-/connect-3.6.5.tgz#fb8dde7ba0763877d0ec9df9dac0b4b40e72c7da" dependencies: - debug "2.6.3" - finalhandler "1.0.1" - parseurl "~1.3.1" - utils-merge "1.0.0" + debug "2.6.9" + finalhandler "1.0.6" + parseurl "~1.3.2" + utils-merge "1.0.1" console-browserify@^1.1.0: version "1.1.0" @@ -1282,13 +1501,17 @@ constants-browserify@~0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-0.0.1.tgz#92577db527ba6c4cf0a4568d84bc031f441e21f2" +constants-browserify@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" + content-disposition@0.5.2: version "0.5.2" resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.2.tgz#0cf68bb9ddf5f2be7961c3a85178cb85dba78cb4" -content-type@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.2.tgz#b7d113aee7a8dd27bd21133c4dc2529df1721eed" +content-type@~1.0.2, content-type@~1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" conventional-commit-types@^2.0.0: version "2.1.0" @@ -1315,10 +1538,10 @@ cookie@0.3.1: resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb" core-js@^2.2.0: - version "2.4.1" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.4.1.tgz#4de911e667b0eae9124e34254b53aea6fc618d3e" + version "2.5.3" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.3.tgz#8acc38345824f16d8365b7c9b4259168e8ed603e" -core-util-is@~1.0.0: +core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" @@ -1383,6 +1606,12 @@ cryptiles@2.x.x: dependencies: boom "2.x.x" +cryptiles@3.x.x: + version "3.1.2" + resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-3.1.2.tgz#a89fbb220f5ce25ec56e8c4aa8a4fd7b5b0d29fe" + dependencies: + boom "5.x.x" + crypto-browserify@^3.0.0: version "3.11.0" resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.11.0.tgz#3652a0906ab9b2a7e0c3ce66a408e957a2485522" @@ -1454,6 +1683,14 @@ dashdash@^1.12.0: dependencies: assert-plus "^1.0.0" +data-uri-to-buffer@1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-1.2.0.tgz#77163ea9c20d8641b4707e8f18abdf9a78f34835" + +date-format@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/date-format/-/date-format-1.2.0.tgz#615e828e233dd1ab9bb9ae0950e0ceccfa6ecad8" + date-now@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" @@ -1481,7 +1718,7 @@ debug-fabulous@0.0.X: lazy-debug-legacy "0.0.X" object-assign "4.1.0" -debug@2, debug@2.6.3: +debug@2: version "2.6.3" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.3.tgz#0f7eb8c30965ec08c72accfa0130c8b79984141d" dependencies: @@ -1493,23 +1730,23 @@ debug@2.2.0, debug@~2.2.0: dependencies: ms "0.7.1" -debug@2.3.3: - version "2.3.3" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.3.3.tgz#40c453e67e6e13c901ddec317af8986cda9eff8c" - dependencies: - ms "0.7.2" - debug@2.6.0, debug@2.X, debug@^2.1.1: version "2.6.0" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.0.tgz#bc596bcabe7617f11d9fa15361eded5608b8499b" dependencies: ms "0.7.2" -debug@2.6.1: - version "2.6.1" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.1.tgz#79855090ba2c4e3115cc7d8769491d58f0491351" +debug@2.6.9, debug@^2.2.0, debug@~2.6.4, debug@~2.6.6, debug@~2.6.9: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" dependencies: - ms "0.7.2" + ms "2.0.0" + +debug@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" + dependencies: + ms "2.0.0" decamelize@^1.0.0, decamelize@^1.1.1, decamelize@^1.1.2: version "1.2.0" @@ -1540,8 +1777,8 @@ deep-extend@~0.2.5: resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.2.11.tgz#7a16ba69729132340506170494bc83f7076fe08f" deep-extend@~0.4.0: - version "0.4.1" - resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.1.tgz#efe4113d08085f4e6f9687759810f807469e2253" + version "0.4.2" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.2.tgz#48b699c27e334bf89f10892be432f6e4c7d34a7f" deep-is@~0.1.3: version "0.1.3" @@ -1561,6 +1798,14 @@ defined@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/defined/-/defined-0.0.0.tgz#f35eea7d705e933baf13b2f03b3f83d921403b3e" +degenerator@~1.0.2: + version "1.0.4" + resolved "https://registry.yarnpkg.com/degenerator/-/degenerator-1.0.4.tgz#fcf490a37ece266464d9cc431ab98c5819ced095" + dependencies: + ast-types "0.x.x" + escodegen "1.x.x" + esprima "3.x.x" + del@^2.0.2, del@^2.2.0: version "2.2.2" resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8" @@ -1585,9 +1830,9 @@ delegates@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" -depd@1.1.0, depd@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.0.tgz#e1bd82c6aab6ced965b97b88b17ed3e528ca18c3" +depd@1.1.1, depd@~1.1.0, depd@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.1.tgz#5783b4e1c459f06fa5ca27f991f3d06e7a310359" dependency-graph@~0.4.1: version "0.4.1" @@ -1606,6 +1851,15 @@ deps-sort@^1.3.5: subarg "^1.0.0" through2 "^1.0.0" +deps-sort@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/deps-sort/-/deps-sort-2.0.0.tgz#091724902e84658260eb910748cccd1af6e21fb5" + dependencies: + JSONStream "^1.0.3" + shasum "^1.0.0" + subarg "^1.0.0" + through2 "^2.0.0" + des.js@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.0.tgz#c074d2e2aa6a8a9a07dbd61f9a15c2cd83ec8ecc" @@ -1629,6 +1883,10 @@ detect-indent@4.0.0: dependencies: repeating "^2.0.0" +detect-libc@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" + detect-newline@2.X: version "2.1.0" resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-2.1.0.tgz#f41f1c10be4b00e87b5f13da680759f2c5bfd3e2" @@ -1757,12 +2015,22 @@ dot-case@^2.1.0: dependencies: no-case "^2.2.0" +double-ended-queue@^2.1.0-0: + version "2.1.0-0" + resolved "https://registry.yarnpkg.com/double-ended-queue/-/double-ended-queue-2.1.0-0.tgz#103d3527fd31528f40188130c841efdd78264e5c" + duplexer2@0.0.2, duplexer2@~0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.0.2.tgz#c614dcf67e2fb14995a91711e5a617e8a60a31db" dependencies: readable-stream "~1.1.9" +duplexer2@^0.1.2, duplexer2@~0.1.0, duplexer2@~0.1.2: + version "0.1.4" + resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.1.4.tgz#8b12dab878c0d69e3e7891051662a32fc6bddcc1" + dependencies: + readable-stream "^2.0.2" + duplexer@~0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1" @@ -1802,44 +2070,44 @@ end-of-stream@~0.1.5: dependencies: once "~1.3.0" -engine.io-client@1.8.3: - version "1.8.3" - resolved "https://registry.yarnpkg.com/engine.io-client/-/engine.io-client-1.8.3.tgz#1798ed93451246453d4c6f635d7a201fe940d5ab" +engine.io-client@~3.1.0: + version "3.1.4" + resolved "https://registry.yarnpkg.com/engine.io-client/-/engine.io-client-3.1.4.tgz#4fcf1370b47163bd2ce9be2733972430350d4ea1" dependencies: component-emitter "1.2.1" component-inherit "0.0.3" - debug "2.3.3" - engine.io-parser "1.3.2" + debug "~2.6.9" + engine.io-parser "~2.1.1" has-cors "1.1.0" indexof "0.0.1" - parsejson "0.0.3" parseqs "0.0.5" parseuri "0.0.5" - ws "1.1.2" - xmlhttprequest-ssl "1.5.3" + ws "~3.3.1" + xmlhttprequest-ssl "~1.5.4" yeast "0.1.2" -engine.io-parser@1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/engine.io-parser/-/engine.io-parser-1.3.2.tgz#937b079f0007d0893ec56d46cb220b8cb435220a" +engine.io-parser@~2.1.0, engine.io-parser@~2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/engine.io-parser/-/engine.io-parser-2.1.2.tgz#4c0f4cff79aaeecbbdcfdea66a823c6085409196" dependencies: after "0.8.2" - arraybuffer.slice "0.0.6" + arraybuffer.slice "~0.0.7" base64-arraybuffer "0.1.5" blob "0.0.4" - has-binary "0.1.7" - wtf-8 "1.0.0" + has-binary2 "~1.0.2" -engine.io@1.8.3: - version "1.8.3" - resolved "https://registry.yarnpkg.com/engine.io/-/engine.io-1.8.3.tgz#8de7f97895d20d39b85f88eeee777b2bd42b13d4" +engine.io@~3.1.0: + version "3.1.4" + resolved "https://registry.yarnpkg.com/engine.io/-/engine.io-3.1.4.tgz#3d0211b70a552ce841ffc7da8627b301a9a4162e" dependencies: accepts "1.3.3" base64id "1.0.0" cookie "0.3.1" - debug "2.3.3" - engine.io-parser "1.3.2" - ws "1.1.2" + debug "~2.6.9" + engine.io-parser "~2.1.0" + ws "~3.3.1" + optionalDependencies: + uws "~0.14.4" ent@~2.2.0: version "2.2.0" @@ -1951,6 +2219,17 @@ escape-string-regexp@^1.0.0, escape-string-regexp@^1.0.2, escape-string-regexp@^ version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" +escodegen@1.x.x: + version "1.9.0" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.9.0.tgz#9811a2f265dc1cd3894420ee3717064b632b8852" + dependencies: + esprima "^3.1.3" + estraverse "^4.2.0" + esutils "^2.0.2" + optionator "^0.8.1" + optionalDependencies: + source-map "~0.5.6" + escope@^3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/escope/-/escope-3.6.0.tgz#e01975e812781a163a6dadfdd80398dc64c889c3" @@ -2010,6 +2289,10 @@ espree@^3.4.0: acorn "4.0.4" acorn-jsx "^3.0.0" +esprima@3.x.x, esprima@^3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" + esprima@^2.6.0: version "2.7.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" @@ -2072,6 +2355,10 @@ events@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/events/-/events-1.0.2.tgz#75849dcfe93d10fb057c30055afdbd51d06a8e24" +events@~1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924" + evp_bytestokey@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.0.tgz#497b66ad9fef65cd7c08a6180824ba1476b66e53" @@ -2150,10 +2437,14 @@ express@^4.8.6: utils-merge "1.0.0" vary "~1.1.0" -extend@3, extend@^3.0.0, extend@~3.0.0: +extend@3: version "3.0.0" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.0.tgz#5a474353b9f3353ddd8176dfd37b91c83a46f1d4" +extend@^3.0.0, extend@~3.0.0, extend@~3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" + external-editor@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-1.1.1.tgz#12d7b0db850f7ff7e7081baf4005700060c4600b" @@ -2168,9 +2459,13 @@ extglob@^0.3.1: dependencies: is-extglob "^1.0.0" -extsprintf@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.0.2.tgz#e1080e0658e300b06294990cc70e1502235fd550" +extsprintf@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" + +extsprintf@^1.2.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" eyes@0.1.x: version "0.1.8" @@ -2183,6 +2478,14 @@ fancy-log@^1.0.0, fancy-log@^1.1.0: chalk "^1.1.1" time-stamp "^1.0.0" +fast-deep-equal@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz#96256a3bc975595eb36d82e9929d060d893439ff" + +fast-json-stable-stringify@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" + fast-levenshtein@~2.0.4: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" @@ -2205,9 +2508,13 @@ file-sync-cmp@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/file-sync-cmp/-/file-sync-cmp-0.1.1.tgz#a5e7a8ffbfa493b43b923bbd4ca89a53b63b612b" +file-uri-to-path@1: + version "1.0.0" + resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" + filename-regex@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.0.tgz#996e3e80479b98b9897f15a8a58b3d084e926775" + version "2.0.1" + resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" fill-range@^2.1.0: version "2.2.3" @@ -2239,15 +2546,15 @@ finalhandler@0.5.1: statuses "~1.3.1" unpipe "~1.0.0" -finalhandler@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.0.1.tgz#bcd15d1689c0e5ed729b6f7f541a6df984117db8" +finalhandler@1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.0.6.tgz#007aea33d1a4d3e42017f624848ad58d212f814f" dependencies: - debug "2.6.3" + debug "2.6.9" encodeurl "~1.0.1" escape-html "~1.0.3" on-finished "~2.3.0" - parseurl "~1.3.1" + parseurl "~1.3.2" statuses "~1.3.1" unpipe "~1.0.0" @@ -2323,15 +2630,21 @@ flat-cache@^1.2.1: graceful-fs "^4.1.2" write "^0.2.1" -for-in@^0.1.5: - version "0.1.6" - resolved "https://registry.yarnpkg.com/for-in/-/for-in-0.1.6.tgz#c9f96e89bfad18a545af5ec3ed352a1d9e5b4dc8" +follow-redirects@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.0.0.tgz#8e34298cbd2e176f254effec75a1c78cc849fd37" + dependencies: + debug "^2.2.0" + +for-in@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" for-own@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.4.tgz#0149b41a39088c7515f51ebe1c1386d45f935072" + version "0.1.5" + resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" dependencies: - for-in "^0.1.5" + for-in "^1.0.1" forever-agent@~0.5.0: version "0.5.2" @@ -2357,9 +2670,25 @@ form-data@~0.2.0: combined-stream "~0.0.4" mime-types "~2.0.3" +form-data@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.0.0.tgz#6f0aebadcc5da16c13e1ecc11137d85f9b883b25" + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.5" + mime-types "^2.1.11" + form-data@~2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.1.2.tgz#89c3534008b97eada4cbb157d58f6f5df025eae4" + version "2.1.4" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.1.4.tgz#33c183acf193276ecaa98143a69e94bfee1750d1" + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.5" + mime-types "^2.1.12" + +form-data@~2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.1.tgz#6fb94fbd71885306d73d15cc497fe4cc4ecd44bf" dependencies: asynckit "^0.4.0" combined-stream "^1.0.5" @@ -2406,13 +2735,13 @@ fs.realpath@^1.0.0: resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" fsevents@^1.0.0: - version "1.0.17" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.0.17.tgz#8537f3f12272678765b4fd6528c0f1f66f8f4558" + version "1.1.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.1.3.tgz#11f82318f5fe7bb2cd22965a108e9306208216d8" dependencies: nan "^2.3.0" - node-pre-gyp "^0.6.29" + node-pre-gyp "^0.6.39" -fstream-ignore@~1.0.1, fstream-ignore@~1.0.5: +fstream-ignore@^1.0.5, fstream-ignore@~1.0.1: version "1.0.5" resolved "https://registry.yarnpkg.com/fstream-ignore/-/fstream-ignore-1.0.5.tgz#9c31dae34767018fe1d249b24dada67d092da105" dependencies: @@ -2429,7 +2758,16 @@ fstream-ignore@~1.0.1, fstream-ignore@~1.0.5: mkdirp "0.5" rimraf "2" -fstream@^1.0.0, fstream@^1.0.2, fstream@~1.0.10, fstream@~1.0.2: +fstream@^1.0.0, fstream@^1.0.10, fstream@^1.0.2: + version "1.0.11" + resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.11.tgz#5c1fb1f117477114f0632a0eb4b71b3cb0fd3171" + dependencies: + graceful-fs "^4.1.2" + inherits "~2.0.0" + mkdirp ">=0.5 0" + rimraf "2" + +fstream@~1.0.2: version "1.0.10" resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.10.tgz#604e8a92fe26ffd9f6fae30399d4984e1ab22822" dependencies: @@ -2438,9 +2776,20 @@ fstream@^1.0.0, fstream@^1.0.2, fstream@~1.0.10, fstream@~1.0.2: mkdirp ">=0.5 0" rimraf "2" -gauge@~2.7.1: - version "2.7.3" - resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.3.tgz#1c23855f962f17b3ad3d0dc7443f304542edfe09" +ftp@~0.3.10: + version "0.3.10" + resolved "https://registry.yarnpkg.com/ftp/-/ftp-0.3.10.tgz#9197d861ad8142f3e63d5a83bfe4c59f7330885d" + dependencies: + readable-stream "1.1.x" + xregexp "2.0.0" + +function-bind@^1.0.2: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + +gauge@~2.7.3: + version "2.7.4" + resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" dependencies: aproba "^1.0.3" console-control-strings "^1.0.0" @@ -2471,13 +2820,24 @@ get-stdin@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe" +get-uri@2: + version "2.0.1" + resolved "https://registry.yarnpkg.com/get-uri/-/get-uri-2.0.1.tgz#dbdcacacd8c608a38316869368117697a1631c59" + dependencies: + data-uri-to-buffer "1" + debug "2" + extend "3" + file-uri-to-path "1" + ftp "~0.3.10" + readable-stream "2" + getobject@~0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/getobject/-/getobject-0.1.0.tgz#047a449789fa160d018f5486ed91320b6ec7885c" getpass@^0.1.1: - version "0.1.6" - resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.6.tgz#283ffd9fc1256840875311c1b60e8c40187110e6" + version "0.1.7" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" dependencies: assert-plus "^1.0.0" @@ -2530,7 +2890,7 @@ glob@3.2.11: inherits "2" minimatch "0.3" -glob@7.1.1, glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.0.6, glob@^7.1.1: +glob@7.1.1, glob@^7.0.0, glob@^7.0.3, glob@^7.0.6: version "7.1.1" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8" dependencies: @@ -2569,12 +2929,23 @@ glob@^6.0.1: once "^1.3.0" path-is-absolute "^1.0.0" -glob@~3.1.21: - version "3.1.21" - resolved "https://registry.yarnpkg.com/glob/-/glob-3.1.21.tgz#d29e0a055dea5138f4d07ed40e8982e83c2066cd" +glob@^7.0.5, glob@^7.1.0, glob@^7.1.1: + version "7.1.2" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" dependencies: - graceful-fs "~1.2.0" - inherits "1" + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@~3.1.21: + version "3.1.21" + resolved "https://registry.yarnpkg.com/glob/-/glob-3.1.21.tgz#d29e0a055dea5138f4d07ed40e8982e83c2066cd" + dependencies: + graceful-fs "~1.2.0" + inherits "1" minimatch "~0.2.11" glob@~5.0.0: @@ -2941,6 +3312,14 @@ handlebars@~2.0.0: optionalDependencies: uglify-js "~2.3" +har-schema@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-1.0.5.tgz#d263135f43307c02c602afc8fe95970c0151369e" + +har-schema@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" + har-validator@~2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-2.0.6.tgz#cdcbc08188265ad119b6a5a7c8ab70eecfb5d27d" @@ -2950,6 +3329,20 @@ har-validator@~2.0.6: is-my-json-valid "^2.12.4" pinkie-promise "^2.0.0" +har-validator@~4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-4.2.1.tgz#33481d0f1bbff600dd203d75812a6a5fba002e2a" + dependencies: + ajv "^4.9.1" + har-schema "^1.0.5" + +har-validator@~5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.0.3.tgz#ba402c266194f15956ef15e0fcf242993f6a7dfd" + dependencies: + ajv "^5.1.0" + har-schema "^2.0.0" + has-ansi@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-0.1.0.tgz#84f265aae8c0e6a88a12d7022894b7568894c62e" @@ -2962,11 +3355,11 @@ has-ansi@^2.0.0: dependencies: ansi-regex "^2.0.0" -has-binary@0.1.7: - version "0.1.7" - resolved "https://registry.yarnpkg.com/has-binary/-/has-binary-0.1.7.tgz#68e61eb16210c9545a0a5cce06a873912fe1e68c" +has-binary2@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-binary2/-/has-binary2-1.0.2.tgz#e83dba49f0b9be4d026d27365350d9f03f54be98" dependencies: - isarray "0.0.1" + isarray "2.0.1" has-cors@1.1.0: version "1.1.0" @@ -2982,6 +3375,12 @@ has-unicode@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" +has@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28" + dependencies: + function-bind "^1.0.2" + hash.js@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.0.3.tgz#1332ff00156c0a0ffdd8236013d07b77a0451573" @@ -2997,7 +3396,7 @@ hawk@1.1.1: hoek "0.9.x" sntp "0.2.x" -hawk@~3.1.3: +hawk@3.1.3, hawk@~3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/hawk/-/hawk-3.1.3.tgz#078444bd7c1640b0fe540d2c9b73d59678e8e1c4" dependencies: @@ -3006,6 +3405,15 @@ hawk@~3.1.3: hoek "2.x.x" sntp "1.x.x" +hawk@~6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/hawk/-/hawk-6.0.2.tgz#af4d914eb065f9b5ce4d9d11c1cb2126eecc3038" + dependencies: + boom "4.x.x" + cryptiles "3.x.x" + hoek "4.x.x" + sntp "2.x.x" + header-case@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/header-case/-/header-case-1.0.0.tgz#d9e335909505d56051ec16a0106821889e910781" @@ -3013,6 +3421,13 @@ header-case@^1.0.0: no-case "^2.2.0" upper-case "^1.1.3" +hipchat-notifier@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/hipchat-notifier/-/hipchat-notifier-1.1.0.tgz#b6d249755437c191082367799d3ba9a0f23b231e" + dependencies: + lodash "^4.0.0" + request "^2.0.0" + hoek@0.9.x: version "0.9.1" resolved "https://registry.yarnpkg.com/hoek/-/hoek-0.9.1.tgz#3d322462badf07716ea7eb85baf88079cddce505" @@ -3021,6 +3436,10 @@ hoek@2.x.x: version "2.16.3" resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed" +hoek@4.x.x: + version "4.2.0" + resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.0.tgz#72d9d0754f7fe25ca2d01ad8f8f9a9449a89526d" + homedir-polyfill@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz#4c2bbc8a758998feebf5ed68580f76d46768b4bc" @@ -3035,6 +3454,10 @@ hosted-git-info@^2.1.4: version "2.2.0" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.2.0.tgz#7a0d097863d886c0fabbdcd37bf1758d8becf8a5" +htmlescape@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/htmlescape/-/htmlescape-1.1.1.tgz#3a03edc2214bca3b66424a3e7959349509cb0351" + htmlparser2@^3.7.3, htmlparser2@~3.7.2: version "3.7.3" resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.7.3.tgz#6a64c77637c08c6f30ec2a8157a53333be7cb05e" @@ -3052,6 +3475,15 @@ http-browserify@^1.4.0: Base64 "~0.2.0" inherits "~2.0.1" +http-errors@1.6.2, http-errors@~1.6.2: + version "1.6.2" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.2.tgz#0a002cc85707192a7e7946ceedc11155f60ec736" + dependencies: + depd "1.1.1" + inherits "2.0.3" + setprototypeof "1.0.3" + statuses ">= 1.3.1 < 2" + http-errors@~1.5.0, http-errors@~1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.5.1.tgz#788c0d2c1de2c81b9e6e8c01843b6b97eb920750" @@ -3060,14 +3492,13 @@ http-errors@~1.5.0, http-errors@~1.5.1: setprototypeof "1.0.2" statuses ">= 1.3.1 < 2" -http-errors@~1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.1.tgz#5f8b8ed98aca545656bf572997387f904a722257" +http-proxy-agent@1: + version "1.0.0" + resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-1.0.0.tgz#cc1ce38e453bf984a0f7702d2dd59c73d081284a" dependencies: - depd "1.1.0" - inherits "2.0.3" - setprototypeof "1.0.3" - statuses ">= 1.3.1 < 2" + agent-base "2" + debug "2" + extend "3" http-proxy@^1.13.0: version "1.16.2" @@ -3092,15 +3523,38 @@ http-signature@~1.1.0: jsprim "^1.2.2" sshpk "^1.7.0" +http-signature@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" + dependencies: + assert-plus "^1.0.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + http2@^3.3.4: version "3.3.6" resolved "https://registry.yarnpkg.com/http2/-/http2-3.3.6.tgz#7df06227e02b5b5a5841deea08239b3198d04bec" +httpntlm@1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/httpntlm/-/httpntlm-1.6.1.tgz#ad01527143a2e8773cfae6a96f58656bb52a34b2" + dependencies: + httpreq ">=0.4.22" + underscore "~1.7.0" + +httpreq@>=0.4.22: + version "0.4.24" + resolved "https://registry.yarnpkg.com/httpreq/-/httpreq-0.4.24.tgz#4335ffd82cd969668a39465c929ac61d6393627f" + +https-browserify@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" + https-browserify@~0.0.0: version "0.0.1" resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-0.0.1.tgz#3f91365cabe60b77ed0ebba24b454e3e09d95a82" -https-proxy-agent@1.0.0, https-proxy-agent@^1.0.0, https-proxy-agent@~1.0.0: +https-proxy-agent@1, https-proxy-agent@1.0.0, https-proxy-agent@^1.0.0, https-proxy-agent@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-1.0.0.tgz#35f7da6c48ce4ddbfa264891ac593ee5ff8671e6" dependencies: @@ -3112,6 +3566,10 @@ iconv-lite@0.4.15, iconv-lite@~0.4.13: version "0.4.15" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.15.tgz#fe265a218ac6a57cfe854927e9d04c19825eddeb" +iconv-lite@0.4.19: + version "0.4.19" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b" + ieee754@^1.1.4: version "1.1.8" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.8.tgz#be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4" @@ -3140,6 +3598,14 @@ indexof@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" +inflection@~1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/inflection/-/inflection-1.10.0.tgz#5bffcb1197ad3e81050f8e17e21668087ee9eb2f" + +inflection@~1.3.0: + version "1.3.8" + resolved "https://registry.yarnpkg.com/inflection/-/inflection-1.3.8.tgz#cbd160da9f75b14c3cc63578d4f396784bf3014e" + inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -3151,7 +3617,7 @@ inherits@1: version "1.0.2" resolved "https://registry.yarnpkg.com/inherits/-/inherits-1.0.2.tgz#ca4309dadee6b54cc0b8d247e8d7c7a0975bdc9b" -inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@~2.0.0, inherits@~2.0.1: +inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@~2.0.0, inherits@~2.0.1, inherits@~2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" @@ -3159,10 +3625,14 @@ inherits@2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" -ini@^1.2.0, ini@^1.3.4, ini@~1.3.0: +ini@^1.2.0, ini@^1.3.4: version "1.3.4" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.4.tgz#0537cb79daf59b59a1a517dff706c86ec039162e" +ini@~1.3.0: + version "1.3.5" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" + inline-source-map@~0.3.0: version "0.3.1" resolved "https://registry.yarnpkg.com/inline-source-map/-/inline-source-map-0.3.1.tgz#a528b514e689fce90db3089e870d92f527acb5eb" @@ -3175,6 +3645,12 @@ inline-source-map@~0.5.0: dependencies: source-map "~0.4.0" +inline-source-map@~0.6.0: + version "0.6.2" + resolved "https://registry.yarnpkg.com/inline-source-map/-/inline-source-map-0.6.2.tgz#f9393471c18a79d1724f863fa38b586370ade2a5" + dependencies: + source-map "~0.5.3" + inquirer@0.7.1: version "0.7.1" resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-0.7.1.tgz#b8acf140165bd581862ed1198fb6d26430091fac" @@ -3250,6 +3726,19 @@ insert-module-globals@^6.1.0: through2 "^1.0.0" xtend "^4.0.0" +insert-module-globals@^7.0.0: + version "7.0.1" + resolved "https://registry.yarnpkg.com/insert-module-globals/-/insert-module-globals-7.0.1.tgz#c03bf4e01cb086d5b5e5ace8ad0afe7889d638c3" + dependencies: + JSONStream "^1.0.3" + combine-source-map "~0.7.1" + concat-stream "~1.5.1" + is-buffer "^1.1.0" + lexical-scope "^1.2.0" + process "~0.11.0" + through2 "^2.0.0" + xtend "^4.0.0" + insight@0.4.3: version "0.4.3" resolved "https://registry.yarnpkg.com/insight/-/insight-0.4.3.tgz#76d653c5c0d8048b03cdba6385a6948f74614af0" @@ -3280,6 +3769,14 @@ invert-kv@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" +ip@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/ip/-/ip-1.0.1.tgz#c7e356cdea225ae71b36d70f2e71a92ba4e42590" + +ip@^1.1.2, ip@^1.1.4: + version "1.1.5" + resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a" + ipaddr.js@1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.2.0.tgz#8aba49c9192799585bdd643e0ccb50e8ae777ba4" @@ -3305,10 +3802,14 @@ is-binary-path@^1.0.0: dependencies: binary-extensions "^1.0.0" -is-buffer@^1.0.2, is-buffer@^1.1.0: +is-buffer@^1.1.0: version "1.1.4" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.4.tgz#cfc86ccd5dc5a52fa80489111c6920c457e2d98b" +is-buffer@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + is-builtin-module@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" @@ -3316,8 +3817,8 @@ is-builtin-module@^1.0.0: builtin-modules "^1.0.0" is-dotfile@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.2.tgz#2c132383f39199f8edc268ca01b9b007d205cc4d" + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" is-equal-shallow@^0.1.3: version "0.1.3" @@ -3361,7 +3862,7 @@ is-lower-case@^1.1.0: dependencies: lower-case "^1.1.0" -is-my-json-valid@^2.10.0, is-my-json-valid@^2.12.4: +is-my-json-valid@^2.10.0: version "2.15.0" resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.15.0.tgz#936edda3ca3c211fd98f3b2d3e08da43f7b2915b" dependencies: @@ -3370,16 +3871,31 @@ is-my-json-valid@^2.10.0, is-my-json-valid@^2.12.4: jsonpointer "^4.0.0" xtend "^4.0.0" +is-my-json-valid@^2.12.4: + version "2.17.1" + resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.17.1.tgz#3da98914a70a22f0a8563ef1511a246c6fc55471" + dependencies: + generate-function "^2.0.0" + generate-object-property "^1.1.0" + jsonpointer "^4.0.0" + xtend "^4.0.0" + is-number@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/is-number/-/is-number-0.1.1.tgz#69a7af116963d47206ec9bd9b48a14216f1e3806" -is-number@^2.0.2, is-number@^2.1.0: +is-number@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" dependencies: kind-of "^3.0.2" +is-number@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + dependencies: + kind-of "^3.0.2" + is-path-cwd@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" @@ -3464,6 +3980,10 @@ isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" +isarray@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.1.tgz#a37d94ed9cda2d59865c9f76fe596ee1f338741e" + isbinaryfile@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/isbinaryfile/-/isbinaryfile-3.0.2.tgz#4a3e974ec0cba9004d3fc6cde7209ea69368a621" @@ -3535,12 +4055,6 @@ jasminewd2@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/jasminewd2/-/jasminewd2-2.1.0.tgz#da595275d1ae631de736ac0a7c7d85c9f73ef652" -jodid25519@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/jodid25519/-/jodid25519-1.0.2.tgz#06d4912255093419477d425633606e0e90782967" - dependencies: - jsbn "~0.1.0" - jquery@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.2.1.tgz#5c4d9de652af6cd0a770154a631bba12b015c787" @@ -3557,8 +4071,12 @@ js-yaml@^3.1.0, js-yaml@^3.5.1, js-yaml@~3.5.2: esprima "^2.6.0" jsbn@~0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.0.tgz#650987da0dd74f4ebf5a11377a2aa2d273e97dfd" + version "0.1.1" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + +json-schema-traverse@^0.3.0: + version "0.3.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" json-schema@0.2.3: version "0.2.3" @@ -3576,14 +4094,10 @@ json-stable-stringify@~0.0.0: dependencies: jsonify "~0.0.0" -json-stringify-safe@~5.0.0, json-stringify-safe@~5.0.1: +json-stringify-safe@5.0.x, json-stringify-safe@~5.0.0, json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" -json3@3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.2.tgz#3c0434743df93e2f5c42aee7b19bcb483575f4e1" - jsonfile@^2.1.0: version "2.4.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" @@ -3607,12 +4121,13 @@ jsonpointer@^4.0.0: resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9" jsprim@^1.2.2: - version "1.3.1" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.3.1.tgz#2a7256f70412a29ee3670aaca625994c4dcff252" + version "1.4.1" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" dependencies: - extsprintf "1.0.2" + assert-plus "1.0.0" + extsprintf "1.3.0" json-schema "0.2.3" - verror "1.3.6" + verror "1.10.0" junk@~1.0.0: version "1.0.3" @@ -3667,12 +4182,13 @@ karma-spec-reporter@^0.0.31: dependencies: colors "^1.1.2" -karma@^1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/karma/-/karma-1.7.0.tgz#6f7a1a406446fa2e187ec95398698f4cee476269" +karma@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/karma/-/karma-2.0.0.tgz#a02698dd7f0f05ff5eb66ab8f65582490b512e58" dependencies: bluebird "^3.3.0" body-parser "^1.16.1" + browserify "^14.5.0" chokidar "^1.4.1" colors "^1.1.0" combine-lists "^1.0.0" @@ -3685,8 +4201,8 @@ karma@^1.7.0: graceful-fs "^4.1.2" http-proxy "^1.13.0" isbinaryfile "^3.0.0" - lodash "^3.8.0" - log4js "^0.6.31" + lodash "^4.17.4" + log4js "^2.3.9" mime "^1.3.4" minimatch "^3.0.2" optimist "^0.6.1" @@ -3694,16 +4210,22 @@ karma@^1.7.0: range-parser "^1.2.0" rimraf "^2.6.0" safe-buffer "^5.0.1" - socket.io "1.7.3" - source-map "^0.5.3" - tmp "0.0.31" + socket.io "2.0.4" + source-map "^0.6.1" + tmp "0.0.33" useragent "^2.1.12" kind-of@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.1.0.tgz#475d698a5e49ff5e53d14e3e732429dc8bf4cf47" + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + dependencies: + is-buffer "^1.1.5" + +kind-of@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" dependencies: - is-buffer "^1.0.2" + is-buffer "^1.1.5" klaw@^1.0.0: version "1.3.1" @@ -3719,6 +4241,14 @@ labeled-stream-splicer@^1.0.0: isarray "~0.0.1" stream-splicer "^1.1.0" +labeled-stream-splicer@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/labeled-stream-splicer/-/labeled-stream-splicer-2.0.0.tgz#a52e1d138024c00b86b1c0c91f677918b8ae0a59" + dependencies: + inherits "^2.0.1" + isarray "~0.0.1" + stream-splicer "^2.0.0" + latest-version@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-0.2.0.tgz#adaf898d5f22380d3f9c45386efdff0a1b5b7501" @@ -3758,6 +4288,22 @@ lexical-scope@^1.2.0: dependencies: astw "^2.0.0" +libbase64@0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/libbase64/-/libbase64-0.1.0.tgz#62351a839563ac5ff5bd26f12f60e9830bb751e6" + +libmime@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/libmime/-/libmime-3.0.0.tgz#51a1a9e7448ecbd32cda54421675bb21bc093da6" + dependencies: + iconv-lite "0.4.15" + libbase64 "0.1.0" + libqp "1.1.0" + +libqp@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/libqp/-/libqp-1.1.0.tgz#f5e6e06ad74b794fb5b5b66988bf728ef1dedbe8" + liftoff@^2.0.1: version "2.3.0" resolved "https://registry.yarnpkg.com/liftoff/-/liftoff-2.3.0.tgz#a98f2ff67183d8ba7cfaca10548bd7ff0550b385" @@ -4025,14 +4571,18 @@ lodash@4.16.2: version "4.16.2" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.16.2.tgz#3e626db827048a699281a8a125226326cfc0e652" -lodash@4.17.2, lodash@^4.0.0, lodash@^4.13.1, lodash@^4.14.0, lodash@^4.16.6, lodash@^4.17.2, lodash@^4.3.0, lodash@^4.5.0, lodash@^4.7.0, lodash@^4.8.0: +lodash@4.17.2, lodash@^4.0.0, lodash@^4.13.1, lodash@^4.14.0, lodash@^4.16.6, lodash@^4.17.2, lodash@^4.3.0, lodash@^4.7.0, lodash@^4.8.0: version "4.17.2" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.2.tgz#34a3055babe04ce42467b607d700072c7ff6bf42" -lodash@^3.10.1, lodash@^3.8.0, lodash@~3.10.1: +lodash@^3.10.1, lodash@~3.10.1: version "3.10.1" resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6" +lodash@^4.15.0, lodash@^4.17.4, lodash@^4.5.0: + version "4.17.4" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" + lodash@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/lodash/-/lodash-1.0.2.tgz#8f57560c83b59fc270bd3d561b690043430e2551" @@ -4045,13 +4595,39 @@ lodash@~4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.3.0.tgz#efd9c4a6ec53f3b05412429915c3e4824e4d25a4" -log4js@^0.6.27, log4js@^0.6.31: +log4js@^0.6.27: version "0.6.38" resolved "https://registry.yarnpkg.com/log4js/-/log4js-0.6.38.tgz#2c494116695d6fb25480943d3fc872e662a522fd" dependencies: readable-stream "~1.0.2" semver "~4.3.3" +log4js@^2.3.9: + version "2.4.1" + resolved "https://registry.yarnpkg.com/log4js/-/log4js-2.4.1.tgz#b0c4e88133e0e3056afdc6f91f7f377576158778" + dependencies: + circular-json "^0.4.0" + date-format "^1.2.0" + debug "^3.1.0" + semver "^5.3.0" + streamroller "^0.7.0" + optionalDependencies: + axios "^0.15.3" + hipchat-notifier "^1.1.0" + loggly "^1.1.0" + mailgun-js "^0.7.0" + nodemailer "^2.5.0" + redis "^2.7.1" + slack-node "~0.2.0" + +loggly@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/loggly/-/loggly-1.1.1.tgz#0a0fc1d3fa3a5ec44fdc7b897beba2a4695cebee" + dependencies: + json-stringify-safe "5.0.x" + request "2.75.x" + timespan "2.3.x" + lolex@1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/lolex/-/lolex-1.3.2.tgz#7c3da62ffcb30f0f5a80a2566ca24e45d8a01f31" @@ -4096,6 +4672,10 @@ lru-cache@~2.3.0: version "2.3.1" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-2.3.1.tgz#b3adf6b3d856e954e2c390e6cef22081245a53d6" +lru-cache@~2.6.5: + version "2.6.5" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-2.6.5.tgz#e56d6354148ede8d7707b58d143220fd08df0fd5" + lru-queue@0.1: version "0.1.0" resolved "https://registry.yarnpkg.com/lru-queue/-/lru-queue-0.1.0.tgz#2738bd9f0d3cf4f84490c5736c48699ac632cda3" @@ -4106,6 +4686,27 @@ lunr@^0.7.2: version "0.7.2" resolved "https://registry.yarnpkg.com/lunr/-/lunr-0.7.2.tgz#79a30e932e216cba163541ee37a3607c12cd7281" +mailcomposer@4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/mailcomposer/-/mailcomposer-4.0.1.tgz#0e1c44b2a07cf740ee17dc149ba009f19cadfeb4" + dependencies: + buildmail "4.0.1" + libmime "3.0.0" + +mailgun-js@^0.7.0: + version "0.7.15" + resolved "https://registry.yarnpkg.com/mailgun-js/-/mailgun-js-0.7.15.tgz#ee366a20dac64c3c15c03d6c1b3e0ed795252abb" + dependencies: + async "~2.1.2" + debug "~2.2.0" + form-data "~2.1.1" + inflection "~1.10.0" + is-stream "^1.1.0" + path-proxy "~1.0.0" + proxy-agent "~2.0.0" + q "~1.4.0" + tsscmp "~1.0.0" + map-cache@^0.2.0: version "0.2.2" resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" @@ -4201,15 +4802,15 @@ mime-db@~1.12.0: version "1.12.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.12.0.tgz#3d0c63180f458eb10d325aaa37d7c58ae312e9d7" -mime-db@~1.26.0: - version "1.26.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.26.0.tgz#eaffcd0e4fc6935cf8134da246e2e6c35305adff" +mime-db@~1.30.0: + version "1.30.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.30.0.tgz#74c643da2dd9d6a45399963465b26d5ca7d71f01" -mime-types@^2.1.12, mime-types@~2.1.11, mime-types@~2.1.13, mime-types@~2.1.7: - version "2.1.14" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.14.tgz#f7ef7d97583fcaf3b7d282b6f8b5679dab1e94ee" +mime-types@^2.1.11, mime-types@^2.1.12, mime-types@~2.1.11, mime-types@~2.1.15, mime-types@~2.1.17, mime-types@~2.1.7: + version "2.1.17" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.17.tgz#09d7a393f03e995a79f8af857b70a9e0ab16557a" dependencies: - mime-db "~1.26.0" + mime-db "~1.30.0" mime-types@~1.0.1: version "1.0.2" @@ -4221,10 +4822,14 @@ mime-types@~2.0.3: dependencies: mime-db "~1.12.0" -mime@1.3.4, mime@^1.2.11, mime@^1.3.4: +mime@1.3.4, mime@^1.2.11: version "1.3.4" resolved "https://registry.yarnpkg.com/mime/-/mime-1.3.4.tgz#115f9e3b6b3daf2959983cb38f149a2d40eb5d53" +mime@^1.3.4: + version "1.6.0" + resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" + mime@~1.2.11: version "1.2.11" resolved "https://registry.yarnpkg.com/mime/-/mime-1.2.11.tgz#58203eed86e3a5ef17aed2b7d9ebd47f0a60dd10" @@ -4244,7 +4849,7 @@ minimatch@0.3: lru-cache "2" sigmund "~1.0.0" -"minimatch@2 || 3", minimatch@^3.0.0, minimatch@^3.0.2, minimatch@~3.0.0: +"minimatch@2 || 3", minimatch@~3.0.0: version "3.0.3" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774" dependencies: @@ -4263,6 +4868,12 @@ minimatch@^2.0.1: dependencies: brace-expansion "^1.0.0" +minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + dependencies: + brace-expansion "^1.1.7" + minimatch@~0.2.11: version "0.2.14" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-0.2.14.tgz#c74e780574f63c6f9a090e90efbe6ef53a6a756a" @@ -4270,7 +4881,7 @@ minimatch@~0.2.11: lru-cache "2" sigmund "~1.0.0" -minimist@0.0.8, minimist@~0.0.1: +minimist@0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" @@ -4282,13 +4893,17 @@ minimist@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.2.0.tgz#4dffe525dae2b864c66c2e23c6271d7afdecefce" +minimist@~0.0.1: + version "0.0.10" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" + mkdirp-promise@^5.0.0: version "5.0.1" resolved "https://registry.yarnpkg.com/mkdirp-promise/-/mkdirp-promise-5.0.1.tgz#e9b8f68e552c68a9c1713b84883f7a1dd039b8a1" dependencies: mkdirp "*" -mkdirp@*, mkdirp@0.5, mkdirp@0.5.1, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.1: +mkdirp@*, mkdirp@0.5, mkdirp@0.5.1, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" dependencies: @@ -4346,6 +4961,26 @@ module-deps@^3.6.3: through2 "^1.0.0" xtend "^4.0.0" +module-deps@^4.0.8: + version "4.1.1" + resolved "https://registry.yarnpkg.com/module-deps/-/module-deps-4.1.1.tgz#23215833f1da13fd606ccb8087b44852dcb821fd" + dependencies: + JSONStream "^1.0.3" + browser-resolve "^1.7.0" + cached-path-relative "^1.0.0" + concat-stream "~1.5.0" + defined "^1.0.0" + detective "^4.0.0" + duplexer2 "^0.1.2" + inherits "^2.0.1" + parents "^1.0.0" + readable-stream "^2.0.2" + resolve "^1.1.3" + stream-combiner2 "^1.1.1" + subarg "^1.0.0" + through2 "^2.0.0" + xtend "^4.0.0" + moment@^2.17.1, moment@^2.8.4: version "2.17.1" resolved "https://registry.yarnpkg.com/moment/-/moment-2.17.1.tgz#fed9506063f36b10f066c8b59a144d7faebe1d82" @@ -4372,6 +5007,10 @@ ms@0.7.2: version "0.7.2" resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.2.tgz#ae25cf2512b3885a1d95d7f037868d8431124765" +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + multimatch@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/multimatch/-/multimatch-2.1.0.tgz#9c7906a22fb4c02919e2f5f75161b4cdbd4b2a2b" @@ -4399,7 +5038,11 @@ mute-stream@0.0.6, mute-stream@~0.0.4: version "0.0.6" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.6.tgz#48962b19e169fd1dfc240b3f1e7317627bbc47db" -nan@^2.3.0, nan@^2.4.0: +nan@^2.3.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.8.0.tgz#ed715f3fe9de02b57a5e6252d90a96675e1f085a" + +nan@^2.4.0: version "2.5.1" resolved "https://registry.yarnpkg.com/nan/-/nan-2.5.1.tgz#d5b01691253326a97a2bbee9e61c55d8d60351e2" @@ -4415,6 +5058,10 @@ negotiator@0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" +netmask@~1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/netmask/-/netmask-1.0.6.tgz#20297e89d86f6f6400f250d9f4f6b4c1945fcd35" + next-tick@~0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-0.2.2.tgz#75da4a927ee5887e39065880065b7336413b310d" @@ -4429,24 +5076,86 @@ node-html-encoder@0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/node-html-encoder/-/node-html-encoder-0.0.2.tgz#8973618d727da5526a830b47d07c0d803e0a15c6" -node-pre-gyp@^0.6.29: - version "0.6.33" - resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.33.tgz#640ac55198f6a925972e0c16c4ac26a034d5ecc9" +node-pre-gyp@^0.6.39: + version "0.6.39" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.39.tgz#c00e96860b23c0e1420ac7befc5044e1d78d8649" dependencies: - mkdirp "~0.5.1" - nopt "~3.0.6" - npmlog "^4.0.1" - rc "~1.1.6" - request "^2.79.0" - rimraf "~2.5.4" - semver "~5.3.0" - tar "~2.2.1" - tar-pack "~3.3.0" + detect-libc "^1.0.2" + hawk "3.1.3" + mkdirp "^0.5.1" + nopt "^4.0.1" + npmlog "^4.0.2" + rc "^1.1.7" + request "2.81.0" + rimraf "^2.6.1" + semver "^5.3.0" + tar "^2.2.1" + tar-pack "^3.4.0" node-uuid@~1.4.0: version "1.4.7" resolved "https://registry.yarnpkg.com/node-uuid/-/node-uuid-1.4.7.tgz#6da5a17668c4b3dd59623bda11cf7fa4c1f60a6f" +node-uuid@~1.4.7: + version "1.4.8" + resolved "https://registry.yarnpkg.com/node-uuid/-/node-uuid-1.4.8.tgz#b040eb0923968afabf8d32fb1f17f1167fdab907" + +nodemailer-direct-transport@3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/nodemailer-direct-transport/-/nodemailer-direct-transport-3.3.2.tgz#e96fafb90358560947e569017d97e60738a50a86" + dependencies: + nodemailer-shared "1.1.0" + smtp-connection "2.12.0" + +nodemailer-fetch@1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/nodemailer-fetch/-/nodemailer-fetch-1.6.0.tgz#79c4908a1c0f5f375b73fe888da9828f6dc963a4" + +nodemailer-shared@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/nodemailer-shared/-/nodemailer-shared-1.1.0.tgz#cf5994e2fd268d00f5cf0fa767a08169edb07ec0" + dependencies: + nodemailer-fetch "1.6.0" + +nodemailer-smtp-pool@2.8.2: + version "2.8.2" + resolved "https://registry.yarnpkg.com/nodemailer-smtp-pool/-/nodemailer-smtp-pool-2.8.2.tgz#2eb94d6cf85780b1b4725ce853b9cbd5e8da8c72" + dependencies: + nodemailer-shared "1.1.0" + nodemailer-wellknown "0.1.10" + smtp-connection "2.12.0" + +nodemailer-smtp-transport@2.7.2: + version "2.7.2" + resolved "https://registry.yarnpkg.com/nodemailer-smtp-transport/-/nodemailer-smtp-transport-2.7.2.tgz#03d71c76314f14ac7dbc7bf033a6a6d16d67fb77" + dependencies: + nodemailer-shared "1.1.0" + nodemailer-wellknown "0.1.10" + smtp-connection "2.12.0" + +nodemailer-wellknown@0.1.10: + version "0.1.10" + resolved "https://registry.yarnpkg.com/nodemailer-wellknown/-/nodemailer-wellknown-0.1.10.tgz#586db8101db30cb4438eb546737a41aad0cf13d5" + +nodemailer@^2.5.0: + version "2.7.2" + resolved "https://registry.yarnpkg.com/nodemailer/-/nodemailer-2.7.2.tgz#f242e649aeeae39b6c7ed740ef7b061c404d30f9" + dependencies: + libmime "3.0.0" + mailcomposer "4.0.1" + nodemailer-direct-transport "3.3.2" + nodemailer-shared "1.1.0" + nodemailer-smtp-pool "2.8.2" + nodemailer-smtp-transport "2.7.2" + socks "1.1.9" + +nopt@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" + dependencies: + abbrev "1" + osenv "^0.1.4" + nopt@~1.0.10: version "1.0.10" resolved "https://registry.yarnpkg.com/nopt/-/nopt-1.0.10.tgz#6ddd21bd2a31417b92727dd585f8a6f37608ebee" @@ -4475,8 +5184,10 @@ normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: validate-npm-package-license "^3.0.1" normalize-path@^2.0.0, normalize-path@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.0.1.tgz#47886ac1662760d4261b7d979d241709d3ce3f7a" + version "2.1.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + dependencies: + remove-trailing-separator "^1.0.1" npm-path@^2.0.2: version "2.0.3" @@ -4523,13 +5234,13 @@ npmconf@^2.0.1: semver "2 || 3 || 4" uid-number "0.0.5" -npmlog@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.0.2.tgz#d03950e0e78ce1527ba26d2a7592e9348ac3e75f" +npmlog@^4.0.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" dependencies: are-we-there-yet "~1.1.2" console-control-strings "~1.1.0" - gauge "~2.7.1" + gauge "~2.7.3" set-blocking "~2.0.0" null-check@^1.0.0: @@ -4562,7 +5273,7 @@ oauth-sign@~0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.5.0.tgz#d767f5169325620eab2e087ef0c472e773db6461" -oauth-sign@~0.8.1: +oauth-sign@~0.8.1, oauth-sign@~0.8.2: version "0.8.2" resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" @@ -4611,7 +5322,7 @@ on-headers@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/on-headers/-/on-headers-1.0.1.tgz#928f5d0f470d49342651ea6794b0857c100693f7" -once@^1.3.0: +once@^1.3.0, once@^1.3.3: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" dependencies: @@ -4621,7 +5332,7 @@ once@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/once/-/once-1.2.0.tgz#de1905c636af874a8fba862d9aabddd1f920461c" -once@~1.3.0, once@~1.3.3: +once@~1.3.0: version "1.3.3" resolved "https://registry.yarnpkg.com/once/-/once-1.3.3.tgz#b2e261557ce4c314ec8304f3fa82663e4297ca20" dependencies: @@ -4659,7 +5370,7 @@ optimist@~0.3, optimist@~0.3.5: dependencies: wordwrap "~0.0.2" -optionator@^0.8.2: +optionator@^0.8.1, optionator@^0.8.2: version "0.8.2" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" dependencies: @@ -4690,6 +5401,10 @@ os-browserify@~0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.1.2.tgz#49ca0293e0b19590a5f5de10c7f265a617d8fe54" +os-browserify@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" + os-homedir@^1.0.0, os-homedir@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" @@ -4711,7 +5426,7 @@ os-shim@^0.1.2: version "0.1.3" resolved "https://registry.yarnpkg.com/os-shim/-/os-shim-0.1.3.tgz#6b62c3791cf7909ea35ed46e17658bb417cb3917" -os-tmpdir@~1.0.1: +os-tmpdir@^1.0.0, os-tmpdir@~1.0.1, os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" @@ -4723,6 +5438,13 @@ osenv@0.1.0, osenv@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.0.tgz#61668121eec584955030b9f470b1d2309504bfcb" +osenv@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.4.tgz#42fe6d5953df06c8064be6f176c3d05aaaa34644" + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.0" + osx-release@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/osx-release/-/osx-release-1.1.0.tgz#f217911a28136949af1bf9308b241e2737d3cd6c" @@ -4739,6 +5461,30 @@ p-throttler@0.1.0: dependencies: q "~0.9.2" +pac-proxy-agent@1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/pac-proxy-agent/-/pac-proxy-agent-1.1.0.tgz#34a385dfdf61d2f0ecace08858c745d3e791fd4d" + dependencies: + agent-base "2" + debug "2" + extend "3" + get-uri "2" + http-proxy-agent "1" + https-proxy-agent "1" + pac-resolver "~2.0.0" + raw-body "2" + socks-proxy-agent "2" + +pac-resolver@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/pac-resolver/-/pac-resolver-2.0.0.tgz#99b88d2f193fbdeefc1c9a529c1f3260ab5277cd" + dependencies: + co "~3.0.6" + degenerator "~1.0.2" + ip "1.0.1" + netmask "~1.0.4" + thunkify "~2.1.1" + package-json@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/package-json/-/package-json-0.2.0.tgz#0316e177b8eb149985d34f706b4a5543b274bec5" @@ -4756,6 +5502,10 @@ pako@~0.2.0: version "0.2.9" resolved "https://registry.yarnpkg.com/pako/-/pako-0.2.9.tgz#f3f7522f4ef782348da8161bad9ecfd51bf83a75" +pako@~1.0.5: + version "1.0.6" + resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.6.tgz#0101211baa70c4bca4a0f63f2206e97b7dfaf258" + param-case@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/param-case/-/param-case-2.1.0.tgz#2619f90fd6c829ed0b958f1c84ed03a745a6d70a" @@ -4811,12 +5561,6 @@ parse-passwd@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6" -parsejson@0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/parsejson/-/parsejson-0.0.3.tgz#ab7e3759f209ece99437973f7d0f1f64ae0e64ab" - dependencies: - better-assert "~1.0.0" - parseqs@0.0.5: version "0.0.5" resolved "https://registry.yarnpkg.com/parseqs/-/parseqs-0.0.5.tgz#d5208a3738e46766e291ba2ea173684921a8b89d" @@ -4829,9 +5573,9 @@ parseuri@0.0.5: dependencies: better-assert "~1.0.0" -parseurl@~1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.1.tgz#c8ab8c9223ba34888aa64a297b28853bec18da56" +parseurl@~1.3.1, parseurl@~1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.2.tgz#fc289d4ed8993119460c156253262cdc8de65bf3" pascal-case@^2.0.0: version "2.0.0" @@ -4868,6 +5612,10 @@ path-key@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/path-key/-/path-key-1.0.0.tgz#5d53d578019646c0d68800db4e146e6bdc2ac7af" +path-parse@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" + path-platform@^0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/path-platform/-/path-platform-0.0.1.tgz#b5585d7c3c463d89aa0060d86611cf1afd617e2a" @@ -4876,6 +5624,12 @@ path-platform@~0.11.15: version "0.11.15" resolved "https://registry.yarnpkg.com/path-platform/-/path-platform-0.11.15.tgz#e864217f74c36850f0852b78dc7bf7d4a5721bf2" +path-proxy@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/path-proxy/-/path-proxy-1.0.0.tgz#18e8a36859fc9d2f1a53b48dee138543c020de5e" + dependencies: + inflection "~1.3.0" + path-root-regex@^0.1.0: version "0.1.2" resolved "https://registry.yarnpkg.com/path-root-regex/-/path-root-regex-0.1.2.tgz#bfccdc8df5b12dc52c8b43ec38d18d72c04ba96d" @@ -4910,6 +5664,14 @@ pbkdf2@^3.0.3: dependencies: create-hmac "^1.1.2" +performance-now@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-0.2.0.tgz#33ef30c5c77d4ea21c5a53869d91b56d8f2555e5" + +performance-now@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" + pify@^2.0.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" @@ -5023,6 +5785,19 @@ proxy-addr@~1.1.3: forwarded "~0.1.0" ipaddr.js "1.2.0" +proxy-agent@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/proxy-agent/-/proxy-agent-2.0.0.tgz#57eb5347aa805d74ec681cb25649dba39c933499" + dependencies: + agent-base "2" + debug "2" + extend "3" + http-proxy-agent "1" + https-proxy-agent "1" + lru-cache "~2.6.5" + pac-proxy-agent "1" + socks-proxy-agent "2" + pseudomap@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" @@ -5057,7 +5832,7 @@ punycode@1.3.2, punycode@>=0.2.0: version "1.3.2" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" -punycode@^1.4.1: +punycode@1.4.1, punycode@^1.3.2, punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" @@ -5091,7 +5866,7 @@ q@0.8.4: version "0.8.4" resolved "https://registry.yarnpkg.com/q/-/q-0.8.4.tgz#662b6d97db73e141c96529ce2f10670b65ef01b0" -q@1.4.1, q@^1.0.1, q@^1.4.1, q@~1.4.1: +q@1.4.1, q@^1.0.1, q@^1.4.1, q@~1.4.0, q@~1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/q/-/q-1.4.1.tgz#55705bcd93c5f3673530c2c2cbc0c2b3addc286e" @@ -5121,9 +5896,9 @@ qs@6.2.0: version "6.2.0" resolved "https://registry.yarnpkg.com/qs/-/qs-6.2.0.tgz#3b7848c03c2dece69a9522b0fae8c4126d745f3b" -qs@6.4.0: - version "6.4.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233" +qs@6.5.1, qs@~6.5.1: + version "6.5.1" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.1.tgz#349cdf6eef89ec45c12d7d5eb3fc0c870343a6d8" qs@^1.2.1, qs@~1.2.0: version "1.2.2" @@ -5137,9 +5912,17 @@ qs@~2.3.1: version "2.3.3" resolved "https://registry.yarnpkg.com/qs/-/qs-2.3.3.tgz#e9e85adbe75da0bbe4c8e0476a086290f863b404" +qs@~6.2.0: + version "6.2.3" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.2.3.tgz#1cfcb25c10a9b2b483053ff39f5dfc9233908cfe" + qs@~6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.0.tgz#f403b264f23bc01228c74131b407f18d5ea5d442" + version "6.3.2" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.2.tgz#e75bd5f6e268122a2a0e0bda630b2550c166502c" + +qs@~6.4.0: + version "6.4.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233" querystring-es3@~0.2.0: version "0.2.1" @@ -5150,11 +5933,11 @@ querystring@0.2.0: resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" randomatic@^1.1.3: - version "1.1.6" - resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.6.tgz#110dcabff397e9dcff7c0789ccc0a49adf1ec5bb" + version "1.1.7" + resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.7.tgz#c7abe9cc8b87c0baa876b19fde83fd464797e38c" dependencies: - is-number "^2.0.2" - kind-of "^3.0.2" + is-number "^3.0.0" + kind-of "^4.0.0" randombytes@^2.0.0, randombytes@^2.0.1: version "2.0.3" @@ -5164,22 +5947,29 @@ range-parser@^1.2.0, range-parser@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e" -raw-body@~2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.2.0.tgz#994976cf6a5096a41162840492f0bdc5d6e7fb96" +raw-body@2, raw-body@2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.3.2.tgz#bcd60c77d3eb93cde0050295c3f379389bc88f89" dependencies: - bytes "2.4.0" - iconv-lite "0.4.15" + bytes "3.0.0" + http-errors "1.6.2" + iconv-lite "0.4.19" unpipe "1.0.0" -rc@~1.1.6: - version "1.1.6" - resolved "https://registry.yarnpkg.com/rc/-/rc-1.1.6.tgz#43651b76b6ae53b5c802f1151fa3fc3b059969c9" +rc@^1.1.7: + version "1.2.2" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.2.tgz#d8ce9cb57e8d64d9c7badd9876c7c34cbe3c7077" dependencies: deep-extend "~0.4.0" ini "~1.3.0" minimist "^1.2.0" - strip-json-comments "~1.0.4" + strip-json-comments "~2.0.1" + +read-only-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/read-only-stream/-/read-only-stream-2.0.0.tgz#2724fd6a8113d73764ac288d4386270c1dbf17f0" + dependencies: + readable-stream "^2.0.2" read-pkg-up@^1.0.1: version "1.0.1" @@ -5211,6 +6001,27 @@ readable-stream@1.1, "readable-stream@>=1.1.13-1 <1.2.0-0", readable-stream@^1.0 isarray "0.0.1" string_decoder "~0.10.x" +readable-stream@1.1.x: + version "1.1.14" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "0.0.1" + string_decoder "~0.10.x" + +readable-stream@2, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.1.4, readable-stream@^2.2.6, readable-stream@^2.3.0: + version "2.3.3" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.3.tgz#368f2512d79f9d46fdfc71349ae7878bbc1eb95c" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~1.0.6" + safe-buffer "~5.1.1" + string_decoder "~1.0.3" + util-deprecate "~1.0.1" + "readable-stream@>=1.0.33-1 <1.1.0-0", readable-stream@^1.0.33-1, readable-stream@~1.0.0, readable-stream@~1.0.17, readable-stream@~1.0.2, readable-stream@~1.0.26, readable-stream@~1.0.31: version "1.0.34" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" @@ -5220,7 +6031,7 @@ readable-stream@1.1, "readable-stream@>=1.1.13-1 <1.2.0-0", readable-stream@^1.0 isarray "0.0.1" string_decoder "~0.10.x" -readable-stream@^2.0.0, "readable-stream@^2.0.0 || ^1.1.13", readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.1.5: +readable-stream@^2.0.0, readable-stream@^2.0.5, readable-stream@^2.1.5: version "2.2.2" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.2.tgz#a9e6fec3c7dda85f8bb1b3ba7028604556fc825e" dependencies: @@ -5232,11 +6043,10 @@ readable-stream@^2.0.0, "readable-stream@^2.0.0 || ^1.1.13", readable-stream@^2. string_decoder "~0.10.x" util-deprecate "~1.0.1" -readable-stream@~2.1.4: - version "2.1.5" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.1.5.tgz#66fa8b720e1438b364681f2ad1a63c618448c9d0" +readable-stream@~2.0.0, readable-stream@~2.0.5: + version "2.0.6" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" dependencies: - buffer-shims "^1.0.0" core-util-is "~1.0.0" inherits "~2.0.1" isarray "~1.0.0" @@ -5293,12 +6103,27 @@ redeyed@~0.4.0: dependencies: esprima "~1.0.4" +redis-commands@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/redis-commands/-/redis-commands-1.3.1.tgz#81d826f45fa9c8b2011f4cd7a0fe597d241d442b" + +redis-parser@^2.6.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/redis-parser/-/redis-parser-2.6.0.tgz#52ed09dacac108f1a631c07e9b69941e7a19504b" + +redis@^2.7.1: + version "2.8.0" + resolved "https://registry.yarnpkg.com/redis/-/redis-2.8.0.tgz#202288e3f58c49f6079d97af7a10e1303ae14b02" + dependencies: + double-ended-queue "^2.1.0-0" + redis-commands "^1.2.0" + redis-parser "^2.6.0" + regex-cache@^0.4.2: - version "0.4.3" - resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.3.tgz#9b1a6c35d4d0dfcef5711ae651e8e9d3d7114145" + version "0.4.4" + resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" dependencies: is-equal-shallow "^0.1.3" - is-primitive "^2.0.0" registry-url@^0.1.0: version "0.1.1" @@ -5307,8 +6132,8 @@ registry-url@^0.1.0: npmconf "^2.0.1" remove-trailing-separator@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.0.1.tgz#615ebb96af559552d4bf4057c8436d486ab63cc4" + version "1.1.0" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" repeat-element@^1.1.2: version "1.1.2" @@ -5348,7 +6173,33 @@ request-replay@~0.2.0: dependencies: retry "~0.6.0" -request@2.79.0, request@^2.78.0, request@^2.79.0: +request@2.75.x: + version "2.75.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.75.0.tgz#d2b8268a286da13eaa5d01adf5d18cc90f657d93" + dependencies: + aws-sign2 "~0.6.0" + aws4 "^1.2.1" + bl "~1.1.2" + caseless "~0.11.0" + combined-stream "~1.0.5" + extend "~3.0.0" + forever-agent "~0.6.1" + form-data "~2.0.0" + har-validator "~2.0.6" + hawk "~3.1.3" + http-signature "~1.1.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.7" + node-uuid "~1.4.7" + oauth-sign "~0.8.1" + qs "~6.2.0" + stringstream "~0.0.4" + tough-cookie "~2.3.0" + tunnel-agent "~0.4.1" + +request@2.79.0, request@^2.78.0: version "2.79.0" resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de" dependencies: @@ -5373,6 +6224,60 @@ request@2.79.0, request@^2.78.0, request@^2.79.0: tunnel-agent "~0.4.1" uuid "^3.0.0" +request@2.81.0: + version "2.81.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0" + dependencies: + aws-sign2 "~0.6.0" + aws4 "^1.2.1" + caseless "~0.12.0" + combined-stream "~1.0.5" + extend "~3.0.0" + forever-agent "~0.6.1" + form-data "~2.1.1" + har-validator "~4.2.1" + hawk "~3.1.3" + http-signature "~1.1.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.7" + oauth-sign "~0.8.1" + performance-now "^0.2.0" + qs "~6.4.0" + safe-buffer "^5.0.1" + stringstream "~0.0.4" + tough-cookie "~2.3.0" + tunnel-agent "^0.6.0" + uuid "^3.0.0" + +request@^2.0.0, request@^2.74.0: + version "2.83.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.83.0.tgz#ca0b65da02ed62935887808e6f510381034e3356" + dependencies: + aws-sign2 "~0.7.0" + aws4 "^1.6.0" + caseless "~0.12.0" + combined-stream "~1.0.5" + extend "~3.0.1" + forever-agent "~0.6.1" + form-data "~2.3.1" + har-validator "~5.0.3" + hawk "~6.0.2" + http-signature "~1.2.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.17" + oauth-sign "~0.8.2" + performance-now "^2.1.0" + qs "~6.5.1" + safe-buffer "^5.1.1" + stringstream "~0.0.5" + tough-cookie "~2.3.3" + tunnel-agent "^0.6.0" + uuid "^3.1.0" + request@^2.40.0, request@~2.51.0: version "2.51.0" resolved "https://registry.yarnpkg.com/request/-/request-2.51.0.tgz#35d00bbecc012e55f907b1bd9e0dbd577bfef26e" @@ -5415,6 +6320,15 @@ request@~2.42.0: stringstream "~0.0.4" tough-cookie ">=0.12.0" +requestretry@^1.2.2: + version "1.12.2" + resolved "https://registry.yarnpkg.com/requestretry/-/requestretry-1.12.2.tgz#13ce38a4ce4e809f3c9ec6d4ca3b7b9ba4acf26c" + dependencies: + extend "^3.0.0" + lodash "^4.15.0" + request "^2.74.0" + when "^3.7.7" + require-uncached@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" @@ -5455,6 +6369,12 @@ resolve@1.1.7, resolve@^1.1.3, resolve@^1.1.6, resolve@^1.1.7, resolve@~1.1.0: version "1.1.7" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" +resolve@^1.1.4: + version "1.5.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.5.0.tgz#1f09acce796c9a762579f31b2c1cc4c3cddf9f36" + dependencies: + path-parse "^1.0.5" + resolve@~0.3.0: version "0.3.1" resolved "https://registry.yarnpkg.com/resolve/-/resolve-0.3.1.tgz#34c63447c664c70598d1c9b126fc43b2a24310a4" @@ -5495,18 +6415,24 @@ right-pad@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/right-pad/-/right-pad-1.0.1.tgz#8ca08c2cbb5b55e74dafa96bf7fd1a27d568c8d0" -rimraf@2, rimraf@^2.5.2, rimraf@^2.5.4, rimraf@^2.6.0: - version "2.6.1" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.1.tgz#c2338ec643df7a1b7fe5c54fa86f57428a55f33d" +rimraf@2, rimraf@^2.5.1, rimraf@^2.6.0, rimraf@^2.6.1: + version "2.6.2" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" dependencies: glob "^7.0.5" -rimraf@^2.2.8, rimraf@^2.5.1, rimraf@~2.5.1, rimraf@~2.5.4: +rimraf@^2.2.8: version "2.5.4" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.5.4.tgz#96800093cbf1a0c86bd95b4625467535c29dfa04" dependencies: glob "^7.0.5" +rimraf@^2.5.2, rimraf@^2.5.4: + version "2.6.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.1.tgz#c2338ec643df7a1b7fe5c54fa86f57428a55f33d" + dependencies: + glob "^7.0.5" + rimraf@~2.2.0, rimraf@~2.2.8: version "2.2.8" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.2.8.tgz#e439be2aaee327321952730f99a8929e4fc50582" @@ -5546,9 +6472,9 @@ rx@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/rx/-/rx-4.1.0.tgz#a5f13ff79ef3b740fe30aa803fb09f98805d4782" -safe-buffer@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.0.1.tgz#d263ca54696cd8a306b5ca6551e92de57918fbe7" +safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" samsam@1.1.2, samsam@~1.1: version "1.1.2" @@ -5613,7 +6539,7 @@ semver-diff@^0.1.0: version "4.3.6" resolved "https://registry.yarnpkg.com/semver/-/semver-4.3.6.tgz#300bc6e0e86374f7ba61068b5b1ecd57fc6532da" -"semver@2 || 3 || 4 || 5", semver@^5.0.1, semver@^5.1.0, semver@^5.2.0, semver@^5.3.0, semver@~5.3.0: +"semver@2 || 3 || 4 || 5", semver@^5.0.1, semver@^5.1.0, semver@^5.2.0: version "5.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" @@ -5625,6 +6551,10 @@ semver@^2.2.1, semver@~2.3.0: version "2.3.2" resolved "https://registry.yarnpkg.com/semver/-/semver-2.3.2.tgz#b9848f25d6cf36333073ec9ef8856d42f1233e52" +semver@^5.3.0: + version "5.4.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e" + semver@~4.0.3: version "4.0.3" resolved "https://registry.yarnpkg.com/semver/-/semver-4.0.3.tgz#f79c9ba670efccc029d98a5017def64b0ce1644e" @@ -5745,6 +6675,15 @@ shebang-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" +shell-quote@^1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.6.1.tgz#f4781949cce402697127430ea3b3c5476f481767" + dependencies: + array-filter "~0.0.0" + array-map "~0.0.0" + array-reduce "~0.0.0" + jsonify "~0.0.0" + shell-quote@~0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-0.0.1.tgz#1a41196f3c0333c482323593d6886ecf153dd986" @@ -5798,6 +6737,12 @@ sinon@^1.10.3: samsam "1.1.2" util ">=0.10.3 <1" +slack-node@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/slack-node/-/slack-node-0.2.0.tgz#de4b8dddaa8b793f61dbd2938104fdabf37dfa30" + dependencies: + requestretry "^1.2.2" + slice-ansi@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" @@ -5808,6 +6753,17 @@ slice-ansi@0.0.4: dependencies: readable-stream "~1.0.31" +smart-buffer@^1.0.13, smart-buffer@^1.0.4: + version "1.1.15" + resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-1.1.15.tgz#7f114b5b65fab3e2a35aa775bb12f0d1c649bf16" + +smtp-connection@2.12.0: + version "2.12.0" + resolved "https://registry.yarnpkg.com/smtp-connection/-/smtp-connection-2.12.0.tgz#d76ef9127cb23c2259edb1e8349c2e8d5e2d74c1" + dependencies: + httpntlm "1.6.1" + nodemailer-shared "1.1.0" + snake-case@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/snake-case/-/snake-case-2.1.0.tgz#41bdb1b73f30ec66a04d4e2cad1b76387d4d6d9f" @@ -5826,49 +6782,74 @@ sntp@1.x.x: dependencies: hoek "2.x.x" -socket.io-adapter@0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/socket.io-adapter/-/socket.io-adapter-0.5.0.tgz#cb6d4bb8bec81e1078b99677f9ced0046066bb8b" +sntp@2.x.x: + version "2.1.0" + resolved "https://registry.yarnpkg.com/sntp/-/sntp-2.1.0.tgz#2c6cec14fedc2222739caf9b5c3d85d1cc5a2cc8" dependencies: - debug "2.3.3" - socket.io-parser "2.3.1" + hoek "4.x.x" + +socket.io-adapter@~1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/socket.io-adapter/-/socket.io-adapter-1.1.1.tgz#2a805e8a14d6372124dd9159ad4502f8cb07f06b" -socket.io-client@1.7.3: - version "1.7.3" - resolved "https://registry.yarnpkg.com/socket.io-client/-/socket.io-client-1.7.3.tgz#b30e86aa10d5ef3546601c09cde4765e381da377" +socket.io-client@2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/socket.io-client/-/socket.io-client-2.0.4.tgz#0918a552406dc5e540b380dcd97afc4a64332f8e" dependencies: backo2 "1.0.2" + base64-arraybuffer "0.1.5" component-bind "1.0.0" component-emitter "1.2.1" - debug "2.3.3" - engine.io-client "1.8.3" - has-binary "0.1.7" + debug "~2.6.4" + engine.io-client "~3.1.0" + has-cors "1.1.0" indexof "0.0.1" object-component "0.0.3" + parseqs "0.0.5" parseuri "0.0.5" - socket.io-parser "2.3.1" + socket.io-parser "~3.1.1" to-array "0.1.4" -socket.io-parser@2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-2.3.1.tgz#dd532025103ce429697326befd64005fcfe5b4a0" +socket.io-parser@~3.1.1: + version "3.1.2" + resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-3.1.2.tgz#dbc2282151fc4faebbe40aeedc0772eba619f7f2" dependencies: - component-emitter "1.1.2" - debug "2.2.0" - isarray "0.0.1" - json3 "3.3.2" + component-emitter "1.2.1" + debug "~2.6.4" + has-binary2 "~1.0.2" + isarray "2.0.1" -socket.io@1.7.3: - version "1.7.3" - resolved "https://registry.yarnpkg.com/socket.io/-/socket.io-1.7.3.tgz#b8af9caba00949e568e369f1327ea9be9ea2461b" +socket.io@2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/socket.io/-/socket.io-2.0.4.tgz#c1a4590ceff87ecf13c72652f046f716b29e6014" dependencies: - debug "2.3.3" - engine.io "1.8.3" - has-binary "0.1.7" - object-assign "4.1.0" - socket.io-adapter "0.5.0" - socket.io-client "1.7.3" - socket.io-parser "2.3.1" + debug "~2.6.6" + engine.io "~3.1.0" + socket.io-adapter "~1.1.0" + socket.io-client "2.0.4" + socket.io-parser "~3.1.1" + +socks-proxy-agent@2: + version "2.1.1" + resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-2.1.1.tgz#86ebb07193258637870e13b7bd99f26c663df3d3" + dependencies: + agent-base "2" + extend "3" + socks "~1.1.5" + +socks@1.1.9: + version "1.1.9" + resolved "https://registry.yarnpkg.com/socks/-/socks-1.1.9.tgz#628d7e4d04912435445ac0b6e459376cb3e6d691" + dependencies: + ip "^1.1.2" + smart-buffer "^1.0.4" + +socks@~1.1.5: + version "1.1.10" + resolved "https://registry.yarnpkg.com/socks/-/socks-1.1.10.tgz#5b8b7fc7c8f341c53ed056e929b7bf4de8ba7b5a" + dependencies: + ip "^1.1.4" + smart-buffer "^1.0.13" sorted-object@^1.0.0: version "1.0.0" @@ -5899,7 +6880,7 @@ source-map@0.1.34: dependencies: amdefine ">=0.0.4" -source-map@0.X, source-map@^0.5.1, source-map@^0.5.3, source-map@~0.5.1: +source-map@0.X, source-map@^0.5.1, source-map@~0.5.1: version "0.5.6" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" @@ -5909,6 +6890,14 @@ source-map@^0.1.38, source-map@~0.1.31, source-map@~0.1.7: dependencies: amdefine ">=0.0.4" +source-map@^0.5.3, source-map@~0.5.3, source-map@~0.5.6: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + +source-map@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + source-map@~0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.3.0.tgz#8586fb9a5a005e5b501e21cd18b6f21b457ad1f9" @@ -5965,8 +6954,8 @@ sprintf-js@^1.0.3, sprintf-js@~1.0.2: resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" sshpk@^1.7.0: - version "1.10.2" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.10.2.tgz#d5a804ce22695515638e798dbe23273de070a5fa" + version "1.13.1" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.13.1.tgz#512df6da6287144316dc4c18fe1cf1d940739be3" dependencies: asn1 "~0.2.3" assert-plus "^1.0.0" @@ -5975,7 +6964,6 @@ sshpk@^1.7.0: optionalDependencies: bcrypt-pbkdf "^1.0.0" ecc-jsbn "~0.1.1" - jodid25519 "^1.0.0" jsbn "~0.1.0" tweetnacl "~0.14.0" @@ -5983,7 +6971,11 @@ stack-trace@0.0.x: version "0.0.9" resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.9.tgz#a8f6eaeca90674c333e7c43953f275b451510695" -"statuses@>= 1.3.1 < 2", statuses@~1.3.0, statuses@~1.3.1: +"statuses@>= 1.3.1 < 2": + version "1.4.0" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.4.0.tgz#bb73d446da2796106efcc1b601a253d6c46bd087" + +statuses@~1.3.0, statuses@~1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.3.1.tgz#faf51b9eb74aaef3b3acf4ad5f61abf24cb7b93e" @@ -5994,10 +6986,24 @@ stream-browserify@^1.0.0: inherits "~2.0.1" readable-stream "^1.0.27-1" +stream-browserify@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.1.tgz#66266ee5f9bdb9940a4e4514cafb43bb71e5c9db" + dependencies: + inherits "~2.0.1" + readable-stream "^2.0.2" + stream-buffers@^2.1.0: version "2.2.0" resolved "https://registry.yarnpkg.com/stream-buffers/-/stream-buffers-2.2.0.tgz#91d5f5130d1cef96dcfa7f726945188741d09ee4" +stream-combiner2@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/stream-combiner2/-/stream-combiner2-1.1.1.tgz#fb4d8a1420ea362764e21ad4780397bebcb41cbe" + dependencies: + duplexer2 "~0.1.0" + readable-stream "^2.0.2" + stream-combiner2@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/stream-combiner2/-/stream-combiner2-1.0.2.tgz#ba72a6b50cbfabfa950fc8bc87604bd01eb60671" @@ -6015,6 +7021,16 @@ stream-consume@~0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/stream-consume/-/stream-consume-0.1.0.tgz#a41ead1a6d6081ceb79f65b061901b6d8f3d1d0f" +stream-http@^2.0.0: + version "2.7.2" + resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.7.2.tgz#40a050ec8dc3b53b33d9909415c02c0bf1abfbad" + dependencies: + builtin-status-codes "^3.0.0" + inherits "^2.0.1" + readable-stream "^2.2.6" + to-arraybuffer "^1.0.0" + xtend "^4.0.0" + stream-splicer@^1.1.0: version "1.3.2" resolved "https://registry.yarnpkg.com/stream-splicer/-/stream-splicer-1.3.2.tgz#3c0441be15b9bf4e226275e6dc83964745546661" @@ -6026,13 +7042,29 @@ stream-splicer@^1.1.0: readable-wrap "^1.0.0" through2 "^1.0.0" +stream-splicer@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/stream-splicer/-/stream-splicer-2.0.0.tgz#1b63be438a133e4b671cc1935197600175910d83" + dependencies: + inherits "^2.0.1" + readable-stream "^2.0.2" + +streamroller@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/streamroller/-/streamroller-0.7.0.tgz#a1d1b7cf83d39afb0d63049a5acbf93493bdf64b" + dependencies: + date-format "^1.2.0" + debug "^3.1.0" + mkdirp "^0.5.1" + readable-stream "^2.3.0" + string-length@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/string-length/-/string-length-0.1.2.tgz#ab04bb33867ee74beed7fb89bb7f089d392780f2" dependencies: strip-ansi "^0.2.1" -string-width@^1.0.1: +string-width@^1.0.1, string-width@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" dependencies: @@ -6051,6 +7083,12 @@ string_decoder@~0.10.0, string_decoder@~0.10.x: version "0.10.31" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" +string_decoder@~1.0.0, string_decoder@~1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.3.tgz#0fc67d7c141825de94282dd536bec6b9bce860ab" + dependencies: + safe-buffer "~5.1.0" + stringify-object@~1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-1.0.1.tgz#86d35e7dbfbce9aa45637d7ecdd7847e159db8a2" @@ -6059,7 +7097,7 @@ stringmap@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/stringmap/-/stringmap-0.2.2.tgz#556c137b258f942b8776f5b2ef582aa069d7d1b1" -stringstream@~0.0.4: +stringstream@~0.0.4, stringstream@~0.0.5: version "0.0.5" resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" @@ -6114,10 +7152,6 @@ strip-json-comments@2.0.1, strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" -strip-json-comments@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-1.0.4.tgz#1e15fbcac97d3ee99bf2d73b4c656b082bbafb91" - subarg@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/subarg/-/subarg-1.0.0.tgz#f62cf17581e996b48fc965699f54c06ae268b8d2" @@ -6172,18 +7206,18 @@ tar-fs@0.5.2: pump "^0.3.5" tar-stream "^0.4.6" -tar-pack@~3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/tar-pack/-/tar-pack-3.3.0.tgz#30931816418f55afc4d21775afdd6720cee45dae" +tar-pack@^3.4.0: + version "3.4.1" + resolved "https://registry.yarnpkg.com/tar-pack/-/tar-pack-3.4.1.tgz#e1dbc03a9b9d3ba07e896ad027317eb679a10a1f" dependencies: - debug "~2.2.0" - fstream "~1.0.10" - fstream-ignore "~1.0.5" - once "~1.3.3" - readable-stream "~2.1.4" - rimraf "~2.5.1" - tar "~2.2.1" - uid-number "~0.0.6" + debug "^2.2.0" + fstream "^1.0.10" + fstream-ignore "^1.0.5" + once "^1.3.3" + readable-stream "^2.1.4" + rimraf "^2.5.1" + tar "^2.2.1" + uid-number "^0.0.6" tar-stream@^0.4.6: version "0.4.7" @@ -6203,7 +7237,7 @@ tar-stream@^1.5.0: readable-stream "^2.0.0" xtend "^4.0.0" -tar@~2.2.1: +tar@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.1.tgz#8e4d2a256c0e2185c6b18ad694aec968b83cb1d1" dependencies: @@ -6251,6 +7285,10 @@ through@2, "through@>=2.2.7 <3", through@^2.3.6, through@~2.3, through@~2.3.1, t version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" +thunkify@~2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/thunkify/-/thunkify-2.1.2.tgz#faa0e9d230c51acc95ca13a361ac05ca7e04553d" + tildify@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/tildify/-/tildify-1.2.0.tgz#dcec03f55dca9b7aa3e5b04f21817eb56e63588a" @@ -6274,6 +7312,10 @@ timers-ext@0.1: es5-ext "~0.10.2" next-tick "~0.2.2" +timespan@2.3.x: + version "2.3.0" + resolved "https://registry.yarnpkg.com/timespan/-/timespan-2.3.0.tgz#4902ce040bd13d845c8f59b27e9d59bad6f39929" + title-case@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/title-case/-/title-case-2.1.0.tgz#c68ccb4232079ded64f94b91b4941ade91391979" @@ -6295,11 +7337,11 @@ tmp@0.0.30: dependencies: os-tmpdir "~1.0.1" -tmp@0.0.31, tmp@0.0.x: - version "0.0.31" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.31.tgz#8f38ab9438e17315e5dbd8b3657e8bfb277ae4a7" +tmp@0.0.33, tmp@0.0.x: + version "0.0.33" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" dependencies: - os-tmpdir "~1.0.1" + os-tmpdir "~1.0.2" tmp@^0.0.29: version "0.0.29" @@ -6311,6 +7353,10 @@ to-array@0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/to-array/-/to-array-0.1.4.tgz#17e6c11f73dd4f3d74cda7a4ff3238e9ad9bf890" +to-arraybuffer@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" + to-iso-string@0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/to-iso-string/-/to-iso-string-0.0.2.tgz#4dc19e664dfccbe25bd8db508b00c6da158255d1" @@ -6327,9 +7373,9 @@ tough-cookie@>=0.12.0, tough-cookie@^0.12.1: dependencies: punycode ">=0.2.0" -tough-cookie@~2.3.0: - version "2.3.2" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.2.tgz#f081f76e4c85720e6c37a5faced737150d84072a" +tough-cookie@~2.3.0, tough-cookie@~2.3.3: + version "2.3.3" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.3.tgz#0b618a5565b6dea90bf3425d04d55edc475a7561" dependencies: punycode "^1.4.1" @@ -6353,10 +7399,20 @@ tryit@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/tryit/-/tryit-1.0.3.tgz#393be730a9446fd1ead6da59a014308f36c289cb" +tsscmp@~1.0.0: + version "1.0.5" + resolved "https://registry.yarnpkg.com/tsscmp/-/tsscmp-1.0.5.tgz#7dc4a33af71581ab4337da91d85ca5427ebd9a97" + tty-browserify@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" +tunnel-agent@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + dependencies: + safe-buffer "^5.0.1" + tunnel-agent@~0.4.0, tunnel-agent@~0.4.1: version "0.4.3" resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.4.3.tgz#6373db76909fe570e08d73583365ed828a74eeeb" @@ -6371,12 +7427,12 @@ type-check@~0.3.2: dependencies: prelude-ls "~1.1.2" -type-is@~1.6.14: - version "1.6.14" - resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.14.tgz#e219639c17ded1ca0789092dd54a03826b817cb2" +type-is@~1.6.14, type-is@~1.6.15: + version "1.6.15" + resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.15.tgz#cab10fb4909e441c82842eafe1ad646c81804410" dependencies: media-typer "0.3.0" - mime-types "~2.1.13" + mime-types "~2.1.15" typedarray@~0.0.5: version "0.0.6" @@ -6431,7 +7487,7 @@ uid-number@0.0.5: version "0.0.5" resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.5.tgz#5a3db23ef5dbd55b81fce0ec9a2ac6fccdebb81e" -uid-number@~0.0.6: +uid-number@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81" @@ -6439,6 +7495,10 @@ ultron@1.0.x: version "1.0.2" resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.0.2.tgz#ace116ab557cd197386a4e88f4685378c8b2e4fa" +ultron@~1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.1.1.tgz#9fe1536a10a664a65266a1e3ccf85fd36302bc9c" + umd@^2.1.0, umd@~2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/umd/-/umd-2.1.0.tgz#4a6307b762f17f02d201b5fa154e673396c263cf" @@ -6448,6 +7508,10 @@ umd@^2.1.0, umd@~2.1.0: through "~2.3.4" uglify-js "~2.4.0" +umd@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/umd/-/umd-3.0.1.tgz#8ae556e11011f63c2596708a8837259f01b3d60e" + unc-path-regex@^0.1.0: version "0.1.2" resolved "https://registry.yarnpkg.com/unc-path-regex/-/unc-path-regex-0.1.2.tgz#e73dd3d7b0d7c5ed86fbac6b0ae7d8c6a69d50fa" @@ -6477,6 +7541,10 @@ underscore@^1.6.0, underscore@~1.8.3: version "1.8.3" resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.8.3.tgz#4f3fb53b106e6097fcf9cb4109f2a5e9bdfa5022" +underscore@~1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.7.0.tgz#6bbaf0877500d36be34ecaa584e0db9fef035209" + unique-stream@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unique-stream/-/unique-stream-1.0.0.tgz#d59a4a75427447d9aa6c91e70263f8d26a4b104b" @@ -6531,6 +7599,13 @@ url@~0.10.1: punycode "1.3.2" querystring "0.2.0" +url@~0.11.0: + version "0.11.0" + resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" + dependencies: + punycode "1.3.2" + querystring "0.2.0" + user-home@^1.0.0, user-home@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/user-home/-/user-home-1.1.1.tgz#2b5be23a32b63a7c9deb8d0f28d485724a3df190" @@ -6542,8 +7617,8 @@ user-home@^2.0.0: os-homedir "^1.0.0" useragent@^2.1.12: - version "2.1.13" - resolved "https://registry.yarnpkg.com/useragent/-/useragent-2.1.13.tgz#bba43e8aa24d5ceb83c2937473e102e21df74c10" + version "2.2.1" + resolved "https://registry.yarnpkg.com/useragent/-/useragent-2.2.1.tgz#cf593ef4f2d175875e8bb658ea92e18a4fd06d8e" dependencies: lru-cache "2.2.x" tmp "0.0.x" @@ -6562,13 +7637,21 @@ utils-merge@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.0.tgz#0294fb922bb9375153541c4f7096231f287c8af8" +utils-merge@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" + uuid@^2.0.1: version "2.0.3" resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a" -uuid@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" +uuid@^3.0.0, uuid@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" + +uws@~0.14.4: + version "0.14.5" + resolved "https://registry.yarnpkg.com/uws/-/uws-0.14.5.tgz#67aaf33c46b2a587a5f6666d00f7691328f149dc" v8flags@^2.0.2: version "2.0.11" @@ -6595,11 +7678,13 @@ vary@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.0.tgz#e1e5affbbd16ae768dd2674394b9ad3022653140" -verror@1.3.6: - version "1.3.6" - resolved "https://registry.yarnpkg.com/verror/-/verror-1.3.6.tgz#cff5df12946d297d2baaefaa2689e25be01c005c" +verror@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" dependencies: - extsprintf "1.0.2" + assert-plus "^1.0.0" + core-util-is "1.0.2" + extsprintf "^1.2.0" vinyl-fs@^0.3.0: version "0.3.14" @@ -6715,6 +7800,10 @@ webdriver-manager@^12.0.6: semver "^5.3.0" xml2js "^0.4.17" +when@^3.7.7: + version "3.7.8" + resolved "https://registry.yarnpkg.com/when/-/when-3.7.8.tgz#c7130b6a7ea04693e842cdc9e7a1f2aa39a39f82" + which@^1.2.1, which@^1.2.10, which@^1.2.12, which@^1.2.9, which@~1.2.1: version "1.2.12" resolved "https://registry.yarnpkg.com/which/-/which-1.2.12.tgz#de67b5e450269f194909ef23ece4ebe416fa1192" @@ -6726,10 +7815,10 @@ which@~1.0.5: resolved "https://registry.yarnpkg.com/which/-/which-1.0.9.tgz#460c1da0f810103d0321a9b633af9e575e64486f" wide-align@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.0.tgz#40edde802a71fea1f070da3e62dcda2e7add96ad" + version "1.1.2" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.2.tgz#571e0f1b0604636ebc0dfc21b0339bbe31341710" dependencies: - string-width "^1.0.1" + string-width "^1.0.2" win-release@^1.0.0: version "1.1.1" @@ -6789,13 +7878,6 @@ write@^0.2.1: dependencies: mkdirp "^0.5.1" -ws@1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/ws/-/ws-1.1.2.tgz#8a244fa052401e08c9886cf44a85189e1fd4067f" - dependencies: - options ">=0.0.5" - ultron "1.0.x" - ws@^1.0.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ws/-/ws-1.1.1.tgz#082ddb6c641e85d4bb451f03d52f06eabdb1f018" @@ -6803,9 +7885,13 @@ ws@^1.0.1: options ">=0.0.5" ultron "1.0.x" -wtf-8@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/wtf-8/-/wtf-8-1.0.0.tgz#392d8ba2d0f1c34d1ee2d630f15d0efb68e1048a" +ws@~3.3.1: + version "3.3.3" + resolved "https://registry.yarnpkg.com/ws/-/ws-3.3.3.tgz#f1cf84fe2d5e901ebce94efaece785f187a228f2" + dependencies: + async-limiter "~1.0.0" + safe-buffer "~5.1.0" + ultron "~1.1.0" xdg-basedir@^1.0.0: version "1.0.1" @@ -6841,9 +7927,13 @@ xmldom@^0.1.22: version "0.1.27" resolved "https://registry.yarnpkg.com/xmldom/-/xmldom-0.1.27.tgz#d501f97b3bdb403af8ef9ecc20573187aadac0e9" -xmlhttprequest-ssl@1.5.3: - version "1.5.3" - resolved "https://registry.yarnpkg.com/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.3.tgz#185a888c04eca46c3e4070d99f7b49de3528992d" +xmlhttprequest-ssl@~1.5.4: + version "1.5.4" + resolved "https://registry.yarnpkg.com/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.4.tgz#04f560915724b389088715cc0ed7813e9677bf57" + +xregexp@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-2.0.0.tgz#52a63e56ca0b84a7f3a5f3d61872f126ad7a5943" "xtend@>=4.0.0 <4.1.0-0", xtend@^4.0.0, xtend@~4.0.1: version "4.0.1" From ff2ce9dddec73601db727361812429180798205b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Wed, 27 Dec 2017 19:16:46 +0100 Subject: [PATCH 334/745] chore(*): get rid of Bower in favor of Yarn aliases & checked-in packages Bower was used to install multiple versions of jQuery which is now handled using Yarn aliases. The remaining two packages, closure-compiler and ng-closure-compiler were installed from zip files which is not supported by Yarn (see https://github.com/yarnpkg/yarn/issues/1483); the first of them exists on npm as the google-closure-compiler but only versions newer than we used are published and they don't work with ng-closure-compiler so - instead - both were checked in to the repository. Fixes #16268 Fixes #14961 Ref yarnpkg/yarn#1483 --- .eslintignore | 2 +- .gitignore | 4 +- .travis.yml | 4 +- DEVELOPERS.md | 6 +- Gruntfile.js | 2 - TRIAGING.md | 2 +- angularFiles.js | 8 +- benchmarks/animation-bp/jquery-noop.js | 2 +- benchmarks/largetable-bp/jquery-noop.js | 2 +- benchmarks/orderby-bp/jquery-noop.js | 2 +- bower.json | 11 - docs/config/services/getVersion.js | 2 +- docs/gulpfile.js | 2 +- lib/grunt/plugins.js | 12 - lib/grunt/utils.js | 4 +- package.json | 5 +- scripts/travis/before_build.sh | 3 +- test/e2e/fixtures/ng-jq-jquery/index.html | 2 +- test/e2e/fixtures/ng-jq/index.html | 2 +- test/e2e/tools/fixture.js | 2 +- vendor/closure-compiler/COPYING | 202 +++++ vendor/closure-compiler/README.md | 530 +++++++++++++ vendor/closure-compiler/compiler.jar | Bin 0 -> 6007184 bytes vendor/ng-closure-runner/LICENSE | 22 + vendor/ng-closure-runner/README.md | 34 + vendor/ng-closure-runner/ngcompiler.jar | Bin 0 -> 8287 bytes yarn.lock | 902 ++-------------------- 27 files changed, 884 insertions(+), 885 deletions(-) delete mode 100644 bower.json create mode 100644 vendor/closure-compiler/COPYING create mode 100644 vendor/closure-compiler/README.md create mode 100644 vendor/closure-compiler/compiler.jar create mode 100644 vendor/ng-closure-runner/LICENSE create mode 100644 vendor/ng-closure-runner/README.md create mode 100644 vendor/ng-closure-runner/ngcompiler.jar diff --git a/.eslintignore b/.eslintignore index dc7259927e1c..6d8222eb45db 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,4 +1,3 @@ -bower_components/** build/** docs/app/assets/js/angular-bootstrap/** docs/config/templates/** @@ -8,3 +7,4 @@ src/angular.bind.js src/ngParseExt/ucd.js i18n/closure/** tmp/** +vendor/** diff --git a/.gitignore b/.gitignore index 42c5e13b4421..2da934151e89 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,6 @@ performance/temp*.html *.swp angular.js.tmproj node_modules/ -bower_components/ angular.xcodeproj .idea *.iml @@ -19,7 +18,6 @@ angular.xcodeproj libpeerconnection.log npm-debug.log /tmp/ -/scripts/bower/bower-* .vscode *.log -*.stackdump \ No newline at end of file +*.stackdump diff --git a/.travis.yml b/.travis.yml index 9748e1317f30..e425d58ec8b7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,8 +5,6 @@ node_js: cache: yarn: true - directories: - - bower_components branches: except: @@ -32,7 +30,7 @@ before_install: - export PATH="$HOME/.yarn/bin:$PATH" before_script: - - du -sh ./node_modules ./bower_components/ || true + - du -sh ./node_modules || true - "./scripts/travis/before_build.sh" script: - "./scripts/travis/build.sh" diff --git a/DEVELOPERS.md b/DEVELOPERS.md index 9155a5597f71..4d5e9ccd58eb 100644 --- a/DEVELOPERS.md +++ b/DEVELOPERS.md @@ -9,7 +9,7 @@ ##
        Development Setup This document describes how to set up your development environment to build and test AngularJS, and -explains the basic mechanics of using `git`, `node`, `yarn`, `grunt`, and `bower`. +explains the basic mechanics of using `git`, `node`, `yarn` and `grunt`. ### Installing Dependencies @@ -64,10 +64,10 @@ cd angular.js # Add the main AngularJS repository as an upstream remote to your repository: git remote add upstream "https://github.com/angular/angular.js.git" -# Install node.js dependencies: +# Install JavaScript dependencies: yarn install -# Build AngularJS (which will install `bower` dependencies automatically): +# Build AngularJS: yarn grunt package ``` diff --git a/Gruntfile.js b/Gruntfile.js index c9c32ca8d71a..0b2423e8c9e5 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -426,14 +426,12 @@ module.exports = function(grunt) { 'shell:promises-aplus-tests' ]); grunt.registerTask('minify', [ - 'bower', 'clean', 'build', 'minall' ]); grunt.registerTask('webserver', ['connect:devserver']); grunt.registerTask('package', [ - 'bower', 'validate-angular-files', 'clean', 'buildall', diff --git a/TRIAGING.md b/TRIAGING.md index 0dc6ee357232..f1819e3588f5 100644 --- a/TRIAGING.md +++ b/TRIAGING.md @@ -95,7 +95,7 @@ You can mention him in the relevant thread like this: `@btford`. > Thanks for submitting this issue! > Unfortunately, we don't think this functionality belongs in core. -> The good news is that you could easily implement this as a third-party module and publish it on Bower and/or to the npm repository. +> The good news is that you could easily implement this as a third-party module and publish it to the npm registry. ## Assigning Work diff --git a/angularFiles.js b/angularFiles.js index 7c4062d41ad4..01bb6422b1b2 100644 --- a/angularFiles.js +++ b/angularFiles.js @@ -171,7 +171,7 @@ var angularFiles = { ], 'karma': [ - 'bower_components/jquery/dist/jquery.js', + 'node_modules/jquery/dist/jquery.js', 'test/jquery_remove.js', '@angularSrc', '@angularSrcModules', @@ -202,7 +202,7 @@ var angularFiles = { ], 'karmaJquery': [ - 'bower_components/jquery/dist/jquery.js', + 'node_modules/jquery/dist/jquery.js', 'test/jquery_alias.js', '@angularSrc', '@angularSrcModules', @@ -220,8 +220,8 @@ var angularFiles = { angularFiles['karmaJquery' + jQueryVersion] = [] .concat(angularFiles.karmaJquery) .map(function(path) { - if (path.startsWith('bower_components/jquery')) { - return path.replace(/^bower_components\/jquery/, 'bower_components/jquery-' + jQueryVersion); + if (path.startsWith('node_modules/jquery')) { + return path.replace(/^node_modules\/jquery/, 'node_modules/jquery-' + jQueryVersion); } return path; }); diff --git a/benchmarks/animation-bp/jquery-noop.js b/benchmarks/animation-bp/jquery-noop.js index 8cac7fe4a149..de6781358dc1 100644 --- a/benchmarks/animation-bp/jquery-noop.js +++ b/benchmarks/animation-bp/jquery-noop.js @@ -1 +1 @@ -// Override me with ?jquery=/bower_components/jquery/dist/jquery.js +// Override me with ?jquery=/node_modules/jquery/dist/jquery.js diff --git a/benchmarks/largetable-bp/jquery-noop.js b/benchmarks/largetable-bp/jquery-noop.js index 8cac7fe4a149..de6781358dc1 100644 --- a/benchmarks/largetable-bp/jquery-noop.js +++ b/benchmarks/largetable-bp/jquery-noop.js @@ -1 +1 @@ -// Override me with ?jquery=/bower_components/jquery/dist/jquery.js +// Override me with ?jquery=/node_modules/jquery/dist/jquery.js diff --git a/benchmarks/orderby-bp/jquery-noop.js b/benchmarks/orderby-bp/jquery-noop.js index 8cac7fe4a149..de6781358dc1 100644 --- a/benchmarks/orderby-bp/jquery-noop.js +++ b/benchmarks/orderby-bp/jquery-noop.js @@ -1 +1 @@ -// Override me with ?jquery=/bower_components/jquery/dist/jquery.js +// Override me with ?jquery=/node_modules/jquery/dist/jquery.js diff --git a/bower.json b/bower.json deleted file mode 100644 index 099d5b1ed3e6..000000000000 --- a/bower.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "angularjs", - "license": "MIT", - "devDependencies": { - "jquery": "3.2.1", - "jquery-2.2": "jquery#2.2.4", - "jquery-2.1": "jquery#2.1.4", - "closure-compiler": "https://dl.google.com/closure-compiler/compiler-20140814.zip", - "ng-closure-runner": "https://raw.github.com/angular/ng-closure-runner/v0.2.4/assets/ng-closure-runner.zip" - } -} diff --git a/docs/config/services/getVersion.js b/docs/config/services/getVersion.js index 7de01030b6ec..cc88b395e228 100644 --- a/docs/config/services/getVersion.js +++ b/docs/config/services/getVersion.js @@ -4,7 +4,7 @@ var path = require('canonical-path'); /** * dgService getVersion * @description - * Find the current version of the bower component (or node module) + * Find the current version of the node module */ module.exports = function getVersion(readFilesProcessor) { var basePath = readFilesProcessor.basePath; diff --git a/docs/gulpfile.js b/docs/gulpfile.js index e45c504b6537..19a47be57eed 100644 --- a/docs/gulpfile.js +++ b/docs/gulpfile.js @@ -13,7 +13,7 @@ var rename = require('gulp-rename'); // We indicate to gulp that tasks are async by returning the stream. // Gulp can then wait for the stream to close before starting dependent tasks. -// See clean and bower for async tasks, and see assets and doc-gen for dependent tasks below +// See clean for an async task, and see assets and doc-gen for dependent tasks below. var outputFolder = '../build/docs'; diff --git a/lib/grunt/plugins.js b/lib/grunt/plugins.js index acce4b797ae7..2d71b85501eb 100644 --- a/lib/grunt/plugins.js +++ b/lib/grunt/plugins.js @@ -2,7 +2,6 @@ /* eslint-disable no-invalid-this */ -var bower = require('bower'); var util = require('./utils.js'); var npmRun = require('npm-run'); @@ -63,15 +62,4 @@ module.exports = function(grunt) { grunt.registerTask('collect-errors', 'Combine stripped error files', function() { util.collectErrors(); }); - - grunt.registerTask('bower', 'Install Bower packages.', function() { - var done = this.async(); - - bower.commands.install() - .on('log', function(result) { - grunt.log.ok('bower: ' + result.id + ' ' + result.data.endpoint.name); - }) - .on('error', grunt.fail.warn.bind(grunt.fail)) - .on('end', done); - }); }; diff --git a/lib/grunt/utils.js b/lib/grunt/utils.js index 952768da7239..52dbcde8fa5e 100644 --- a/lib/grunt/utils.js +++ b/lib/grunt/utils.js @@ -187,8 +187,8 @@ module.exports = { 'java ' + this.java32flags() + ' ' + this.memoryRequirement() + ' ' + - '-cp bower_components/closure-compiler/compiler.jar' + classPathSep + - 'bower_components/ng-closure-runner/ngcompiler.jar ' + + '-cp vendor/closure-compiler/compiler.jar' + classPathSep + + 'vendor/ng-closure-runner/ngcompiler.jar ' + 'org.angularjs.closurerunner.NgClosureRunner ' + '--compilation_level ' + compilationLevel + ' ' + '--language_in ECMASCRIPT5_STRICT ' + diff --git a/package.json b/package.json index fe7ab23e569e..77fa93a6f005 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,6 @@ "angular-benchpress": "0.x.x", "benchmark": "1.x.x", "bootstrap": "3.1.1", - "bower": "~1.3.9", "browserstacktunnel-wrapper": "2.0.0", "canonical-path": "0.0.2", "changez": "^2.1.1", @@ -60,7 +59,9 @@ "jasmine-core": "^2.8.0", "jasmine-node": "^2.0.0", "jasmine-reporters": "^2.2.0", - "jquery": "^3.2.1", + "jquery": "3.2.1", + "jquery-2.1": "npm:jquery@2.1.4", + "jquery-2.2": "npm:jquery@2.2.4", "karma": "^2.0.0", "karma-browserstack-launcher": "^1.2.0", "karma-chrome-launcher": "^2.1.1", diff --git a/scripts/travis/before_build.sh b/scripts/travis/before_build.sh index e1d83d7977ad..ca44cb37d7dd 100755 --- a/scripts/travis/before_build.sh +++ b/scripts/travis/before_build.sh @@ -18,7 +18,6 @@ fi # unit runs the docs tests too which need a built version of the code if [[ "$JOB" = unit-* ]]; then - grunt bower grunt validate-angular-files grunt build fi @@ -28,4 +27,4 @@ fi if [ "$JOB" != "ci-checks" ]; then echo "wait_for_browser_provider" ./scripts/travis/wait_for_browser_provider.sh -fi \ No newline at end of file +fi diff --git a/test/e2e/fixtures/ng-jq-jquery/index.html b/test/e2e/fixtures/ng-jq-jquery/index.html index 15c4a6c0cf30..535ff3fdca26 100644 --- a/test/e2e/fixtures/ng-jq-jquery/index.html +++ b/test/e2e/fixtures/ng-jq-jquery/index.html @@ -7,7 +7,7 @@ - + diff --git a/test/e2e/fixtures/ng-jq/index.html b/test/e2e/fixtures/ng-jq/index.html index 5c73233a8fc7..1e1c6cbdfcbc 100644 --- a/test/e2e/fixtures/ng-jq/index.html +++ b/test/e2e/fixtures/ng-jq/index.html @@ -3,7 +3,7 @@ {{jqueryVersion}} - + ``` -## Create the `app` module +#### Create the `app` module In the app.js file, create the main application module `app` which depends on the `ngComponentRouter` module, which is provided by the **Component Router** script. @@ -547,7 +547,7 @@ must have a base URL. ... ``` -## Bootstrap AngularJS +#### Bootstrap AngularJS Bootstrap the AngularJS application and add the top level App Component. @@ -559,7 +559,7 @@ Bootstrap the AngularJS application and add the top level App Component. ``` -# Implementing the AppComponent +### Implementing the AppComponent In the previous section we have created a single top level **App Component**. Let's now create some more **Routing Components** and wire up **Route Config** for those. We start with a Heroes Feature, which @@ -577,7 +577,7 @@ We are going to have a `Heroes` Component for the Heroes feature of our applicat and `HeroDetail` **Components** that will actually display the two different views. -## App Component +#### App Component Configure the **App Component** with a template and **Route Config**: @@ -598,7 +598,7 @@ Configure the **App Component** with a template and **Route Config**: The **App Component** has an `` directive in its template. This is where the child **Components** of this view will be rendered. -### ngLink +#### ngLink We have used the `ng-link` directive to create a link to navigate to the Heroes Component. By using this directive we don't need to know what the actual URL will be. We can let the Router generate that for us. @@ -607,7 +607,7 @@ We have included a link to the Crisis Center but have not included the `ng-link` implemented the CrisisCenter component. -### Non-terminal Routes +#### Non-terminal Routes We need to tell the **Router** that the `Heroes` **Route Definition** is **non-terminal**, that it should continue to match **Routes** in its child **Components**. We do this by adding a **continuation ellipsis @@ -616,14 +616,14 @@ Without the **continuation ellipsis** the `HeroList` **Route** will never be mat stop at the `Heroes` **Routing Component** and not try to match the rest of the URL. -## Heroes Feature +### Heroes Feature Now we can implement our Heroes Feature which consists of three **Components**: `Heroes`, `HeroList` and `HeroDetail`. The `Heroes` **Routing Component** simply provides a template containing the {@link ngOutlet} directive and a **Route Config** that defines a set of child **Routes** which delegate through to the `HeroList` and `HeroDetail` **Components**. -## HeroesComponent +### HeroesComponent Create a new file `heroes.js`, which defines a new AngularJS module for the **Components** of this feature and registers the Heroes **Component**. @@ -651,20 +651,20 @@ and also to add the module as a dependency of the `app` module: angular.module('app', ['ngComponentRouter', 'heroes']) ``` -### Use As Default +#### Use As Default The `useAsDefault` property on the `HeroList` **Route Definition**, indicates that if no other **Route Definition** matches the URL, then this **Route Definition** should be used by default. -### Route Parameters +#### Route Parameters The `HeroDetail` Route has a named parameter (`id`), indicated by prefixing the URL segment with a colon, as part of its `path` property. The **Router** will match anything in this segment and make that value available to the HeroDetail **Component**. -### Terminal Routes +#### Terminal Routes Both the Routes in the `HeroesComponent` are terminal, i.e. their routes do not end with `...`. This is because the `HeroList` and `HeroDetail` will not contain any child routes. -### Route Names +#### Route Names **What is the difference between the `name` and `component` properties on a Route Definition?** The `component` property in a **Route Definition** defines the **Component** directive that will be rendered @@ -676,7 +676,7 @@ The `name` property is used to reference the **Route Definition** when generatin that has the `name` property of `"Heroes"`. -## HeroList Component +### HeroList Component The HeroList **Component** is the first component in the application that actually contains significant functionality. It loads up a list of heroes from a `heroService` and displays them using `ng-repeat`. @@ -705,7 +705,7 @@ The template iterates through each `hero` object of the array in the `$ctrl.hero the `$ctrl` property on the scope of the template.* -## HeroService +### HeroService Our HeroService simulates requesting a list of heroes from a server. In a real application this would be making an actual server request, perhaps over HTTP. @@ -735,7 +735,7 @@ Note that both the `getHeroes()` and `getHero(id)` methods return a promise for in real-life we would have to wait for the server to respond with the data. -## Router Lifecycle Hooks +### Router Lifecycle Hooks **How do I know when my Component is active?** @@ -780,7 +780,7 @@ By returning a promise for the list of heroes from `$routerOnActivate()` we can Route until the heroes have arrived successfully. This is similar to how a `resolve` works in {@link ngRoute}. -## Route Parameters +### Route Parameters **How do I access parameters for the current route?** @@ -811,7 +811,7 @@ by the **Router**. In this code it is used to identify a specific Hero to retrie This hero is then attached to the **Component** so that it can be accessed in the template. -## Access to the Current Router +### Access to the Current Router **How do I get hold of the current router for my component?** @@ -882,7 +882,7 @@ Other options for generating this navigation are: ``` this form gives you the possibility of caching the instruction, but is more verbose. -### Absolute vs Relative Navigation +#### Absolute vs Relative Navigation **Why not use `$rootRouter` to do the navigation?** @@ -894,7 +894,7 @@ to the `HeroListComponent` with the `$rootRouter`, we would have to provide a co `['App','Heroes','HeroList']`. -## Extra Parameters +### Extra Parameters We can also pass additional optional parameters to routes, which get encoded into the URL and are again available to the `$routerOnActivate(next, previous)` hook. If we pass the current `id` from the @@ -936,7 +936,7 @@ Finally, we can use this information to highlight the current hero in the templa
        ``` -## Crisis Center +### Crisis Center Let's implement the Crisis Center feature, which displays a list if crises that need to be dealt with by a hero. The detailed crisis view has an additional feature where it blocks you from navigating if you have not saved @@ -951,7 +951,7 @@ changes to the crisis being edited. ![Crisis Detail View](img/guide/crisis-detail.png) -## Crisis Feature +### Crisis Feature This feature is very similar to the Heroes feature. It contains the following **Components**: @@ -962,7 +962,7 @@ This feature is very similar to the Heroes feature. It contains the following ** CrisisService and CrisisListComponent are basically the same as HeroService and HeroListComponent respectively. -## Navigation Control Hooks +### Navigation Control Hooks **How do I prevent navigation from occurring?** @@ -979,7 +979,7 @@ can complete, all the **Components** must agree that they can be deactivated or The **Router** will call the `$routerCanDeactivate` and `$canActivate` hooks, if they are provided. If any of the hooks resolve to `false` then the navigation is cancelled. -### Dialog Box Service +#### Dialog Box Service We can implement a very simple dialog box that will prompt the user whether they are happy to lose changes they have made. The result of the prompt is a promise that can be used in a `$routerCanDeactivate` hook. diff --git a/docs/content/guide/component.ngdoc b/docs/content/guide/component.ngdoc index f2f99b95a44f..6d378ee51997 100644 --- a/docs/content/guide/component.ngdoc +++ b/docs/content/guide/component.ngdoc @@ -445,7 +445,7 @@ angular.module('docsTabsExample', [])
        -# Unit-testing Component Controllers +## Unit-testing Component Controllers The easiest way to unit-test a component controller is by using the {@link ngMock.$componentController $componentController} that is included in {@link ngMock}. The diff --git a/docs/content/guide/di.ngdoc b/docs/content/guide/di.ngdoc index 58fc09c3bc67..f0ac64c8c290 100644 --- a/docs/content/guide/di.ngdoc +++ b/docs/content/guide/di.ngdoc @@ -39,7 +39,7 @@ into `run` blocks. However, only those that have been **registered beforehand** can be injected. This is different from services, where the order of registration does not matter. -See {@link module#module-loading-dependencies Modules} for more details about `run` and `config` +See {@link module#module-loading Modules} for more details about `run` and `config` blocks and {@link guide/providers Providers} for more information about the different provider types. diff --git a/docs/content/guide/introduction.ngdoc b/docs/content/guide/introduction.ngdoc index 05704e5302f6..e43dcd30e72b 100644 --- a/docs/content/guide/introduction.ngdoc +++ b/docs/content/guide/introduction.ngdoc @@ -64,7 +64,7 @@ Games and GUI editors are examples of applications with intensive and tricky DOM These kinds of apps are different from CRUD apps, and as a result are probably not a good fit for AngularJS. In these cases it may be better to use a library with a lower level of abstraction, such as `jQuery`. -# The Zen of AngularJS +## The Zen of AngularJS AngularJS is built around the belief that declarative code is better than imperative when it comes to building UIs and wiring software components together, while imperative code is excellent for From 1d804645f7656d592c90216a0355b4948807f6b8 Mon Sep 17 00:00:00 2001 From: Frederik Prijck Date: Sun, 1 Oct 2017 22:35:21 +0200 Subject: [PATCH 358/745] feat(orderBy): consider `null` and `undefined` greater than other values Previously, `null` values where sorted using type `string` resulting in a string comparison. `undefined` values where compared to other values by type and were usually considered greater than other values (since their type happens to start with a `u`), but this was coincidental. This commit ensures that `null` and `undefined ` values are explicitly considered greater than other values (with `undefined` > `null`) and will effectively be put at the end of the sorted list (for ascending order sorting). Closes #15294 Closes #16376 BREAKING CHANGE: When using `orderBy` to sort arrays containing `null` values, the `null` values will be considered "greater than" all other values, except for `undefined`. Previously, they were sorted as strings. This will result in different (but more intuitive) sorting order. Before: ```js orderByFilter(['a', undefined, 'o', null, 'z']); //--> 'a', null, 'o', 'z', undefined ``` After: ```js orderByFilter(['a', undefined, 'o', null, 'z']); //--> 'a', 'o', 'z', null, undefined ``` --- src/ng/filter/orderBy.js | 25 +++++++++++++++++-------- test/ng/filter/orderBySpec.js | 16 +++++++++++++--- 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/src/ng/filter/orderBy.js b/src/ng/filter/orderBy.js index 93e6424d804e..57c374735d5d 100644 --- a/src/ng/filter/orderBy.js +++ b/src/ng/filter/orderBy.js @@ -40,6 +40,7 @@ * index: ... * } * ``` + * **Note:** `null` values use `'null'` as their type. * 2. The comparator function is used to sort the items, based on the derived values, types and * indices. * @@ -74,11 +75,15 @@ * * The default, built-in comparator should be sufficient for most usecases. In short, it compares * numbers numerically, strings alphabetically (and case-insensitively), for objects falls back to - * using their index in the original collection, and sorts values of different types by type. + * using their index in the original collection, sorts values of different types by type and puts + * `undefined` and `null` values at the end of the sorted list. * * More specifically, it follows these steps to determine the relative order of items: * - * 1. If the compared values are of different types, compare the types themselves alphabetically. + * 1. If the compared values are of different types: + * - If one of the values is undefined, consider it "greater than" the other. + * - Else if one of the values is null, consider it "greater than" the other. + * - Else compare the types themselves alphabetically. * 2. If both values are of type `string`, compare them alphabetically in a case- and * locale-insensitive way. * 3. If both values are objects, compare their indices instead. @@ -89,9 +94,10 @@ * * **Note:** If you notice numbers not being sorted as expected, make sure they are actually being * saved as numbers and not strings. - * **Note:** For the purpose of sorting, `null` values are treated as the string `'null'` (i.e. - * `type: 'string'`, `value: 'null'`). This may cause unexpected sort order relative to - * other values. + * **Note:** For the purpose of sorting, `null` and `undefined` are considered "greater than" + * any other value (with undefined "greater than" null). This effectively means that `null` + * and `undefined` values end up at the end of a list sorted in ascending order. + * **Note:** `null` values use `'null'` as their type to be able to distinguish them from objects. * * @param {Array|ArrayLike} collection - The collection (array or array-like object) to sort. * @param {(Function|string|Array.)=} expression - A predicate (or list of @@ -658,8 +664,7 @@ function orderByFilter($parse) { function getPredicateValue(value, index) { var type = typeof value; if (value === null) { - type = 'string'; - value = 'null'; + type = 'null'; } else if (type === 'object') { value = objectValue(value); } @@ -690,7 +695,11 @@ function orderByFilter($parse) { result = value1 < value2 ? -1 : 1; } } else { - result = type1 < type2 ? -1 : 1; + result = (type1 === 'undefined') ? 1 : + (type2 === 'undefined') ? -1 : + (type1 === 'null') ? 1 : + (type2 === 'null') ? -1 : + (type1 < type2) ? -1 : 1; } return result; diff --git a/test/ng/filter/orderBySpec.js b/test/ng/filter/orderBySpec.js index e8f0a4126eff..cab5cb678063 100644 --- a/test/ng/filter/orderBySpec.js +++ b/test/ng/filter/orderBySpec.js @@ -309,6 +309,16 @@ describe('Filter: orderBy', function() { expect(orderBy(items, expr)).toEqual(sorted); }); + + it('should consider null and undefined greater than any other value', function() { + var items = [undefined, null, 'z', {}, 999, false]; + var expr = null; + var sorted = [false, 999, {}, 'z', null, undefined]; + var reversed = [undefined, null, 'z', {}, 999, false]; + + expect(orderBy(items, expr)).toEqual(sorted); + expect(orderBy(items, expr, true)).toEqual(reversed); + }); }); describe('(custom comparator)', function() { @@ -376,7 +386,7 @@ describe('Filter: orderBy', function() { }); - it('should treat a value of `null` as `"null"`', function() { + it('should treat a value of `null` as type `"null"`', function() { var items = [null, null]; var expr = null; var reverse = null; @@ -386,8 +396,8 @@ describe('Filter: orderBy', function() { var arg = comparator.calls.argsFor(0)[0]; expect(arg).toEqual(jasmine.objectContaining({ - type: 'string', - value: 'null' + type: 'null', + value: null })); }); From 8d9984e530873497c39acf7726d51f17d60df909 Mon Sep 17 00:00:00 2001 From: Martin Staffa Date: Fri, 26 Jan 2018 12:02:56 +0100 Subject: [PATCH 359/745] chore(docs-gen): generate list of versions in correct order Closes #16419 --- docs/config/processors/versions-data.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/config/processors/versions-data.js b/docs/config/processors/versions-data.js index 22b4570cc326..d52b6c420f69 100644 --- a/docs/config/processors/versions-data.js +++ b/docs/config/processors/versions-data.js @@ -55,9 +55,6 @@ module.exports = function generateVersionDocProcessor(gitData) { if (missesCurrentVersion) versions.push(currentVersion.version); - // Get the stable release with the highest version - var highestStableRelease = versions.reverse().find(semverIsStable); - versions = versions .filter(function(versionStr) { return blacklist.indexOf(versionStr) === -1; @@ -85,6 +82,9 @@ module.exports = function generateVersionDocProcessor(gitData) { var latest = sortObject(latestMap, reverse(semver.compare)) .map(function(version) { return makeOption(version, 'Latest'); }); + // Get the stable release with the highest version + var highestStableRelease = versions.find(semverIsStable); + // Generate master and stable snapshots var snapshots = [ makeOption( @@ -130,14 +130,15 @@ module.exports = function generateVersionDocProcessor(gitData) { return Object.keys(obj).map(function(key) { return obj[key]; }).sort(cmp); } + // Adapted from // https://github.com/kaelzhang/node-semver-stable/blob/34dd29842409295d49889d45871bec55a992b7f6/index.js#L25 function semverIsStable(version) { - var semverObj = semver.parse(version); + var semverObj = version.version; return semverObj === null ? false : !semverObj.prerelease.length; } function createSnapshotStableLabel(version) { - var label = 'v' + version.replace(/.$/, 'x') + '-snapshot'; + var label = version.label.replace(/.$/, 'x') + '-snapshot'; return label; } From a8830d2be402764225dd1108b992965a5f8b1f4d Mon Sep 17 00:00:00 2001 From: Dmitriy Date: Sun, 28 Jan 2018 14:24:00 +0300 Subject: [PATCH 360/745] feat(input): add `drop` event support (#16420) --- src/ng/directive/input.js | 4 ++-- test/ng/directive/inputSpec.js | 14 +++++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/ng/directive/input.js b/src/ng/directive/input.js index 228f5fb2366a..7d1bec7cfe9d 100644 --- a/src/ng/directive/input.js +++ b/src/ng/directive/input.js @@ -1306,9 +1306,9 @@ function baseInputType(scope, element, attr, ctrl, $sniffer, $browser) { deferListener(event, this, this.value); }); - // if user modifies input value using context menu in IE, we need "paste" and "cut" events to catch it + // if user modifies input value using context menu in IE, we need "paste", "cut" and "drop" events to catch it if ($sniffer.hasEvent('paste')) { - element.on('paste cut', deferListener); + element.on('paste cut drop', deferListener); } } diff --git a/test/ng/directive/inputSpec.js b/test/ng/directive/inputSpec.js index 9c58807345d3..93d2184f969d 100644 --- a/test/ng/directive/inputSpec.js +++ b/test/ng/directive/inputSpec.js @@ -439,7 +439,7 @@ describe('input', function() { } }); - describe('"keydown", "paste" and "cut" events', function() { + describe('"keydown", "paste", "cut" and "drop" events', function() { beforeEach(function() { // Force browser to report a lack of an 'input' event $sniffer.hasEvent = function(eventName) { @@ -461,6 +461,18 @@ describe('input', function() { expect($rootScope.name).toEqual('mark'); }); + it('should update the model on "drop" event if the input value changes', function() { + var inputElm = helper.compileInput(''); + + browserTrigger(inputElm, 'keydown'); + $browser.defer.flush(); + expect(inputElm).toBePristine(); + + inputElm.val('mark'); + browserTrigger(inputElm, 'drop'); + $browser.defer.flush(); + expect($rootScope.name).toEqual('mark'); + }); it('should update the model on "cut" event', function() { var inputElm = helper.compileInput(''); From 1e9eadcd72dbbd5c67dae8328a63e535cfa91ff9 Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Tue, 30 Jan 2018 14:07:27 +0000 Subject: [PATCH 361/745] feat($sce): handle URL sanitization through the `$sce` service Thanks to @rjamet for the original work on this feature. This is a large patch to handle URLs with the $sce service, similarly to HTML context. Where we previously sanitized URL attributes when setting attribute value inside the `$compile` service, we now only apply an `$sce` context requirement and leave the `$interpolate` service to deal with sanitization. This commit introduces a new `$sce` context called `MEDIA_URL`, which represents a URL used as a source for a media element that is not expected to execute code, such as image, video, audio, etc. The context hierarchy is setup so that a value trusted as `URL` is also trusted in the `MEDIA_URL` context, in the same way that the a value trusted as `RESOURCE_URL` is also trusted in the `URL` context (and transitively also the `MEDIA_URL` context). The `$sce` service will now automatically attempt to sanitize non-trusted values that require the `URL` or `MEDIA_URL` context: * When calling `getTrustedMediaUrl()` a value that is not already a trusted `MEDIA_URL` will be sanitized using the `imgSrcSanitizationWhitelist`. * When calling `getTrustedUrl()` a value that is not already a trusted `URL` will be sanitized using the `aHrefSanitizationWhitelist`. This results in behaviour that closely matches the previous sanitization behaviour. To keep rough compatibility with existing apps, we need to allow concatenation of values that may contain trusted contexts. The following approach is taken for situations that require a `URL` or `MEDIA_URL` secure context: * A single trusted value is trusted, e.g. `"{{trustedUrl}}"` and will not be sanitized. * A single non-trusted value, e.g. `"{{ 'javascript:foo' }}"`, will be handled by `getTrustedMediaUrl` or `getTrustedUrl)` and sanitized. * Any concatenation of values (which may or may not be trusted) results in a non-trusted type that will be handled by `getTrustedMediaUrl` or `getTrustedUrl` once the concatenation is complete. E.g. `"javascript:{{safeType}}"` is a concatenation of a non-trusted and a trusted value, which will be sanitized as a whole after unwrapping the `safeType` value. * An interpolation containing no expressions will still be handled by `getTrustedMediaUrl` or `getTrustedUrl`, whereas before this would have been short-circuited in the `$interpolate` service. E.g. `"some/hard/coded/url"`. This ensures that `ngHref` and similar directives still securely, even if the URL is hard-coded into a template or index.html (perhaps by server-side rendering). BREAKING CHANGES: If you use `attrs.$set` for URL attributes (a[href] and img[src]) there will no longer be any automated sanitization of the value. This is in line with other programmatic operations, such as writing to the innerHTML of an element. If you are programmatically writing URL values to attributes from untrusted input then you must sanitize it yourself. You could write your own sanitizer or copy the private `$$sanitizeUri` service. Note that values that have been passed through the `$interpolate` service within the `URL` or `MEDIA_URL` will have already been sanitized, so you would not need to sanitize these values again. --- docs/content/error/$compile/srcset.ngdoc | 12 + src/ng/compile.js | 48 ++- src/ng/directive/attrs.js | 2 +- src/ng/interpolate.js | 75 ++-- src/ng/sanitizeUri.js | 38 +- src/ng/sce.js | 97 +++-- src/ngSanitize/sanitize.js | 5 +- test/ng/compileSpec.js | 440 +++++++++++++++-------- test/ng/directive/booleanAttrsSpec.js | 208 ----------- test/ng/directive/ngHrefSpec.js | 105 ++++++ test/ng/directive/ngSrcSpec.js | 94 ++++- test/ng/directive/ngSrcsetSpec.js | 15 +- test/ng/interpolateSpec.js | 70 ++-- test/ng/sceSpecs.js | 81 ++++- test/ngSanitize/sanitizeSpec.js | 4 +- 15 files changed, 824 insertions(+), 470 deletions(-) create mode 100644 docs/content/error/$compile/srcset.ngdoc create mode 100644 test/ng/directive/ngHrefSpec.js diff --git a/docs/content/error/$compile/srcset.ngdoc b/docs/content/error/$compile/srcset.ngdoc new file mode 100644 index 000000000000..cab3de5f4d79 --- /dev/null +++ b/docs/content/error/$compile/srcset.ngdoc @@ -0,0 +1,12 @@ +@ngdoc error +@name $compile:srcset +@fullName Invalid value passed to `attr.$set('srcset', value)` +@description + +This error occurs if you try to programmatically set the `srcset` attribute with a non-string value. + +This can be the case if you tried to avoid the automatic sanitization of the `srcset` value by +passing a "trusted" value provided by calls to `$sce.trustAsMediaUrl(value)`. + +If you want to programmatically set explicitly trusted unsafe URLs, you should use `$sce.trustAsHtml` +on the whole `img` tag and inject it into the DOM using the `ng-bind-html` directive. diff --git a/src/ng/compile.js b/src/ng/compile.js index 4ec3ea5d6d94..6ae2722a6fde 100644 --- a/src/ng/compile.js +++ b/src/ng/compile.js @@ -1528,9 +1528,9 @@ function $CompileProvider($provide, $$sanitizeUriProvider) { this.$get = [ '$injector', '$interpolate', '$exceptionHandler', '$templateRequest', '$parse', - '$controller', '$rootScope', '$sce', '$animate', '$$sanitizeUri', + '$controller', '$rootScope', '$sce', '$animate', function($injector, $interpolate, $exceptionHandler, $templateRequest, $parse, - $controller, $rootScope, $sce, $animate, $$sanitizeUri) { + $controller, $rootScope, $sce, $animate) { var SIMPLE_ATTR_NAME = /^\w/; var specialAttrHolder = window.document.createElement('div'); @@ -1679,8 +1679,8 @@ function $CompileProvider($provide, $$sanitizeUriProvider) { */ $set: function(key, value, writeAttr, attrName) { // TODO: decide whether or not to throw an error if "class" - //is set through this function since it may cause $updateClass to - //become unstable. + // is set through this function since it may cause $updateClass to + // become unstable. var node = this.$$element[0], booleanKey = getBooleanAttrName(node, key), @@ -1710,13 +1710,20 @@ function $CompileProvider($provide, $$sanitizeUriProvider) { nodeName = nodeName_(this.$$element); - if ((nodeName === 'a' && (key === 'href' || key === 'xlinkHref')) || - (nodeName === 'img' && key === 'src') || - (nodeName === 'image' && key === 'xlinkHref')) { - // sanitize a[href] and img[src] values - this[key] = value = $$sanitizeUri(value, nodeName === 'img' || nodeName === 'image'); - } else if (nodeName === 'img' && key === 'srcset' && isDefined(value)) { - // sanitize img[srcset] values + // Sanitize img[srcset] values. + if (nodeName === 'img' && key === 'srcset' && value) { + if (!isString(value)) { + throw $compileMinErr('srcset', 'Can\'t pass trusted values to `$set(\'srcset\', value)`: "{0}"', value.toString()); + } + + // Such values are a bit too complex to handle automatically inside $sce. + // Instead, we sanitize each of the URIs individually, which works, even dynamically. + + // It's not possible to work around this using `$sce.trustAsMediaUrl`. + // If you want to programmatically set explicitly trusted unsafe URLs, you should use + // `$sce.trustAsHtml` on the whole `img` tag and inject it into the DOM using the + // `ng-bind-html` directive. + var result = ''; // first check if there are spaces because it's not the same pattern @@ -1733,16 +1740,16 @@ function $CompileProvider($provide, $$sanitizeUriProvider) { for (var i = 0; i < nbrUrisWith2parts; i++) { var innerIdx = i * 2; // sanitize the uri - result += $$sanitizeUri(trim(rawUris[innerIdx]), true); + result += $sce.getTrustedMediaUrl(trim(rawUris[innerIdx])); // add the descriptor - result += (' ' + trim(rawUris[innerIdx + 1])); + result += ' ' + trim(rawUris[innerIdx + 1]); } // split the last item into uri and descriptor var lastTuple = trim(rawUris[i * 2]).split(/\s/); // sanitize the last uri - result += $$sanitizeUri(trim(lastTuple[0]), true); + result += $sce.getTrustedMediaUrl(trim(lastTuple[0])); // and add the last descriptor if any if (lastTuple.length === 2) { @@ -3268,14 +3275,18 @@ function $CompileProvider($provide, $$sanitizeUriProvider) { } var tag = nodeName_(node); // All tags with src attributes require a RESOURCE_URL value, except for - // img and various html5 media tags. + // img and various html5 media tags, which require the MEDIA_URL context. if (attrNormalizedName === 'src' || attrNormalizedName === 'ngSrc') { if (['img', 'video', 'audio', 'source', 'track'].indexOf(tag) === -1) { return $sce.RESOURCE_URL; } + return $sce.MEDIA_URL; + } else if (attrNormalizedName === 'xlinkHref') { + // Some xlink:href are okay, most aren't + if (tag === 'image') return $sce.MEDIA_URL; + if (tag === 'a') return $sce.URL; + return $sce.RESOURCE_URL; } else if ( - // Some xlink:href are okay, most aren't - (attrNormalizedName === 'xlinkHref' && (tag !== 'image' && tag !== 'a')) || // Formaction (tag === 'form' && attrNormalizedName === 'action') || // If relative URLs can go where they are not expected to, then @@ -3285,6 +3296,9 @@ function $CompileProvider($provide, $$sanitizeUriProvider) { (tag === 'link' && attrNormalizedName === 'href') ) { return $sce.RESOURCE_URL; + } else if (tag === 'a' && (attrNormalizedName === 'href' || + attrNormalizedName === 'ngHref')) { + return $sce.URL; } } diff --git a/src/ng/directive/attrs.js b/src/ng/directive/attrs.js index af0bf14efd1f..1b646ff5d4c3 100644 --- a/src/ng/directive/attrs.js +++ b/src/ng/directive/attrs.js @@ -436,7 +436,7 @@ forEach(['src', 'srcset', 'href'], function(attrName) { // On IE, if "ng:src" directive declaration is used and "src" attribute doesn't exist // then calling element.setAttribute('src', 'foo') doesn't do anything, so we need // to set the property as well to achieve the desired effect. - // We use attr[attrName] value since $set can sanitize the url. + // We use attr[attrName] value since $set might have sanitized the url. if (msie && propName) element.prop(propName, attr[name]); }); } diff --git a/src/ng/interpolate.js b/src/ng/interpolate.js index 30ad9e3a9ad8..77b863ddcba9 100644 --- a/src/ng/interpolate.js +++ b/src/ng/interpolate.js @@ -238,16 +238,21 @@ function $InterpolateProvider() { * - `context`: evaluation context for all expressions embedded in the interpolated text */ function $interpolate(text, mustHaveExpression, trustedContext, allOrNothing) { + var contextAllowsConcatenation = trustedContext === $sce.URL || trustedContext === $sce.MEDIA_URL; + // Provide a quick exit and simplified result function for text with no interpolation if (!text.length || text.indexOf(startSymbol) === -1) { - var constantInterp; - if (!mustHaveExpression) { - var unescapedText = unescapeText(text); - constantInterp = valueFn(unescapedText); - constantInterp.exp = text; - constantInterp.expressions = []; - constantInterp.$$watchDelegate = constantWatchDelegate; + if (mustHaveExpression && !contextAllowsConcatenation) return; + + var unescapedText = unescapeText(text); + if (contextAllowsConcatenation) { + unescapedText = $sce.getTrusted(trustedContext, unescapedText); } + var constantInterp = valueFn(unescapedText); + constantInterp.exp = text; + constantInterp.expressions = []; + constantInterp.$$watchDelegate = constantWatchDelegate; + return constantInterp; } @@ -256,11 +261,13 @@ function $InterpolateProvider() { endIndex, index = 0, expressions = [], - parseFns = [], + parseFns, textLength = text.length, exp, concat = [], - expressionPositions = []; + expressionPositions = [], + singleExpression; + while (index < textLength) { if (((startIndex = text.indexOf(startSymbol, index)) !== -1) && @@ -270,10 +277,9 @@ function $InterpolateProvider() { } exp = text.substring(startIndex + startSymbolLength, endIndex); expressions.push(exp); - parseFns.push($parse(exp, parseStringifyInterceptor)); index = endIndex + endSymbolLength; expressionPositions.push(concat.length); - concat.push(''); + concat.push(''); // Placeholder that will get replaced with the evaluated expression. } else { // we did not find an interpolation, so we have to add the remainder to the separators array if (index !== textLength) { @@ -283,15 +289,25 @@ function $InterpolateProvider() { } } + singleExpression = concat.length === 1 && expressionPositions.length === 1; + // Intercept expression if we need to stringify concatenated inputs, which may be SCE trusted + // objects rather than simple strings + // (we don't modify the expression if the input consists of only a single trusted input) + var interceptor = contextAllowsConcatenation && singleExpression ? undefined : parseStringifyInterceptor; + parseFns = expressions.map(function(exp) { return $parse(exp, interceptor); }); + // Concatenating expressions makes it hard to reason about whether some combination of // concatenated values are unsafe to use and could easily lead to XSS. By requiring that a - // single expression be used for iframe[src], object[src], etc., we ensure that the value - // that's used is assigned or constructed by some JS code somewhere that is more testable or - // make it obvious that you bound the value to some user controlled value. This helps reduce - // the load when auditing for XSS issues. - if (trustedContext && concat.length > 1) { - $interpolateMinErr.throwNoconcat(text); - } + // single expression be used for some $sce-managed secure contexts (RESOURCE_URLs mostly), + // we ensure that the value that's used is assigned or constructed by some JS code somewhere + // that is more testable or make it obvious that you bound the value to some user controlled + // value. This helps reduce the load when auditing for XSS issues. + + // Note that URL and MEDIA_URL $sce contexts do not need this, since `$sce` can sanitize the values + // passed to it. In that case, `$sce.getTrusted` will be called on either the single expression + // or on the overall concatenated string (losing trusted types used in the mix, by design). + // Both these methods will sanitize plain strings. Also, HTML could be included, but since it's + // only used in srcdoc attributes, this would not be very useful. if (!mustHaveExpression || expressions.length) { var compute = function(values) { @@ -299,13 +315,16 @@ function $InterpolateProvider() { if (allOrNothing && isUndefined(values[i])) return; concat[expressionPositions[i]] = values[i]; } - return concat.join(''); - }; - var getValue = function(value) { - return trustedContext ? - $sce.getTrusted(trustedContext, value) : - $sce.valueOf(value); + if (contextAllowsConcatenation) { + // If `singleExpression` then `concat[0]` might be a "trusted" value or `null`, rather than a string + return $sce.getTrusted(trustedContext, singleExpression ? concat[0] : concat.join('')); + } else if (trustedContext && concat.length > 1) { + // This context does not allow more than one part, e.g. expr + string or exp + exp. + $interpolateMinErr.throwNoconcat(text); + } + // In an unprivileged context or only one part: just concatenate and return. + return concat.join(''); }; return extend(function interpolationFn(context) { @@ -340,7 +359,13 @@ function $InterpolateProvider() { function parseStringifyInterceptor(value) { try { - value = getValue(value); + // In concatenable contexts, getTrusted comes at the end, to avoid sanitizing individual + // parts of a full URL. We don't care about losing the trustedness here. + // In non-concatenable contexts, where there is only one expression, this interceptor is + // not applied to the expression. + value = (trustedContext && !contextAllowsConcatenation) ? + $sce.getTrusted(trustedContext, value) : + $sce.valueOf(value); return allOrNothing && !isDefined(value) ? value : stringify(value); } catch (err) { $exceptionHandler($interpolateMinErr.interr(text, err)); diff --git a/src/ng/sanitizeUri.js b/src/ng/sanitizeUri.js index f7dc60bf3c41..edda8244e406 100644 --- a/src/ng/sanitizeUri.js +++ b/src/ng/sanitizeUri.js @@ -6,6 +6,7 @@ * Private service to sanitize uris for links and images. Used by $compile and $sanitize. */ function $$SanitizeUriProvider() { + var aHrefSanitizationWhitelist = /^\s*(https?|s?ftp|mailto|tel|file):/, imgSrcSanitizationWhitelist = /^\s*((https?|ftp|file|blob):|data:image\/)/; @@ -14,12 +15,16 @@ function $$SanitizeUriProvider() { * Retrieves or overrides the default regular expression that is used for whitelisting of safe * urls during a[href] sanitization. * - * The sanitization is a security measure aimed at prevent XSS attacks via html links. + * The sanitization is a security measure aimed at prevent XSS attacks via HTML anchor links. + * + * Any url due to be assigned to an `a[href]` attribute via interpolation is marked as requiring + * the $sce.URL security context. When interpolation occurs a call is made to `$sce.trustAsUrl(url)` + * which in turn may call `$$sanitizeUri(url, isMedia)` to sanitize the potentially malicious URL. + * + * If the URL matches the `aHrefSanitizationWhitelist` regular expression, it is returned unchanged. * - * Any url about to be assigned to a[href] via data-binding is first normalized and turned into - * an absolute url. Afterwards, the url is matched against the `aHrefSanitizationWhitelist` - * regular expression. If a match is found, the original url is written into the dom. Otherwise, - * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM. + * If there is no match the URL is returned prefixed with `'unsafe:'` to ensure that when it is written + * to the DOM it is inactive and potentially malicious code will not be executed. * * @param {RegExp=} regexp New regexp to whitelist urls with. * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for @@ -39,12 +44,17 @@ function $$SanitizeUriProvider() { * Retrieves or overrides the default regular expression that is used for whitelisting of safe * urls during img[src] sanitization. * - * The sanitization is a security measure aimed at prevent XSS attacks via html links. + * The sanitization is a security measure aimed at prevent XSS attacks via HTML image src links. + * + * Any URL due to be assigned to an `img[src]` attribute via interpolation is marked as requiring + * the $sce.MEDIA_URL security context. When interpolation occurs a call is made to + * `$sce.trustAsMediaUrl(url)` which in turn may call `$$sanitizeUri(url, isMedia)` to sanitize + * the potentially malicious URL. + * + * If the URL matches the `aImgSanitizationWhitelist` regular expression, it is returned unchanged. * - * Any url about to be assigned to img[src] via data-binding is first normalized and turned into - * an absolute url. Afterwards, the url is matched against the `imgSrcSanitizationWhitelist` - * regular expression. If a match is found, the original url is written into the dom. Otherwise, - * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM. + * If there is no match the URL is returned prefixed with `'unsafe:'` to ensure that when it is written + * to the DOM it is inactive and potentially malicious code will not be executed. * * @param {RegExp=} regexp New regexp to whitelist urls with. * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for @@ -59,10 +69,10 @@ function $$SanitizeUriProvider() { }; this.$get = function() { - return function sanitizeUri(uri, isImage) { - var regex = isImage ? imgSrcSanitizationWhitelist : aHrefSanitizationWhitelist; - var normalizedVal; - normalizedVal = urlResolve(uri && uri.trim()).href; + return function sanitizeUri(uri, isMediaUrl) { + // if (!uri) return uri; + var regex = isMediaUrl ? imgSrcSanitizationWhitelist : aHrefSanitizationWhitelist; + var normalizedVal = urlResolve(uri && uri.trim()).href; if (normalizedVal !== '' && !normalizedVal.match(regex)) { return 'unsafe:' + normalizedVal; } diff --git a/src/ng/sce.js b/src/ng/sce.js index 4dc0279fb61e..a5f618ef8fe4 100644 --- a/src/ng/sce.js +++ b/src/ng/sce.js @@ -22,12 +22,17 @@ var SCE_CONTEXTS = { // Style statements or stylesheets. Currently unused in AngularJS. CSS: 'css', - // An URL used in a context where it does not refer to a resource that loads code. Currently - // unused in AngularJS. + // An URL used in a context where it refers to the source of media, which are not expected to be run + // as scripts, such as an image, audio, video, etc. + MEDIA_URL: 'mediaUrl', + + // An URL used in a context where it does not refer to a resource that loads code. + // A value that can be trusted as a URL can also trusted as a MEDIA_URL. URL: 'url', // RESOURCE_URL is a subtype of URL used where the referred-to resource could be interpreted as // code. (e.g. ng-include, script src binding, templateUrl) + // A value that can be trusted as a RESOURCE_URL, can also trusted as a URL and a MEDIA_URL. RESOURCE_URL: 'resourceUrl', // Script. Currently unused in AngularJS. @@ -242,7 +247,7 @@ function $SceDelegateProvider() { return resourceUrlBlacklist; }; - this.$get = ['$injector', function($injector) { + this.$get = ['$injector', '$$sanitizeUri', function($injector, $$sanitizeUri) { var htmlSanitizer = function htmlSanitizer(html) { throw $sceMinErr('unsafe', 'Attempting to use an unsafe value in a safe context.'); @@ -307,7 +312,8 @@ function $SceDelegateProvider() { byType[SCE_CONTEXTS.HTML] = generateHolderType(trustedValueHolderBase); byType[SCE_CONTEXTS.CSS] = generateHolderType(trustedValueHolderBase); - byType[SCE_CONTEXTS.URL] = generateHolderType(trustedValueHolderBase); + byType[SCE_CONTEXTS.MEDIA_URL] = generateHolderType(trustedValueHolderBase); + byType[SCE_CONTEXTS.URL] = generateHolderType(byType[SCE_CONTEXTS.MEDIA_URL]); byType[SCE_CONTEXTS.JS] = generateHolderType(trustedValueHolderBase); byType[SCE_CONTEXTS.RESOURCE_URL] = generateHolderType(byType[SCE_CONTEXTS.URL]); @@ -386,15 +392,27 @@ function $SceDelegateProvider() { * @name $sceDelegate#getTrusted * * @description - * Takes any input, and either returns a value that's safe to use in the specified context, or - * throws an exception. + * Given an object and a security context in which to assign it, returns a value that's safe to + * use in this context, which was represented by the parameter. To do so, this function either + * unwraps the safe type it has been given (for instance, a {@link ng.$sceDelegate#trustAs + * `$sceDelegate.trustAs`} result), or it might try to sanitize the value given, depending on + * the context and sanitizer availablility. + * + * The contexts that can be sanitized are $sce.MEDIA_URL, $sce.URL and $sce.HTML. The first two are available + * by default, and the third one relies on the `$sanitize` service (which may be loaded through + * the `ngSanitize` module). Furthermore, for $sce.RESOURCE_URL context, a plain string may be + * accepted if the resource url policy defined by {@link ng.$sceDelegateProvider#resourceUrlWhitelist + * `$sceDelegateProvider.resourceUrlWhitelist`} and {@link ng.$sceDelegateProvider#resourceUrlBlacklist + * `$sceDelegateProvider.resourceUrlBlacklist`} accepts that resource. + * + * This function will throw if the safe type isn't appropriate for this context, or if the + * value given cannot be accepted in the context (which might be caused by sanitization not + * being available, or the value not being recognized as safe). * - * In practice, there are several cases. When given a string, this function runs checks - * and sanitization to make it safe without prior assumptions. When given the result of a {@link - * ng.$sceDelegate#trustAs `$sceDelegate.trustAs`} call, it returns the originally supplied - * value if that value's context is valid for this call's context. Finally, this function can - * also throw when there is no way to turn `maybeTrusted` in a safe value (e.g., no sanitization - * is available or possible.) + *
        + * Disabling auto-escaping is extremely dangerous, it usually creates a Cross Site Scripting + * (XSS) vulnerability in your application. + *
        * * @param {string} type The context in which this value is to be used (such as `$sce.HTML`). * @param {*} maybeTrusted The result of a prior {@link ng.$sceDelegate#trustAs @@ -412,12 +430,18 @@ function $SceDelegateProvider() { if (constructor && maybeTrusted instanceof constructor) { return maybeTrusted.$$unwrapTrustedValue(); } - // Otherwise, if we get here, then we may either make it safe, or throw an exception. This - // depends on the context: some are sanitizatible (HTML), some use whitelists (RESOURCE_URL), - // some are impossible to do (JS). This step isn't implemented for CSS and URL, as AngularJS - // has no corresponding sinks. - if (type === SCE_CONTEXTS.RESOURCE_URL) { - // RESOURCE_URL uses a whitelist. + + // If maybeTrusted is a trusted class instance but not of the correct trusted type + // then unwrap it and allow it to pass through to the rest of the checks + if (isFunction(maybeTrusted.$$unwrapTrustedValue)) { + maybeTrusted = maybeTrusted.$$unwrapTrustedValue(); + } + + // If we get here, then we will either sanitize the value or throw an exception. + if (type === SCE_CONTEXTS.MEDIA_URL || type === SCE_CONTEXTS.URL) { + // we attempt to sanitize non-resource URLs + return $$sanitizeUri(maybeTrusted, type === SCE_CONTEXTS.MEDIA_URL); + } else if (type === SCE_CONTEXTS.RESOURCE_URL) { if (isResourceUrlAllowedByPolicy(maybeTrusted)) { return maybeTrusted; } else { @@ -572,9 +596,10 @@ function $SceDelegateProvider() { * * If your expressions are constant literals, they're automatically trusted and you don't need to * call `$sce.trustAs` on them (e.g. - * `
        `) just works. The `$sceDelegate` will - * also use the `$sanitize` service if it is available when binding untrusted values to - * `$sce.HTML` context. AngularJS provides an implementation in `angular-sanitize.js`, and if you + * `
        `) just works (remember to include the + * `ngSanitize` module). The `$sceDelegate` will also use the `$sanitize` service if it is available + * when binding untrusted values to `$sce.HTML` context. + * AngularJS provides an implementation in `angular-sanitize.js`, and if you * wish to use it, you will also need to depend on the {@link ngSanitize `ngSanitize`} module in * your application. * @@ -594,17 +619,27 @@ function $SceDelegateProvider() { * * | Context | Notes | * |---------------------|----------------| - * | `$sce.HTML` | For HTML that's safe to source into the application. The {@link ng.directive:ngBindHtml ngBindHtml} directive uses this context for bindings. If an unsafe value is encountered, and the {@link ngSanitize.$sanitize $sanitize} service is available (implemented by the {@link ngSanitize ngSanitize} module) this will sanitize the value instead of throwing an error. | - * | `$sce.CSS` | For CSS that's safe to source into the application. Currently, no bindings require this context. Feel free to use it in your own directives. | - * | `$sce.URL` | For URLs that are safe to follow as links. Currently unused (`

        Note that `$sce.RESOURCE_URL` makes a stronger statement about the URL than `$sce.URL` does (it's not just the URL that matters, but also what is at the end of it), and therefore contexts requiring values trusted for `$sce.RESOURCE_URL` can be used anywhere that values trusted for `$sce.URL` are required. | - * | `$sce.JS` | For JavaScript that is safe to execute in your application's context. Currently, no bindings require this context. Feel free to use it in your own directives. | + * | `$sce.HTML` | For HTML that's safe to source into the application. The {@link ng.directive:ngBindHtml ngBindHtml} directive uses this context for bindings. If an unsafe value is encountered and the {@link ngSanitize $sanitize} module is present this will sanitize the value instead of throwing an error. | + * | `$sce.CSS` | For CSS that's safe to source into the application. Currently unused. Feel free to use it in your own directives. | + * | `$sce.MEDIA_URL` | For URLs that are safe to render as media. Is automatically converted from string by sanitizing when needed. | + * | `$sce.URL` | For URLs that are safe to follow as links. Is automatically converted from string by sanitizing when needed. Note that `$sce.URL` makes a stronger statement about the URL than `$sce.MEDIA_URL` does and therefore contexts requiring values trusted for `$sce.URL` can be used anywhere that values trusted for `$sce.MEDIA_URL` are required.| + * | `$sce.RESOURCE_URL` | For URLs that are not only safe to follow as links, but whose contents are also safe to include in your application. Examples include `ng-include`, `src` / `ngSrc` bindings for tags other than `IMG` (e.g. `IFRAME`, `OBJECT`, etc.)

        Note that `$sce.RESOURCE_URL` makes a stronger statement about the URL than `$sce.URL` or `$sce.MEDIA_URL` do and therefore contexts requiring values trusted for `$sce.RESOURCE_URL` can be used anywhere that values trusted for `$sce.URL` or `$sce.MEDIA_URL` are required. | + * | `$sce.JS` | For JavaScript that is safe to execute in your application's context. Currently unused. Feel free to use it in your own directives. | + * + * + *
        + * Be aware that, before AngularJS 1.7.0, `a[href]` and `img[src]` used to sanitize their + * interpolated values directly rather than rely upon {@link ng.$sce#getTrusted `$sce.getTrusted`}. * + * **As of 1.7.0, this is no longer the case.** + * + * Now such interpolations are marked as requiring `$sce.URL` (for `a[href]`) or `$sce.MEDIA_URL` + * (for `img[src]`), so that the sanitization happens (via `$sce.getTrusted...`) when the `$interpolate` + * service evaluates the expressions. + *
        * - * Be aware that `a[href]` and `img[src]` automatically sanitize their URLs and do not pass them - * through {@link ng.$sce#getTrusted $sce.getTrusted}. There's no CSS-, URL-, or JS-context bindings - * in AngularJS currently, so their corresponding `$sce.trustAs` functions aren't useful yet. This - * might evolve. + * There are no CSS or JS context bindings in AngularJS currently, so their corresponding `$sce.trustAs` + * functions aren't useful yet. This might evolve. * * ### Format of items in {@link ng.$sceDelegateProvider#resourceUrlWhitelist resourceUrlWhitelist}/{@link ng.$sceDelegateProvider#resourceUrlBlacklist Blacklist}
        * @@ -778,7 +813,7 @@ function $SceProvider() { * such a value. * * - getTrusted(contextEnum, value) - * This function should return the a value that is safe to use in the context specified by + * This function should return the value that is safe to use in the context specified by * contextEnum or throw and exception otherwise. * * NOTE: This contract deliberately does NOT state that values returned by trustAs() must be diff --git a/src/ngSanitize/sanitize.js b/src/ngSanitize/sanitize.js index 4920a5756765..b08850fba065 100644 --- a/src/ngSanitize/sanitize.js +++ b/src/ngSanitize/sanitize.js @@ -41,12 +41,11 @@ var htmlSanitizeWriter; * Sanitizes an html string by stripping all potentially dangerous tokens. * * The input is sanitized by parsing the HTML into tokens. All safe tokens (from a whitelist) are - * then serialized back to properly escaped html string. This means that no unsafe input can make + * then serialized back to a properly escaped HTML string. This means that no unsafe input can make * it into the returned string. * * The whitelist for URL sanitization of attribute values is configured using the functions - * `aHrefSanitizationWhitelist` and `imgSrcSanitizationWhitelist` of {@link ng.$compileProvider - * `$compileProvider`}. + * `aHrefSanitizationWhitelist` and `imgSrcSanitizationWhitelist` of {@link $compileProvider}. * * The input may also contain SVG markup if this is enabled via {@link $sanitizeProvider}. * diff --git a/test/ng/compileSpec.js b/test/ng/compileSpec.js index 05a911ac6169..acda50470485 100644 --- a/test/ng/compileSpec.js +++ b/test/ng/compileSpec.js @@ -151,13 +151,34 @@ describe('$compile', function() { describe('configuration', function() { - it('should allow aHrefSanitizationWhitelist to be configured', function() { - module(function($compileProvider) { - expect($compileProvider.aHrefSanitizationWhitelist()).toEqual(/^\s*(https?|s?ftp|mailto|tel|file):/); // the default - $compileProvider.aHrefSanitizationWhitelist(/other/); - expect($compileProvider.aHrefSanitizationWhitelist()).toEqual(/other/); + it('should use $$sanitizeUriProvider for reconfiguration of the `aHrefSanitizationWhitelist`', function() { + module(function($compileProvider, $$sanitizeUriProvider) { + var newRe = /safe:/, returnVal; + + expect($compileProvider.aHrefSanitizationWhitelist()).toBe($$sanitizeUriProvider.aHrefSanitizationWhitelist()); + returnVal = $compileProvider.aHrefSanitizationWhitelist(newRe); + expect(returnVal).toBe($compileProvider); + expect($$sanitizeUriProvider.aHrefSanitizationWhitelist()).toBe(newRe); + expect($compileProvider.aHrefSanitizationWhitelist()).toBe(newRe); + }); + inject(function() { + // needed to the module definition above is run... + }); + }); + + it('should use $$sanitizeUriProvider for reconfiguration of the `imgSrcSanitizationWhitelist`', function() { + module(function($compileProvider, $$sanitizeUriProvider) { + var newRe = /safe:/, returnVal; + + expect($compileProvider.imgSrcSanitizationWhitelist()).toBe($$sanitizeUriProvider.imgSrcSanitizationWhitelist()); + returnVal = $compileProvider.imgSrcSanitizationWhitelist(newRe); + expect(returnVal).toBe($compileProvider); + expect($$sanitizeUriProvider.imgSrcSanitizationWhitelist()).toBe(newRe); + expect($compileProvider.imgSrcSanitizationWhitelist()).toBe(newRe); + }); + inject(function() { + // needed to the module definition above is run... }); - inject(); }); it('should allow debugInfoEnabled to be configured', function() { @@ -3393,6 +3414,15 @@ describe('$compile', function() { }) ); + it('should interpolate a multi-part expression for regular attributes', inject(function($compile, $rootScope) { + element = $compile('
        ')($rootScope); + $rootScope.$digest(); + expect(element.attr('foo')).toBe('some/'); + $rootScope.$apply(function() { + $rootScope.id = 1; + }); + expect(element.attr('foo')).toEqual('some/1'); + })); it('should process attribute interpolation in pre-linking phase at priority 100', function() { module(function() { @@ -4135,12 +4165,15 @@ describe('$compile', function() { var attr; beforeEach(function() { module(function() { - directive('input', valueFn({ - restrict: 'ECA', - link: function(scope, element, attr) { - scope.attr = attr; - } - })); + // Create directives that capture the `attr` object + ['input', 'a', 'img'].forEach(function(tag) { + directive(tag, valueFn({ + restrict: 'ECA', + link: function(scope, element, attr) { + scope.attr = attr; + } + })); + }); }); inject(function($compile, $rootScope) { element = $compile('')($rootScope); @@ -4187,6 +4220,37 @@ describe('$compile', function() { expect(element.attr('test')).toBeUndefined(); expect(attr.test).toBe('value'); }); + + it('should not automatically sanitize a[href]', inject(function($compile, $rootScope) { + // Breaking change in https://github.com/angular/angular.js/pull/16378 + element = $compile('')($rootScope); + $rootScope.attr.$set('href', 'evil:foo()'); + expect(element.attr('href')).toEqual('evil:foo()'); + expect($rootScope.attr.href).toEqual('evil:foo()'); + })); + + it('should not automatically sanitize img[src]', inject(function($compile, $rootScope) { + // Breaking change in https://github.com/angular/angular.js/pull/16378 + element = $compile('')($rootScope); + $rootScope.attr.$set('img', 'evil:foo()'); + expect(element.attr('img')).toEqual('evil:foo()'); + expect($rootScope.attr.img).toEqual('evil:foo()'); + })); + + it('should automatically sanitize img[srcset]', inject(function($compile, $rootScope) { + element = $compile('')($rootScope); + $rootScope.attr.$set('srcset', 'evil:foo()'); + expect(element.attr('srcset')).toEqual('unsafe:evil:foo()'); + expect($rootScope.attr.srcset).toEqual('unsafe:evil:foo()'); + })); + + it('should not accept trusted values for img[srcset]', inject(function($compile, $rootScope, $sce) { + var trusted = $sce.trustAsMediaUrl('trustme:foo()'); + element = $compile('')($rootScope); + expect(function() { + $rootScope.attr.$set('srcset', trusted); + }).toThrowMinErr('$compile', 'srcset', 'Can\'t pass trusted values to `$set(\'srcset\', value)`: "trustme:foo()"'); + })); }); }); @@ -11071,91 +11135,114 @@ describe('$compile', function() { ); }); - describe('*[src] context requirement', function() { - - it('should NOT require trusted values for img src', inject(function($rootScope, $compile, $sce) { - element = $compile('')($rootScope); - $rootScope.testUrl = 'http://example.com/image.png'; - $rootScope.$digest(); - expect(element.attr('src')).toEqual('http://example.com/image.png'); - // But it should accept trusted values anyway. - $rootScope.testUrl = $sce.trustAsUrl('http://example.com/image2.png'); - $rootScope.$digest(); - expect(element.attr('src')).toEqual('http://example.com/image2.png'); - })); - + ['img', 'audio', 'video'].forEach(function(tag) { // Support: IE 9 only - // IE9 rejects the video / audio tag with "Error: Not implemented" and the source tag with - // "Unable to get value of the property 'childNodes': object is null or undefined" - if (msie !== 9) { - they('should NOT require trusted values for $prop src', ['video', 'audio'], - function(tag) { - inject(function($rootScope, $compile, $sce) { + // IE9 rejects the `video` / `audio` tags with "Error: Not implemented" + if (msie !== 9 || tag === 'img') { + describe(tag + '[src] context requirement', function() { + it('should NOT require trusted values for whitelisted URIs', inject(function($rootScope, $compile) { element = $compile('<' + tag + ' src="{{testUrl}}">')($rootScope); - $rootScope.testUrl = 'http://example.com/image.mp4'; + $rootScope.testUrl = 'http://example.com/image.mp4'; // `http` is whitelisted $rootScope.$digest(); expect(element.attr('src')).toEqual('http://example.com/image.mp4'); + })); + + it('should accept trusted values', inject(function($rootScope, $compile, $sce) { + // As a MEDIA_URL URL + element = $compile('<' + tag + ' src="{{testUrl}}">')($rootScope); + // Some browsers complain if you try to write `javascript:` into an `img[src]` + // So for the test use something different + $rootScope.testUrl = $sce.trustAsMediaUrl('untrusted:foo()'); + $rootScope.$digest(); + expect(element.attr('src')).toEqual('untrusted:foo()'); - // But it should accept trusted values anyway. - $rootScope.testUrl = $sce.trustAsUrl('http://example.com/image2.mp4'); + // As a URL + element = $compile('<' + tag + ' src="{{testUrl}}">')($rootScope); + $rootScope.testUrl = $sce.trustAsUrl('untrusted:foo()'); $rootScope.$digest(); - expect(element.attr('src')).toEqual('http://example.com/image2.mp4'); + expect(element.attr('src')).toEqual('untrusted:foo()'); - // and trustedResourceUrls for retrocompatibility - $rootScope.testUrl = $sce.trustAsResourceUrl('http://example.com/image3.mp4'); + // As a RESOURCE URL + element = $compile('<' + tag + ' src="{{testUrl}}">')($rootScope); + $rootScope.testUrl = $sce.trustAsResourceUrl('untrusted:foo()'); $rootScope.$digest(); - expect(element.attr('src')).toEqual('http://example.com/image3.mp4'); - }); + expect(element.attr('src')).toEqual('untrusted:foo()'); + })); }); + } + }); - they('should NOT require trusted values for $prop src', ['source', 'track'], - function(tag) { - inject(function($rootScope, $compile, $sce) { + // Support: IE 9 only + // IE 9 rejects the `source` / `track` tags with + // "Unable to get value of the property 'childNodes': object is null or undefined" + if (msie !== 9) { + ['source', 'track'].forEach(function(tag) { + describe(tag + '[src]', function() { + it('should NOT require trusted values for whitelisted URIs', inject(function($rootScope, $compile) { element = $compile('')($rootScope); - $rootScope.testUrl = 'http://example.com/image.mp4'; + $rootScope.testUrl = 'http://example.com/image.mp4'; // `http` is whitelisted $rootScope.$digest(); expect(element.find(tag).attr('src')).toEqual('http://example.com/image.mp4'); + })); - // But it should accept trusted values anyway. - $rootScope.testUrl = $sce.trustAsUrl('http://example.com/image2.mp4'); + it('should accept trusted values', inject(function($rootScope, $compile, $sce) { + // As a MEDIA_URL URL + element = $compile('')($rootScope); + $rootScope.testUrl = $sce.trustAsMediaUrl('javascript:foo()'); $rootScope.$digest(); - expect(element.find(tag).attr('src')).toEqual('http://example.com/image2.mp4'); + expect(element.find(tag).attr('src')).toEqual('javascript:foo()'); - // and trustedResourceUrls for retrocompatibility - $rootScope.testUrl = $sce.trustAsResourceUrl('http://example.com/image3.mp4'); + // As a URL + element = $compile('')($rootScope); + $rootScope.testUrl = $sce.trustAsUrl('javascript:foo()'); $rootScope.$digest(); - expect(element.find(tag).attr('src')).toEqual('http://example.com/image3.mp4'); - }); + expect(element.find(tag).attr('src')).toEqual('javascript:foo()'); + + // As a RESOURCE URL + element = $compile('')($rootScope); + $rootScope.testUrl = $sce.trustAsResourceUrl('javascript:foo()'); + $rootScope.$digest(); + expect(element.find(tag).attr('src')).toEqual('javascript:foo()'); + })); }); - } - }); + }); + } describe('img[src] sanitization', function() { + it('should accept trusted values', inject(function($rootScope, $compile, $sce) { + element = $compile('')($rootScope); + // Some browsers complain if you try to write `javascript:` into an `img[src]` + // So for the test use something different + $rootScope.testUrl = $sce.trustAsMediaUrl('someUntrustedThing:foo();'); + $rootScope.$digest(); + expect(element.attr('src')).toEqual('someUntrustedThing:foo();'); + })); + + it('should sanitize concatenated values even if they are trusted', inject(function($rootScope, $compile, $sce) { + element = $compile('')($rootScope); + $rootScope.testUrl = $sce.trustAsUrl('untrusted:foo();'); + $rootScope.$digest(); + expect(element.attr('src')).toEqual('unsafe:untrusted:foo();ponies'); + + element = $compile('')($rootScope); + $rootScope.testUrl2 = $sce.trustAsUrl('xyz;'); + $rootScope.$digest(); + expect(element.attr('src')).toEqual('http://xyz;'); + + element = $compile('')($rootScope); + $rootScope.testUrl3 = $sce.trustAsUrl('untrusted:foo();'); + $rootScope.$digest(); + expect(element.attr('src')).toEqual('unsafe:untrusted:foo();untrusted:foo();'); + })); + it('should not sanitize attributes other than src', inject(function($compile, $rootScope) { element = $compile('')($rootScope); $rootScope.testUrl = 'javascript:doEvilStuff()'; $rootScope.$apply(); - expect(element.attr('title')).toBe('javascript:doEvilStuff()'); })); - it('should use $$sanitizeUriProvider for reconfiguration of the src whitelist', function() { - module(function($compileProvider, $$sanitizeUriProvider) { - var newRe = /javascript:/, - returnVal; - expect($compileProvider.imgSrcSanitizationWhitelist()).toBe($$sanitizeUriProvider.imgSrcSanitizationWhitelist()); - - returnVal = $compileProvider.imgSrcSanitizationWhitelist(newRe); - expect(returnVal).toBe($compileProvider); - expect($$sanitizeUriProvider.imgSrcSanitizationWhitelist()).toBe(newRe); - expect($compileProvider.imgSrcSanitizationWhitelist()).toBe(newRe); - }); - inject(function() { - // needed to the module definition above is run... - }); - }); - it('should use $$sanitizeUri', function() { var $$sanitizeUri = jasmine.createSpy('$$sanitizeUri'); module(function($provide) { @@ -11171,55 +11258,113 @@ describe('$compile', function() { expect($$sanitizeUri).toHaveBeenCalledWith($rootScope.testUrl, true); }); }); + + + it('should use $$sanitizeUri on concatenated trusted values', function() { + var $$sanitizeUri = jasmine.createSpy('$$sanitizeUri').and.returnValue('someSanitizedUrl'); + module(function($provide) { + $provide.value('$$sanitizeUri', $$sanitizeUri); + }); + inject(function($compile, $rootScope, $sce) { + element = $compile('')($rootScope); + $rootScope.testUrl = $sce.trustAsUrl('javascript:foo();'); + $rootScope.$digest(); + expect(element.attr('src')).toEqual('someSanitizedUrl'); + + element = $compile('')($rootScope); + $rootScope.testUrl = $sce.trustAsUrl('xyz'); + $rootScope.$digest(); + expect(element.attr('src')).toEqual('someSanitizedUrl'); + }); + }); + + it('should not use $$sanitizeUri with trusted values', function() { + var $$sanitizeUri = jasmine.createSpy('$$sanitizeUri').and.throwError('Should not have been called'); + module(function($provide) { + $provide.value('$$sanitizeUri', $$sanitizeUri); + }); + inject(function($compile, $rootScope, $sce) { + element = $compile('')($rootScope); + // Assigning javascript:foo to src makes at least IE9-11 complain, so use another + // protocol name. + $rootScope.testUrl = $sce.trustAsMediaUrl('untrusted:foo();'); + $rootScope.$apply(); + expect(element.attr('src')).toEqual('untrusted:foo();'); + }); + }); }); describe('img[srcset] sanitization', function() { - - it('should not error if undefined', function() { + it('should not error if srcset is undefined', function() { var linked = false; module(function() { directive('setter', valueFn(function(scope, elem, attrs) { + // Set srcset to a value attrs.$set('srcset', 'http://example.com/'); expect(attrs.srcset).toBe('http://example.com/'); - + // Now set it to undefined attrs.$set('srcset', undefined); expect(attrs.srcset).toBeUndefined(); - linked = true; })); }); inject(function($compile, $rootScope) { element = $compile('')($rootScope); - expect(linked).toBe(true); expect(element.attr('srcset')).toBeUndefined(); }); }); - it('should NOT require trusted values for img srcset', inject(function($rootScope, $compile, $sce) { + it('should NOT require trusted values for whitelisted values', inject(function($rootScope, $compile, $sce) { element = $compile('')($rootScope); - $rootScope.testUrl = 'http://example.com/image.png'; + $rootScope.testUrl = 'http://example.com/image.png'; // `http` is whitelisted $rootScope.$digest(); expect(element.attr('srcset')).toEqual('http://example.com/image.png'); - // But it should accept trusted values anyway. - $rootScope.testUrl = $sce.trustAsUrl('http://example.com/image2.png'); + })); + + it('should accept trusted values, if they are also whitelisted', inject(function($rootScope, $compile, $sce) { + element = $compile('')($rootScope); + $rootScope.testUrl = $sce.trustAsUrl('http://example.com'); $rootScope.$digest(); - expect(element.attr('srcset')).toEqual('http://example.com/image2.png'); + expect(element.attr('srcset')).toEqual('http://example.com'); + })); + + it('does not work with trusted values', inject(function($rootScope, $compile, $sce) { + // A limitation of the approach used for srcset is that you cannot use `trustAsUrl`. + // Use trustAsHtml and ng-bind-html to work around this. + element = $compile('')($rootScope); + $rootScope.testUrl = $sce.trustAsUrl('javascript:something'); + $rootScope.$digest(); + expect(element.attr('srcset')).toEqual('unsafe:javascript:something'); + + element = $compile('')($rootScope); + $rootScope.testUrl = $sce.trustAsUrl('javascript:something'); + $rootScope.$digest(); + expect(element.attr('srcset')).toEqual( + 'unsafe:javascript:something ,unsafe:javascript:something'); })); it('should use $$sanitizeUri', function() { - var $$sanitizeUri = jasmine.createSpy('$$sanitizeUri'); + var $$sanitizeUri = jasmine.createSpy('$$sanitizeUri').and.returnValue('someSanitizedUrl'); module(function($provide) { $provide.value('$$sanitizeUri', $$sanitizeUri); }); inject(function($compile, $rootScope) { element = $compile('')($rootScope); $rootScope.testUrl = 'someUrl'; - - $$sanitizeUri.and.returnValue('someSanitizedUrl'); $rootScope.$apply(); expect(element.attr('srcset')).toBe('someSanitizedUrl'); expect($$sanitizeUri).toHaveBeenCalledWith($rootScope.testUrl, true); + + element = $compile('')($rootScope); + $rootScope.testUrl = 'javascript:yay'; + $rootScope.$apply(); + expect(element.attr('srcset')).toEqual('someSanitizedUrl ,someSanitizedUrl'); + + element = $compile('')($rootScope); + $rootScope.testUrl = 'script:yay, javascript:nay'; + $rootScope.$apply(); + expect(element.attr('srcset')).toEqual('someSanitizedUrl ,someSanitizedUrl'); }); }); @@ -11263,6 +11408,38 @@ describe('$compile', function() { }); describe('a[href] sanitization', function() { + it('should NOT require trusted values for whitelisted values', inject(function($rootScope, $compile) { + $rootScope.testUrl = 'http://example.com/image.png'; // `http` is whitelisted + element = $compile('')($rootScope); + $rootScope.$digest(); + expect(element.attr('href')).toEqual('http://example.com/image.png'); + + element = $compile('')($rootScope); + $rootScope.$digest(); + expect(element.attr('ng-href')).toEqual('http://example.com/image.png'); + })); + + it('should accept trusted values for non-whitelisted values', inject(function($rootScope, $compile, $sce) { + $rootScope.testUrl = $sce.trustAsUrl('javascript:foo()'); // `javascript` is not whitelisted + element = $compile('')($rootScope); + $rootScope.$digest(); + expect(element.attr('href')).toEqual('javascript:foo()'); + + element = $compile('')($rootScope); + $rootScope.$digest(); + expect(element.attr('ng-href')).toEqual('javascript:foo()'); + })); + + it('should sanitize non-whitelisted values', inject(function($rootScope, $compile) { + $rootScope.testUrl = 'javascript:foo()'; // `javascript` is not whitelisted + element = $compile('')($rootScope); + $rootScope.$digest(); + expect(element.attr('href')).toEqual('unsafe:javascript:foo()'); + + element = $compile('')($rootScope); + $rootScope.$digest(); + expect(element.attr('href')).toEqual('unsafe:javascript:foo()'); + })); it('should not sanitize href on elements other than anchor', inject(function($compile, $rootScope) { element = $compile('
        ')($rootScope); @@ -11272,7 +11449,7 @@ describe('$compile', function() { expect(element.attr('href')).toBe('javascript:doEvilStuff()'); })); - it('should not sanitize attributes other than href', inject(function($compile, $rootScope) { + it('should not sanitize attributes other than href/ng-href', inject(function($compile, $rootScope) { element = $compile('')($rootScope); $rootScope.testUrl = 'javascript:doEvilStuff()'; $rootScope.$apply(); @@ -11280,48 +11457,21 @@ describe('$compile', function() { expect(element.attr('title')).toBe('javascript:doEvilStuff()'); })); - it('should use $$sanitizeUriProvider for reconfiguration of the href whitelist', function() { - module(function($compileProvider, $$sanitizeUriProvider) { - var newRe = /javascript:/, - returnVal; - expect($compileProvider.aHrefSanitizationWhitelist()).toBe($$sanitizeUriProvider.aHrefSanitizationWhitelist()); - - returnVal = $compileProvider.aHrefSanitizationWhitelist(newRe); - expect(returnVal).toBe($compileProvider); - expect($$sanitizeUriProvider.aHrefSanitizationWhitelist()).toBe(newRe); - expect($compileProvider.aHrefSanitizationWhitelist()).toBe(newRe); - }); - inject(function() { - // needed to the module definition above is run... - }); - }); - it('should use $$sanitizeUri', function() { - var $$sanitizeUri = jasmine.createSpy('$$sanitizeUri'); + var $$sanitizeUri = jasmine.createSpy('$$sanitizeUri').and.returnValue('someSanitizedUrl'); module(function($provide) { $provide.value('$$sanitizeUri', $$sanitizeUri); }); inject(function($compile, $rootScope) { element = $compile('')($rootScope); $rootScope.testUrl = 'someUrl'; - - $$sanitizeUri.and.returnValue('someSanitizedUrl'); $rootScope.$apply(); expect(element.attr('href')).toBe('someSanitizedUrl'); expect($$sanitizeUri).toHaveBeenCalledWith($rootScope.testUrl, false); - }); - }); - it('should use $$sanitizeUri when declared via ng-href', function() { - var $$sanitizeUri = jasmine.createSpy('$$sanitizeUri'); - module(function($provide) { - $provide.value('$$sanitizeUri', $$sanitizeUri); - }); - inject(function($compile, $rootScope) { - element = $compile('')($rootScope); - $rootScope.testUrl = 'someUrl'; + $$sanitizeUri.calls.reset(); - $$sanitizeUri.and.returnValue('someSanitizedUrl'); + element = $compile('')($rootScope); $rootScope.$apply(); expect(element.attr('href')).toBe('someSanitizedUrl'); expect($$sanitizeUri).toHaveBeenCalledWith($rootScope.testUrl, false); @@ -11329,72 +11479,72 @@ describe('$compile', function() { }); it('should use $$sanitizeUri when working with svg and xlink:href', function() { - var $$sanitizeUri = jasmine.createSpy('$$sanitizeUri'); + var $$sanitizeUri = jasmine.createSpy('$$sanitizeUri').and.returnValue('https://clean.example.org'); module(function($provide) { $provide.value('$$sanitizeUri', $$sanitizeUri); }); inject(function($compile, $rootScope) { - var elementA = $compile('')($rootScope); - var elementImage = $compile('')($rootScope); - - //both of these fail the RESOURCE_URL test, that shouldn't be run + // This URL would fail the RESOURCE_URL whitelist, but that test shouldn't be run + // because these interpolations will be resolved against the URL context instead $rootScope.testUrl = 'https://bad.example.org'; - $$sanitizeUri.and.returnValue('https://clean.example.org'); + var elementA = $compile('')($rootScope); $rootScope.$apply(); expect(elementA.find('a').attr('xlink:href')).toBe('https://clean.example.org'); + expect($$sanitizeUri).toHaveBeenCalledWith($rootScope.testUrl + 'aTag', false); + + var elementImage = $compile('')($rootScope); + $rootScope.$apply(); expect(elementImage.find('image').attr('xlink:href')).toBe('https://clean.example.org'); - // is navigational, so the second argument should be false to reach the aHref whitelist - expect($$sanitizeUri).toHaveBeenCalledWith($rootScope.testUrl + 'aTag' , false); - // is media inclusion, it should use the imgSrc whitelist expect($$sanitizeUri).toHaveBeenCalledWith($rootScope.testUrl + 'imageTag', true); }); }); it('should use $$sanitizeUri when working with svg and xlink:href through ng-href', function() { - var $$sanitizeUri = jasmine.createSpy('$$sanitizeUri'); + var $$sanitizeUri = jasmine.createSpy('$$sanitizeUri').and.returnValue('https://clean.example.org'); module(function($provide) { $provide.value('$$sanitizeUri', $$sanitizeUri); }); inject(function($compile, $rootScope) { - element = $compile('')($rootScope); - //both of these fail the RESOURCE_URL test, that shouldn't be run + // This URL would fail the RESOURCE_URL whitelist, but that test shouldn't be run + // because these interpolations will be resolved against the URL context instead $rootScope.testUrl = 'https://bad.example.org'; - $$sanitizeUri.and.returnValue('https://clean.example.org'); - - $rootScope.$apply(); - expect(element.find('a').prop('href').baseVal).toBe('https://clean.example.org'); - expect($$sanitizeUri).toHaveBeenCalledWith($rootScope.testUrl, false); - }); - }); - - it('should use $$sanitizeUri when working with svg and xlink:href through ng-href', function() { - var $$sanitizeUri = jasmine.createSpy('$$sanitizeUri'); - module(function($provide) { - $provide.value('$$sanitizeUri', $$sanitizeUri); - }); - inject(function($compile, $rootScope) { element = $compile('')($rootScope); - $rootScope.testUrl = 'evilUrl'; - - $$sanitizeUri.and.returnValue('someSanitizedUrl'); $rootScope.$apply(); - expect(element.find('a').prop('href').baseVal).toBe('someSanitizedUrl'); + expect(element.find('a').prop('href').baseVal).toBe('https://clean.example.org'); expect($$sanitizeUri).toHaveBeenCalledWith($rootScope.testUrl, false); }); }); - it('should have a RESOURCE_URL context for xlink:href by default', function() { + it('should require a RESOURCE_URL context for xlink:href by if not on an anchor or image', function() { inject(function($compile, $rootScope) { element = $compile('')($rootScope); $rootScope.testUrl = 'https://bad.example.org'; expect(function() { $rootScope.$apply(); - }).toThrowError(/\$sce:insecurl/); + }).toThrowMinErr('$interpolate', 'interr', 'Can\'t interpolate: {{ testUrl }}\n' + + 'Error: [$sce:insecurl] Blocked loading resource from url not allowed by $sceDelegate policy. ' + + 'URL: https://bad.example.org'); }); }); + + it('should not have endless digests when given arrays in concatenable context', inject(function($compile, $rootScope) { + element = $compile('' + + '')($rootScope); + $rootScope.testUrl = [1]; + $rootScope.$digest(); + + $rootScope.testUrl = []; + $rootScope.$digest(); + + $rootScope.testUrl = {a:'b'}; + $rootScope.$digest(); + + $rootScope.testUrl = {}; + $rootScope.$digest(); + })); }); describe('interpolation on HTML DOM event handler attributes onclick, onXYZ, formaction', function() { diff --git a/test/ng/directive/booleanAttrsSpec.js b/test/ng/directive/booleanAttrsSpec.js index ac6cbdcbfd04..8d68ab999666 100644 --- a/test/ng/directive/booleanAttrsSpec.js +++ b/test/ng/directive/booleanAttrsSpec.js @@ -118,211 +118,3 @@ describe('boolean attr directives', function() { })); }); }); - - -describe('ngSrc', function() { - it('should interpolate the expression and bind to src with raw same-domain value', - inject(function($compile, $rootScope) { - var element = $compile('
        ')($rootScope); - - $rootScope.$digest(); - expect(element.attr('src')).toBeUndefined(); - - $rootScope.$apply(function() { - $rootScope.id = '/somewhere/here'; - }); - expect(element.attr('src')).toEqual('/somewhere/here'); - - dealoc(element); - })); - - - it('should interpolate the expression and bind to src with a trusted value', inject(function($compile, $rootScope, $sce) { - var element = $compile('
        ')($rootScope); - - $rootScope.$digest(); - expect(element.attr('src')).toBeUndefined(); - - $rootScope.$apply(function() { - $rootScope.id = $sce.trustAsResourceUrl('http://somewhere'); - }); - expect(element.attr('src')).toEqual('http://somewhere'); - - dealoc(element); - })); - - - it('should NOT interpolate a multi-part expression for non-img src attribute', inject(function($compile, $rootScope) { - expect(function() { - var element = $compile('
        ')($rootScope); - dealoc(element); - }).toThrowMinErr( - '$interpolate', 'noconcat', 'Error while interpolating: some/{{id}}\nStrict ' + - 'Contextual Escaping disallows interpolations that concatenate multiple expressions ' + - 'when a trusted value is required. See http://docs.angularjs.org/api/ng.$sce'); - })); - - - it('should interpolate a multi-part expression for regular attributes', inject(function($compile, $rootScope) { - var element = $compile('
        ')($rootScope); - $rootScope.$digest(); - expect(element.attr('foo')).toBe('some/'); - $rootScope.$apply(function() { - $rootScope.id = 1; - }); - expect(element.attr('foo')).toEqual('some/1'); - })); - - - it('should NOT interpolate a wrongly typed expression', inject(function($compile, $rootScope, $sce) { - expect(function() { - var element = $compile('
        ')($rootScope); - $rootScope.$apply(function() { - $rootScope.id = $sce.trustAsUrl('http://somewhere'); - }); - element.attr('src'); - }).toThrowMinErr( - '$interpolate', 'interr', 'Can\'t interpolate: {{id}}\nError: [$sce:insecurl] Blocked ' + - 'loading resource from url not allowed by $sceDelegate policy. URL: http://somewhere'); - })); - - - // Support: IE 9-11 only - if (msie) { - it('should update the element property as well as the attribute', inject( - function($compile, $rootScope, $sce) { - // on IE, if "ng:src" directive declaration is used and "src" attribute doesn't exist - // then calling element.setAttribute('src', 'foo') doesn't do anything, so we need - // to set the property as well to achieve the desired effect - - var element = $compile('
        ')($rootScope); - - $rootScope.$digest(); - expect(element.prop('src')).toBeUndefined(); - dealoc(element); - - element = $compile('
        ')($rootScope); - - $rootScope.$digest(); - expect(element.prop('src')).toEqual('some/'); - dealoc(element); - - element = $compile('
        ')($rootScope); - $rootScope.$apply(function() { - $rootScope.id = $sce.trustAsResourceUrl('http://somewhere'); - }); - expect(element.prop('src')).toEqual('http://somewhere'); - - dealoc(element); - })); - } -}); - - -describe('ngSrcset', function() { - it('should interpolate the expression and bind to srcset', inject(function($compile, $rootScope) { - var element = $compile('
        ')($rootScope); - - $rootScope.$digest(); - expect(element.attr('srcset')).toBeUndefined(); - - $rootScope.$apply(function() { - $rootScope.id = 1; - }); - expect(element.attr('srcset')).toEqual('some/1 2x'); - - dealoc(element); - })); -}); - - -describe('ngHref', function() { - var element; - - afterEach(function() { - dealoc(element); - }); - - - it('should interpolate the expression and bind to href', inject(function($compile, $rootScope) { - element = $compile('
        ')($rootScope); - $rootScope.$digest(); - expect(element.attr('href')).toEqual('some/'); - - $rootScope.$apply(function() { - $rootScope.id = 1; - }); - expect(element.attr('href')).toEqual('some/1'); - })); - - - it('should bind href and merge with other attrs', inject(function($rootScope, $compile) { - element = $compile('
        ')($rootScope); - $rootScope.url = 'http://server'; - $rootScope.rel = 'REL'; - $rootScope.$digest(); - expect(element.attr('href')).toEqual('http://server'); - expect(element.attr('rel')).toEqual('REL'); - })); - - - it('should bind href even if no interpolation', inject(function($rootScope, $compile) { - element = $compile('')($rootScope); - $rootScope.$digest(); - expect(element.attr('href')).toEqual('http://server'); - })); - - it('should not set the href if ng-href is empty', inject(function($rootScope, $compile) { - $rootScope.url = null; - element = $compile('')($rootScope); - $rootScope.$digest(); - expect(element.attr('href')).toEqual(undefined); - })); - - it('should remove the href if ng-href changes to empty', inject(function($rootScope, $compile) { - $rootScope.url = 'http://www.google.com/'; - element = $compile('')($rootScope); - $rootScope.$digest(); - - $rootScope.url = null; - $rootScope.$digest(); - expect(element.attr('href')).toEqual(undefined); - })); - - // Support: IE 9-11 only, Edge 12-15+ - if (msie || /\bEdge\/[\d.]+\b/.test(window.navigator.userAgent)) { - // IE/Edge fail when setting a href to a URL containing a % that isn't a valid escape sequence - // See https://github.com/angular/angular.js/issues/13388 - it('should throw error if ng-href contains a non-escaped percent symbol', inject(function($rootScope, $compile) { - element = $compile('')($rootScope); - - expect(function() { - $rootScope.$digest(); - }).toThrow(); - })); - } - - if (isDefined(window.SVGElement)) { - describe('SVGAElement', function() { - it('should interpolate the expression and bind to xlink:href', inject(function($compile, $rootScope) { - element = $compile('')($rootScope); - var child = element.children('a'); - $rootScope.$digest(); - expect(child.attr('xlink:href')).toEqual('some/'); - - $rootScope.$apply(function() { - $rootScope.id = 1; - }); - expect(child.attr('xlink:href')).toEqual('some/1'); - })); - - - it('should bind xlink:href even if no interpolation', inject(function($rootScope, $compile) { - element = $compile('')($rootScope); - var child = element.children('a'); - $rootScope.$digest(); - expect(child.attr('xlink:href')).toEqual('http://server'); - })); - }); - } -}); diff --git a/test/ng/directive/ngHrefSpec.js b/test/ng/directive/ngHrefSpec.js new file mode 100644 index 000000000000..6d44ac8b5631 --- /dev/null +++ b/test/ng/directive/ngHrefSpec.js @@ -0,0 +1,105 @@ +'use strict'; + +describe('ngHref', function() { + var element; + + afterEach(function() { + dealoc(element); + }); + + + it('should interpolate the expression and bind to href', inject(function($compile, $rootScope) { + element = $compile('')($rootScope); + $rootScope.$digest(); + expect(element.attr('href')).toEqual('some/'); + + $rootScope.$apply(function() { + $rootScope.id = 1; + }); + expect(element.attr('href')).toEqual('some/1'); + })); + + + it('should bind href and merge with other attrs', inject(function($rootScope, $compile) { + element = $compile('')($rootScope); + $rootScope.url = 'http://server'; + $rootScope.rel = 'REL'; + $rootScope.$digest(); + expect(element.attr('href')).toEqual('http://server'); + expect(element.attr('rel')).toEqual('REL'); + })); + + + it('should bind href even if no interpolation', inject(function($rootScope, $compile) { + element = $compile('')($rootScope); + $rootScope.$digest(); + expect(element.attr('href')).toEqual('http://server'); + })); + + it('should not set the href if ng-href is empty', inject(function($rootScope, $compile) { + $rootScope.url = null; + element = $compile('')($rootScope); + $rootScope.$digest(); + expect(element.attr('href')).toEqual(undefined); + })); + + it('should remove the href if ng-href changes to empty', inject(function($rootScope, $compile) { + $rootScope.url = 'http://www.google.com/'; + element = $compile('')($rootScope); + $rootScope.$digest(); + + $rootScope.url = null; + $rootScope.$digest(); + expect(element.attr('href')).toEqual(undefined); + })); + + it('should sanitize interpolated url', inject(function($rootScope, $compile) { + /* eslint no-script-url: "off" */ + $rootScope.imageUrl = 'javascript:alert(1);'; + element = $compile('')($rootScope); + $rootScope.$digest(); + expect(element.attr('href')).toBe('unsafe:javascript:alert(1);'); + })); + + it('should sanitize non-interpolated url', inject(function($rootScope, $compile) { + element = $compile('')($rootScope); + $rootScope.$digest(); + expect(element.attr('href')).toBe('unsafe:javascript:alert(1);'); + })); + + + // Support: IE 9-11 only, Edge 12-15+ + if (msie || /\bEdge\/[\d.]+\b/.test(window.navigator.userAgent)) { + // IE/Edge fail when setting a href to a URL containing a % that isn't a valid escape sequence + // See https://github.com/angular/angular.js/issues/13388 + it('should throw error if ng-href contains a non-escaped percent symbol', inject(function($rootScope, $compile) { + expect(function() { + element = $compile('')($rootScope); + }).toThrow(); + })); + } + + if (isDefined(window.SVGElement)) { + describe('SVGAElement', function() { + it('should interpolate the expression and bind to xlink:href', inject(function($compile, $rootScope) { + element = $compile('')($rootScope); + var child = element.children('a'); + $rootScope.$digest(); + expect(child.attr('xlink:href')).toEqual('some/'); + + $rootScope.$apply(function() { + $rootScope.id = 1; + }); + expect(child.attr('xlink:href')).toEqual('some/1'); + })); + + + it('should bind xlink:href even if no interpolation', inject(function($rootScope, $compile) { + element = $compile('')($rootScope); + var child = element.children('a'); + $rootScope.$digest(); + expect(child.attr('xlink:href')).toEqual('http://server'); + })); + }); + } +}); diff --git a/test/ng/directive/ngSrcSpec.js b/test/ng/directive/ngSrcSpec.js index 6c971a0b0419..5d2a067026b8 100644 --- a/test/ng/directive/ngSrcSpec.js +++ b/test/ng/directive/ngSrcSpec.js @@ -18,12 +18,66 @@ describe('ngSrc', function() { expect(element.attr('src')).toBeUndefined(); })); - it('should sanitize url', inject(function($rootScope, $compile) { + it('should sanitize interpolated url', inject(function($rootScope, $compile) { $rootScope.imageUrl = 'javascript:alert(1);'; element = $compile('')($rootScope); $rootScope.$digest(); expect(element.attr('src')).toBe('unsafe:javascript:alert(1);'); })); + + it('should sanitize non-interpolated url', inject(function($rootScope, $compile) { + element = $compile('')($rootScope); + $rootScope.$digest(); + expect(element.attr('src')).toBe('unsafe:javascript:alert(1);'); + })); + + it('should interpolate the expression and bind to src with raw same-domain value', inject(function($compile, $rootScope) { + element = $compile('')($rootScope); + + $rootScope.$digest(); + expect(element.attr('src')).toBeUndefined(); + + $rootScope.$apply(function() { + $rootScope.id = '/somewhere/here'; + }); + expect(element.attr('src')).toEqual('/somewhere/here'); + })); + + it('should interpolate a multi-part expression for img src attribute (which requires the MEDIA_URL context)', inject(function($compile, $rootScope) { + element = $compile('')($rootScope); + expect(element.attr('src')).toBe(undefined); // URL concatenations are all-or-nothing + $rootScope.$apply(function() { + $rootScope.id = 1; + }); + expect(element.attr('src')).toEqual('some/1'); + })); + + // Support: IE 9-11 only + if (msie) { + it('should update the element property as well as the attribute', inject(function($compile, $rootScope, $sce) { + // on IE, if "ng:src" directive declaration is used and "src" attribute doesn't exist + // then calling element.setAttribute('src', 'foo') doesn't do anything, so we need + // to set the property as well to achieve the desired effect + + element = $compile('')($rootScope); + + $rootScope.$digest(); + expect(element.prop('src')).toBe(''); + dealoc(element); + + element = $compile('')($rootScope); + + $rootScope.$digest(); + expect(element.prop('src')).toMatch('/some/$'); + dealoc(element); + + element = $compile('')($rootScope); + $rootScope.$apply(function() { + $rootScope.id = $sce.trustAsResourceUrl('http://somewhere/abc'); + }); + expect(element.prop('src')).toEqual('http://somewhere/abc'); + })); + } }); describe('iframe[ng-src]', function() { @@ -68,5 +122,43 @@ describe('ngSrc', function() { expect(element.attr('src')).toEqual('javascript:doTrustedStuff()'); })); + + it('should interpolate the expression and bind to src with a trusted value', inject(function($compile, $rootScope, $sce) { + element = $compile('')($rootScope); + + $rootScope.$digest(); + expect(element.attr('src')).toBeUndefined(); + + $rootScope.$apply(function() { + $rootScope.id = $sce.trustAsResourceUrl('http://somewhere'); + }); + expect(element.attr('src')).toEqual('http://somewhere'); + })); + + + it('should NOT interpolate a multi-part expression in a `src` attribute that requires a non-MEDIA_URL context', inject(function($compile, $rootScope) { + expect(function() { + element = $compile('')($rootScope); + $rootScope.$apply(function() { + $rootScope.id = 1; + }); + }).toThrowMinErr( + '$interpolate', 'noconcat', 'Error while interpolating: some/{{id}}\nStrict ' + + 'Contextual Escaping disallows interpolations that concatenate multiple expressions ' + + 'when a trusted value is required. See http://docs.angularjs.org/api/ng.$sce'); + })); + + + it('should NOT interpolate a wrongly typed expression', inject(function($compile, $rootScope, $sce) { + expect(function() { + element = $compile('')($rootScope); + $rootScope.$apply(function() { + $rootScope.id = $sce.trustAsUrl('http://somewhere'); + }); + element.attr('src'); + }).toThrowMinErr( + '$interpolate', 'interr', 'Can\'t interpolate: {{id}}\nError: [$sce:insecurl] Blocked ' + + 'loading resource from url not allowed by $sceDelegate policy. URL: http://somewhere'); + })); }); }); diff --git a/test/ng/directive/ngSrcsetSpec.js b/test/ng/directive/ngSrcsetSpec.js index 15aba45b5749..b8032a77cba5 100644 --- a/test/ng/directive/ngSrcsetSpec.js +++ b/test/ng/directive/ngSrcsetSpec.js @@ -34,5 +34,18 @@ describe('ngSrcset', function() { element = $compile('')($rootScope); $rootScope.$digest(); })); -}); + it('should interpolate the expression and bind to srcset', inject(function($compile, $rootScope) { + var element = $compile('')($rootScope); + + $rootScope.$digest(); + expect(element.attr('srcset')).toBeUndefined(); + + $rootScope.$apply(function() { + $rootScope.id = 1; + }); + expect(element.attr('srcset')).toEqual('some/1 2x'); + + dealoc(element); + })); +}); diff --git a/test/ng/interpolateSpec.js b/test/ng/interpolateSpec.js index 2ed9b31b7f5f..43c5fc4ac275 100644 --- a/test/ng/interpolateSpec.js +++ b/test/ng/interpolateSpec.js @@ -1,5 +1,7 @@ 'use strict'; +/* eslint-disable no-script-url */ + describe('$interpolate', function() { it('should return the interpolation object when there are no bindings and textOnly is undefined', @@ -267,7 +269,9 @@ describe('$interpolate', function() { expect(function() { $interpolate('{{foo}}', true, sce.CSS)(scope); - }).toThrowMinErr('$interpolate', 'interr'); + }).toThrowMinErr( + '$interpolate', 'interr', 'Can\'t interpolate: {{foo}}\nError: [$sce:unsafe] ' + + 'Attempting to use an unsafe value in a safe context.'); })); it('should NOT interpolate mistyped expressions', inject(function($interpolate, $rootScope) { @@ -276,7 +280,9 @@ describe('$interpolate', function() { expect(function() { $interpolate('{{foo}}', true, sce.HTML)(scope); - }).toThrowMinErr('$interpolate', 'interr'); + }).toThrowMinErr( + '$interpolate', 'interr', 'Can\'t interpolate: {{foo}}\nError: [$sce:unsafe] ' + + 'Attempting to use an unsafe value in a safe context.'); })); it('should interpolate trusted expressions in a regular context', inject(function($interpolate) { @@ -291,17 +297,16 @@ describe('$interpolate', function() { // The concatenation of trusted values does not necessarily result in a trusted value. (For // instance, you can construct evil JS code by putting together pieces of JS strings that are by - // themselves safe to execute in isolation.) + // themselves safe to execute in isolation). Therefore, some contexts disable it, such as CSS. it('should NOT interpolate trusted expressions with multiple parts', inject(function($interpolate) { var foo = sce.trustAsCss('foo'); var bar = sce.trustAsCss('bar'); expect(function() { return $interpolate('{{foo}}{{bar}}', true, sce.CSS)({foo: foo, bar: bar}); }).toThrowMinErr( - '$interpolate', 'noconcat', 'Error while interpolating: {{foo}}{{bar}}\n' + + '$interpolate', 'interr', 'Error while interpolating: {{foo}}{{bar}}\n' + 'Strict Contextual Escaping disallows interpolations that concatenate multiple ' + - 'expressions when a trusted value is required. See ' + - 'http://docs.angularjs.org/api/ng.$sce'); + 'expressions when a trusted value is required. See http://docs.angularjs.org/api/ng.$sce'); })); }); @@ -380,26 +385,32 @@ describe('$interpolate', function() { describe('isTrustedContext', function() { - it('should NOT interpolate a multi-part expression when isTrustedContext is true', inject(function($interpolate) { - var isTrustedContext = true; + it('should NOT interpolate a multi-part expression when isTrustedContext is RESOURCE_URL', inject(function($sce, $interpolate) { + var isTrustedContext = $sce.RESOURCE_URL; expect(function() { - $interpolate('constant/{{var}}', true, isTrustedContext); + $interpolate('constant/{{var}}', true, isTrustedContext)('val'); }).toThrowMinErr( - '$interpolate', 'noconcat', 'Error while interpolating: constant/{{var}}\nStrict ' + - 'Contextual Escaping disallows interpolations that concatenate multiple expressions ' + - 'when a trusted value is required. See http://docs.angularjs.org/api/ng.$sce'); + '$interpolate', 'interr', + 'Can\'t interpolate: constant/{{var}}\nError: [$interpolate:noconcat] Error while ' + + 'interpolating: constant/{{var}}\nStrict Contextual Escaping disallows interpolations ' + + 'that concatenate multiple expressions when a trusted value is required. ' + + 'See http://docs.angularjs.org/api/ng.$sce'); expect(function() { - $interpolate('{{var}}/constant', true, isTrustedContext); + $interpolate('{{var}}/constant', true, isTrustedContext)('val'); }).toThrowMinErr( - '$interpolate', 'noconcat', 'Error while interpolating: {{var}}/constant\nStrict ' + - 'Contextual Escaping disallows interpolations that concatenate multiple expressions ' + - 'when a trusted value is required. See http://docs.angularjs.org/api/ng.$sce'); - expect(function() { - $interpolate('{{foo}}{{bar}}', true, isTrustedContext); + '$interpolate', 'interr', + 'Can\'t interpolate: {{var}}/constant\nError: [$interpolate:noconcat] Error while ' + + 'interpolating: {{var}}/constant\nStrict Contextual Escaping disallows interpolations ' + + 'that concatenate multiple expressions when a trusted value is required. ' + + 'See http://docs.angularjs.org/api/ng.$sce'); + expect(function() { + $interpolate('{{foo}}{{bar}}', true, isTrustedContext)('val'); }).toThrowMinErr( - '$interpolate', 'noconcat', 'Error while interpolating: {{foo}}{{bar}}\nStrict ' + - 'Contextual Escaping disallows interpolations that concatenate multiple expressions ' + - 'when a trusted value is required. See http://docs.angularjs.org/api/ng.$sce'); + '$interpolate', 'interr', + 'Can\'t interpolate: {{foo}}{{bar}}\nError: [$interpolate:noconcat] Error while ' + + 'interpolating: {{foo}}{{bar}}\nStrict Contextual Escaping disallows interpolations ' + + 'that concatenate multiple expressions when a trusted value is required. ' + + 'See http://docs.angularjs.org/api/ng.$sce'); })); it('should interpolate a multi-part expression when isTrustedContext is false', inject(function($interpolate) { @@ -407,6 +418,23 @@ describe('$interpolate', function() { expect($interpolate('some/{{id}}')({id: 1})).toEqual('some/1'); expect($interpolate('{{foo}}{{bar}}')({foo: 1, bar: 2})).toEqual('12'); })); + + + it('should interpolate a multi-part expression when isTrustedContext is URL', inject(function($sce, $interpolate) { + expect($interpolate('some/{{id}}', true, $sce.URL)({})).toEqual('some/'); + expect($interpolate('some/{{id}}', true, $sce.URL)({id: 1})).toEqual('some/1'); + expect($interpolate('{{foo}}{{bar}}', true, $sce.URL)({foo: 1, bar: 2})).toEqual('12'); + })); + + + it('should interpolate and sanitize a multi-part expression when isTrustedContext is URL', inject(function($sce, $interpolate) { + expect($interpolate('some/{{id}}', true, $sce.URL)({})).toEqual('some/'); + expect($interpolate('some/{{id}}', true, $sce.URL)({id: 'javascript:'})).toEqual('some/javascript:'); + expect($interpolate('{{foo}}{{bar}}', true, $sce.URL)({foo: 'javascript:', bar: 'javascript:'})).toEqual('unsafe:javascript:javascript:'); + })); + + + }); diff --git a/test/ng/sceSpecs.js b/test/ng/sceSpecs.js index f7c654df296a..fb169925c9ff 100644 --- a/test/ng/sceSpecs.js +++ b/test/ng/sceSpecs.js @@ -1,5 +1,7 @@ 'use strict'; +/* eslint-disable no-script-url */ + describe('SCE', function() { describe('when disabled', function() { @@ -211,7 +213,7 @@ describe('SCE', function() { expect($sce.parseAsJs('"string"')()).toBe('string'); })); - it('should be possible to do one-time binding', function() { + it('should be possible to do one-time binding on a non-concatenable context', function() { module(provideLog); inject(function($sce, $rootScope, log) { $rootScope.$watch($sce.parseAsHtml('::foo'), function(value) { @@ -236,6 +238,31 @@ describe('SCE', function() { }); }); + it('should be possible to do one-time binding on a concatenable context', function() { + module(provideLog); + inject(function($sce, $rootScope, log) { + $rootScope.$watch($sce.parseAsUrl('::foo'), function(value) { + log(value + ''); + }); + + $rootScope.$digest(); + expect(log).toEqual('undefined'); // initial listener call + log.reset(); + + $rootScope.foo = $sce.trustAs($sce.URL, 'trustedValue'); + expect($rootScope.$$watchers.length).toBe(1); + $rootScope.$digest(); + + expect($rootScope.$$watchers.length).toBe(0); + expect(log).toEqual('trustedValue'); + log.reset(); + + $rootScope.foo = $sce.trustAs($sce.URL, 'anotherTrustedValue'); + $rootScope.$digest(); + expect(log).toEqual(''); // watcher no longer active + }); + }); + it('should NOT parse constant non-literals', inject(function($sce) { // Until there's a real world use case for this, we're disallowing // constant non-literals. See $SceParseProvider. @@ -525,6 +552,44 @@ describe('SCE', function() { )); }); + describe('URL-context sanitization', function() { + it('should sanitize values that are not whitelisted', inject(function($sce) { + expect($sce.getTrustedMediaUrl('javascript:foo')).toEqual('unsafe:javascript:foo'); + expect($sce.getTrustedUrl('javascript:foo')).toEqual('unsafe:javascript:foo'); + })); + + it('should not sanitize values that are whitelisted', inject(function($sce) { + expect($sce.getTrustedMediaUrl('http://example.com')).toEqual('http://example.com'); + expect($sce.getTrustedUrl('http://example.com')).toEqual('http://example.com'); + })); + + it('should not sanitize trusted values', inject(function($sce) { + expect($sce.getTrustedMediaUrl($sce.trustAsMediaUrl('javascript:foo'))).toEqual('javascript:foo'); + expect($sce.getTrustedMediaUrl($sce.trustAsUrl('javascript:foo'))).toEqual('javascript:foo'); + expect($sce.getTrustedMediaUrl($sce.trustAsResourceUrl('javascript:foo'))).toEqual('javascript:foo'); + + expect($sce.getTrustedUrl($sce.trustAsMediaUrl('javascript:foo'))).toEqual('unsafe:javascript:foo'); + expect($sce.getTrustedUrl($sce.trustAsUrl('javascript:foo'))).toEqual('javascript:foo'); + expect($sce.getTrustedUrl($sce.trustAsResourceUrl('javascript:foo'))).toEqual('javascript:foo'); + })); + + it('should use the $$sanitizeUri', function() { + var $$sanitizeUri = jasmine.createSpy('$$sanitizeUri').and.returnValue('someSanitizedUrl'); + module(function($provide) { + $provide.value('$$sanitizeUri', $$sanitizeUri); + }); + inject(function($sce) { + expect($sce.getTrustedMediaUrl('someUrl')).toEqual('someSanitizedUrl'); + expect($$sanitizeUri).toHaveBeenCalledOnceWith('someUrl', true); + + $$sanitizeUri.calls.reset(); + + expect($sce.getTrustedUrl('someUrl')).toEqual('someSanitizedUrl'); + expect($$sanitizeUri).toHaveBeenCalledOnceWith('someUrl', false); + }); + }); + }); + describe('sanitizing html', function() { describe('when $sanitize is NOT available', function() { it('should throw an exception for getTrusted(string) values', inject(function($sce) { @@ -535,9 +600,23 @@ describe('SCE', function() { describe('when $sanitize is available', function() { beforeEach(function() { module('ngSanitize'); }); + it('should sanitize html using $sanitize', inject(function($sce) { expect($sce.getTrustedHtml('abc')).toBe('abc'); })); + + // Note: that test only passes if HTML is added to the concatenable contexts list. + // See isConcatenableSecureContext in interpolate.js for that. + // + // if (!msie || msie >= 11) { + // it('can set dynamic srcdocs with concatenations and sanitize the result', + // inject(function($compile, $rootScope) { + // var element = $compile('')($rootScope); + // $rootScope.html = 'noyes'; + // $rootScope.$digest(); + // expect(angular.lowercase(element.attr('srcdoc'))).toEqual('yes'); + // })); + // } }); }); }); diff --git a/test/ngSanitize/sanitizeSpec.js b/test/ngSanitize/sanitizeSpec.js index 812ca4fa867d..69cb6abc9fda 100644 --- a/test/ngSanitize/sanitizeSpec.js +++ b/test/ngSanitize/sanitizeSpec.js @@ -495,7 +495,7 @@ describe('HTML', function() { }); }); - it('should use $$sanitizeUri for links', function() { + it('should use $$sanitizeUri for a[href] links', function() { var $$sanitizeUri = jasmine.createSpy('$$sanitizeUri'); module(function($provide) { $provide.value('$$sanitizeUri', $$sanitizeUri); @@ -511,7 +511,7 @@ describe('HTML', function() { }); }); - it('should use $$sanitizeUri for links', function() { + it('should use $$sanitizeUri for img[src] links', function() { var $$sanitizeUri = jasmine.createSpy('$$sanitizeUri'); module(function($provide) { $provide.value('$$sanitizeUri', $$sanitizeUri); From 3fc684352815108688de411717d11239f4d789c9 Mon Sep 17 00:00:00 2001 From: Martin Staffa Date: Mon, 29 Jan 2018 13:30:45 +0100 Subject: [PATCH 362/745] chore(code.angularjs.org): improve output of directory listing --- .../functions/index.js | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/scripts/code.angularjs.org-firebase/functions/index.js b/scripts/code.angularjs.org-firebase/functions/index.js index 4bf6c80d84e6..90f02fc786eb 100644 --- a/scripts/code.angularjs.org-firebase/functions/index.js +++ b/scripts/code.angularjs.org-firebase/functions/index.js @@ -31,7 +31,7 @@ function sendStoredFile(request, response) { } if (!fileName) { - //Root + // Root return getDirectoryListing('/').catch(sendErrorResponse); } @@ -111,6 +111,11 @@ function sendStoredFile(request, response) { return getContent(getFilesOptions).then(() => { let contentList = ''; + if (path === '/') { + // Let the latest versions appear first + directoryList.reverse(); + } + directoryList.forEach(directoryPath => { const dirName = directoryPath.split('/').reverse()[1]; contentList += `${dirName}/
        `; @@ -125,11 +130,20 @@ function sendStoredFile(request, response) { // without trailing slash const base = request.originalUrl.endsWith('/') ? request.originalUrl : request.originalUrl + '/'; - let directoryListing = ` - -

        Index of ${path}

        -
        -
        ${contentList}
        `; + const directoryListing = ` + + + + + + + + +

        Index of ${path}

        +
        +
        ${contentList}
        + + `; return response .status(200) From 67f54b660038de2b4346b3e76d66a8dc8ccb1f9b Mon Sep 17 00:00:00 2001 From: Martin Staffa Date: Thu, 1 Feb 2018 10:31:32 +0100 Subject: [PATCH 363/745] fix(ngTouch): deprecate the module and its contents Closes #16427 Closes #16431 --- src/ngTouch/directive/ngSwipe.js | 10 ++++++++++ src/ngTouch/swipe.js | 5 +++++ src/ngTouch/touch.js | 7 +++++++ 3 files changed, 22 insertions(+) diff --git a/src/ngTouch/directive/ngSwipe.js b/src/ngTouch/directive/ngSwipe.js index e05632044747..5f31fa96470c 100644 --- a/src/ngTouch/directive/ngSwipe.js +++ b/src/ngTouch/directive/ngSwipe.js @@ -6,6 +6,11 @@ * @ngdoc directive * @name ngSwipeLeft * + * @deprecated + * sinceVersion="1.7.0" + * + * See the {@link ngTouch module} documentation for more information. + * * @description * Specify custom behavior when an element is swiped to the left on a touchscreen device. * A leftward swipe is a quick, right-to-left slide of the finger. @@ -42,6 +47,11 @@ * @ngdoc directive * @name ngSwipeRight * + * @deprecated + * sinceVersion="1.7.0" + * + * See the {@link ngTouch module} documentation for more information. + * * @description * Specify custom behavior when an element is swiped to the right on a touchscreen device. * A rightward swipe is a quick, left-to-right slide of the finger. diff --git a/src/ngTouch/swipe.js b/src/ngTouch/swipe.js index 013eea3dc6bc..617747f77fab 100644 --- a/src/ngTouch/swipe.js +++ b/src/ngTouch/swipe.js @@ -6,6 +6,11 @@ * @ngdoc service * @name $swipe * + * @deprecated + * sinceVersion="1.7.0" + * + * See the {@link ngTouch module} documentation for more information. + * * @description * The `$swipe` service is a service that abstracts the messier details of hold-and-drag swipe * behavior, to make implementing swipe-related directives more convenient. diff --git a/src/ngTouch/touch.js b/src/ngTouch/touch.js index 676f6f4a6c9b..d0c2745a876b 100644 --- a/src/ngTouch/touch.js +++ b/src/ngTouch/touch.js @@ -11,6 +11,13 @@ * * See {@link ngTouch.$swipe `$swipe`} for usage. * + * @deprecated + * sinceVersion="1.7.0" + * The ngTouch module with the {@link ngTouch.$swipe `$swipe`} service and + * the {@link ngTouch.ngSwipeLeft} and {@link ngTouch.ngSwipeRight} directives are + * deprecated. Instead, stand-alone libraries for touch handling and gesture interaction + * should be used, for example [HammerJS](https://hammerjs.github.io/) (which is also used by + * Angular). */ // define ngTouch module From e3ece2fad9e1e6d47b5f06815ff186d7e6f44948 Mon Sep 17 00:00:00 2001 From: Georgii Dolzhykov Date: Thu, 22 Dec 2016 19:17:06 +0300 Subject: [PATCH 364/745] feat(isArray): support Array subclasses in `angular.isArray()` Closes #15533 Closes #15541 BREAKING CHANGE: Previously, `angular.isArray()` was an alias for `Array.isArray()`. Therefore, objects that prototypally inherit from `Array` where not considered arrays. Now such objects are considered arrays too. This change affects several other methods that use `angular.isArray()` under the hood, such as `angular.copy()`, `angular.equals()`, `angular.forEach()`, and `angular.merge()`. This in turn affects how dirty checking treats objects that prototypally inherit from `Array` (e.g. MobX observable arrays). AngularJS will now be able to handle these objects better when copying or watching. --- src/Angular.js | 9 +++++---- test/AngularSpec.js | 31 +++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/src/Angular.js b/src/Angular.js index 7c424897ff18..f5ab043dc8a3 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -219,8 +219,7 @@ function isArrayLike(obj) { // NodeList objects (with `item` method) and // other objects with suitable length characteristics are array-like - return isNumber(length) && - (length >= 0 && ((length - 1) in obj || obj instanceof Array) || typeof obj.item === 'function'); + return isNumber(length) && (length >= 0 && (length - 1) in obj || typeof obj.item === 'function'); } @@ -635,12 +634,14 @@ function isDate(value) { * @kind function * * @description - * Determines if a reference is an `Array`. Alias of Array.isArray. + * Determines if a reference is an `Array`. * * @param {*} value Reference to check. * @returns {boolean} True if `value` is an `Array`. */ -var isArray = Array.isArray; +function isArray(arr) { + return Array.isArray(arr) || arr instanceof Array; +} /** * @description diff --git a/test/AngularSpec.js b/test/AngularSpec.js index c10b92e01179..ffe157de589f 100644 --- a/test/AngularSpec.js +++ b/test/AngularSpec.js @@ -1254,6 +1254,37 @@ describe('angular', function() { }); }); + describe('isArray', function() { + + it('should return true if passed an `Array`', function() { + expect(isArray([])).toBe(true); + }); + + it('should return true if passed an `Array` from a different window context', function() { + var iframe = document.createElement('iframe'); + document.body.appendChild(iframe); // No `contentWindow` if not attached to the DOM. + var arr = new iframe.contentWindow.Array(); + document.body.removeChild(iframe); // Clean up. + + expect(arr instanceof Array).toBe(false); + expect(isArray(arr)).toBe(true); + }); + + it('should return true if passed an object prototypically inherited from `Array`', function() { + function FooArray() {} + FooArray.prototype = []; + + expect(isArray(new FooArray())).toBe(true); + }); + + it('should return false if passed non-array objects', function() { + expect(isArray(document.body.childNodes)).toBe(false); + expect(isArray({length: 0})).toBe(false); + expect(isArray({length: 2, 0: 'one', 1: 'two'})).toBe(false); + }); + + }); + describe('isArrayLike', function() { it('should return false if passed a number', function() { From 16b82c6afe0ab916fef1d6ca78053b00bf5ada83 Mon Sep 17 00:00:00 2001 From: Martin Staffa Date: Fri, 2 Feb 2018 10:02:06 +0100 Subject: [PATCH 365/745] fix($animate): let cancel() reject the runner promise Closes #14204 Closes #16373 BREAKING CHANGE: $animate.cancel(runner) now rejects the underlying promise and calls the catch() handler on the runner returned by $animate functions (enter, leave, move, addClass, removeClass, setClass, animate). Previously it would resolve the promise as if the animation had ended successfully. Example: ```js var runner = $animate.addClass('red'); runner.then(function() { console.log('success')}); runner.catch(function() { console.log('cancelled')}); runner.cancel(); ``` Pre-1.7.0, this logs 'success', 1.7.0 and later it logs 'cancelled'. To migrate, add a catch() handler to your animation runners. --- src/ng/animate.js | 88 +++++++++++++--- test/ngAnimate/animateSpec.js | 190 ++++++++++++++++++++++++++++++++++ 2 files changed, 266 insertions(+), 12 deletions(-) diff --git a/src/ng/animate.js b/src/ng/animate.js index 1f9bc9028cf0..60a9bc3d04a9 100644 --- a/src/ng/animate.js +++ b/src/ng/animate.js @@ -464,13 +464,77 @@ var $AnimateProvider = ['$provide', /** @this */ function($provide) { * @ngdoc method * @name $animate#cancel * @kind function - * @description Cancels the provided animation. - * - * @param {Promise} animationPromise The animation promise that is returned when an animation is started. + * @description Cancels the provided animation and applies the end state of the animation. + * Note that this does not cancel the underlying operation, e.g. the setting of classes or + * adding the element to the DOM. + * + * @param {animationRunner} animationRunner An animation runner returned by an $animate function. + * + * @example + + + angular.module('animationExample', ['ngAnimate']).component('cancelExample', { + templateUrl: 'template.html', + controller: function($element, $animate) { + this.runner = null; + + this.addClass = function() { + this.runner = $animate.addClass($element.find('div'), 'red'); + var ctrl = this; + this.runner.finally(function() { + ctrl.runner = null; + }); + }; + + this.removeClass = function() { + this.runner = $animate.removeClass($element.find('div'), 'red'); + var ctrl = this; + this.runner.finally(function() { + ctrl.runner = null; + }); + }; + + this.cancel = function() { + $animate.cancel(this.runner); + }; + } + }); + + +

        + + +
        + +
        +

        CSS-Animated Text
        +

        +
        + + + + + .red-add, .red-remove { + transition: all 4s cubic-bezier(0.250, 0.460, 0.450, 0.940); + } + + .red, + .red-add.red-add-active { + color: #FF0000; + font-size: 40px; + } + + .red-remove.red-remove-active { + font-size: 10px; + color: black; + } + + +
        */ cancel: function(runner) { - if (runner.end) { - runner.end(); + if (runner.cancel) { + runner.cancel(); } }, @@ -496,7 +560,7 @@ var $AnimateProvider = ['$provide', /** @this */ function($provide) { * - **removeClass** - `{string}` - space-separated CSS classes to remove from element * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from` * - * @return {Promise} the animation callback promise + * @return {Runner} the animation runner */ enter: function(element, parent, after, options) { parent = parent && jqLite(parent); @@ -528,7 +592,7 @@ var $AnimateProvider = ['$provide', /** @this */ function($provide) { * - **removeClass** - `{string}` - space-separated CSS classes to remove from element * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from` * - * @return {Promise} the animation callback promise + * @return {Runner} the animation runner */ move: function(element, parent, after, options) { parent = parent && jqLite(parent); @@ -555,7 +619,7 @@ var $AnimateProvider = ['$provide', /** @this */ function($provide) { * - **removeClass** - `{string}` - space-separated CSS classes to remove from element * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from` * - * @return {Promise} the animation callback promise + * @return {Runner} the animation runner */ leave: function(element, options) { return $$animateQueue.push(element, 'leave', prepareAnimateOptions(options), function() { @@ -585,7 +649,7 @@ var $AnimateProvider = ['$provide', /** @this */ function($provide) { * - **removeClass** - `{string}` - space-separated CSS classes to remove from element * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from` * - * @return {Promise} the animation callback promise + * @return {Runner} animationRunner the animation runner */ addClass: function(element, className, options) { options = prepareAnimateOptions(options); @@ -615,7 +679,7 @@ var $AnimateProvider = ['$provide', /** @this */ function($provide) { * - **removeClass** - `{string}` - space-separated CSS classes to remove from element * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from` * - * @return {Promise} the animation callback promise + * @return {Runner} the animation runner */ removeClass: function(element, className, options) { options = prepareAnimateOptions(options); @@ -646,7 +710,7 @@ var $AnimateProvider = ['$provide', /** @this */ function($provide) { * - **removeClass** - `{string}` - space-separated CSS classes to remove from element * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from` * - * @return {Promise} the animation callback promise + * @return {Runner} the animation runner */ setClass: function(element, add, remove, options) { options = prepareAnimateOptions(options); @@ -693,7 +757,7 @@ var $AnimateProvider = ['$provide', /** @this */ function($provide) { * - **removeClass** - `{string}` - space-separated CSS classes to remove from element * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from` * - * @return {Promise} the animation callback promise + * @return {Runner} the animation runner */ animate: function(element, from, to, className, options) { options = prepareAnimateOptions(options); diff --git a/test/ngAnimate/animateSpec.js b/test/ngAnimate/animateSpec.js index e8c0131a8a16..484836ca66e0 100644 --- a/test/ngAnimate/animateSpec.js +++ b/test/ngAnimate/animateSpec.js @@ -790,6 +790,7 @@ describe('animations', function() { expect(element).toHaveClass('red'); })); + it('removeClass() should issue a removeClass animation with the correct DOM operation', inject(function($animate, $rootScope) { parent.append(element); element.addClass('blue'); @@ -934,6 +935,195 @@ describe('animations', function() { })); }); + + describe('$animate.cancel()', function() { + + it('should cancel enter()', inject(function($animate, $rootScope) { + expect(parent.children().length).toBe(0); + + options.foo = 'bar'; + var spy = jasmine.createSpy('cancelCatch'); + + var runner = $animate.enter(element, parent, null, options); + + runner.catch(spy); + + expect(parent.children().length).toBe(1); + + $rootScope.$digest(); + + expect(capturedAnimation[0]).toBe(element); + expect(capturedAnimation[1]).toBe('enter'); + expect(capturedAnimation[2].foo).toEqual(options.foo); + + $animate.cancel(runner); + // Since enter() immediately adds the element, we can only check if the + // element is still at the position + expect(parent.children().length).toBe(1); + + $rootScope.$digest(); + + // Catch handler is called after digest + expect(spy).toHaveBeenCalled(); + })); + + + it('should cancel move()', inject(function($animate, $rootScope) { + parent.append(element); + + expect(parent.children().length).toBe(1); + expect(parent2.children().length).toBe(0); + + options.foo = 'bar'; + var spy = jasmine.createSpy('cancelCatch'); + + var runner = $animate.move(element, parent2, null, options); + runner.catch(spy); + + expect(parent.children().length).toBe(0); + expect(parent2.children().length).toBe(1); + + $rootScope.$digest(); + + expect(capturedAnimation[0]).toBe(element); + expect(capturedAnimation[1]).toBe('move'); + expect(capturedAnimation[2].foo).toEqual(options.foo); + + $animate.cancel(runner); + // Since moves() immediately moves the element, we can only check if the + // element is still at the correct position + expect(parent.children().length).toBe(0); + expect(parent2.children().length).toBe(1); + + $rootScope.$digest(); + + // Catch handler is called after digest + expect(spy).toHaveBeenCalled(); + })); + + + it('cancel leave()', inject(function($animate, $rootScope) { + parent.append(element); + options.foo = 'bar'; + var spy = jasmine.createSpy('cancelCatch'); + + var runner = $animate.leave(element, options); + + runner.catch(spy); + $rootScope.$digest(); + + expect(capturedAnimation[0]).toBe(element); + expect(capturedAnimation[1]).toBe('leave'); + expect(capturedAnimation[2].foo).toEqual(options.foo); + + expect(element.parent().length).toBe(1); + + $animate.cancel(runner); + // Animation concludes immediately + expect(element.parent().length).toBe(0); + expect(spy).not.toHaveBeenCalled(); + + $rootScope.$digest(); + // Catch handler is called after digest + expect(spy).toHaveBeenCalled(); + })); + + it('should cancel addClass()', inject(function($animate, $rootScope) { + parent.append(element); + options.foo = 'bar'; + var runner = $animate.addClass(element, 'red', options); + var spy = jasmine.createSpy('cancelCatch'); + + runner.catch(spy); + $rootScope.$digest(); + + expect(capturedAnimation[0]).toBe(element); + expect(capturedAnimation[1]).toBe('addClass'); + expect(capturedAnimation[2].foo).toEqual(options.foo); + + $animate.cancel(runner); + expect(element).toHaveClass('red'); + expect(spy).not.toHaveBeenCalled(); + + $rootScope.$digest(); + expect(spy).toHaveBeenCalled(); + })); + + + it('should cancel setClass()', inject(function($animate, $rootScope) { + parent.append(element); + element.addClass('red'); + options.foo = 'bar'; + + var runner = $animate.setClass(element, 'blue', 'red', options); + var spy = jasmine.createSpy('cancelCatch'); + + runner.catch(spy); + $rootScope.$digest(); + + expect(capturedAnimation[0]).toBe(element); + expect(capturedAnimation[1]).toBe('setClass'); + expect(capturedAnimation[2].foo).toEqual(options.foo); + + $animate.cancel(runner); + expect(element).toHaveClass('blue'); + expect(element).not.toHaveClass('red'); + expect(spy).not.toHaveBeenCalled(); + + $rootScope.$digest(); + expect(spy).toHaveBeenCalled(); + })); + + + it('should cancel removeClass()', inject(function($animate, $rootScope) { + parent.append(element); + element.addClass('red blue'); + + options.foo = 'bar'; + var runner = $animate.removeClass(element, 'red', options); + var spy = jasmine.createSpy('cancelCatch'); + + runner.catch(spy); + $rootScope.$digest(); + + expect(capturedAnimation[0]).toBe(element); + expect(capturedAnimation[1]).toBe('removeClass'); + expect(capturedAnimation[2].foo).toEqual(options.foo); + + $animate.cancel(runner); + expect(element).not.toHaveClass('red'); + expect(element).toHaveClass('blue'); + + $rootScope.$digest(); + expect(spy).toHaveBeenCalled(); + })); + + + it('should cancel animate()', + inject(function($animate, $rootScope) { + + parent.append(element); + + var fromStyle = { color: 'blue' }; + var options = { addClass: 'red' }; + + var runner = $animate.animate(element, fromStyle, null, null, options); + var spy = jasmine.createSpy('cancelCatch'); + + runner.catch(spy); + $rootScope.$digest(); + + expect(capturedAnimation).toBeTruthy(); + + $animate.cancel(runner); + expect(element).toHaveClass('red'); + + $rootScope.$digest(); + expect(spy).toHaveBeenCalled(); + })); + }); + + describe('parent animations', function() { they('should not cancel a pre-digest parent class-based animation if a child $prop animation is set to run', ['structural', 'class-based'], function(animationType) { From b969c3e3540d05a781404beebecdd4fa4ceb2d2e Mon Sep 17 00:00:00 2001 From: Martin Staffa Date: Fri, 2 Feb 2018 11:19:32 +0100 Subject: [PATCH 366/745] docs(changelog): add changes for 1.6.9 --- CHANGELOG.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fb3c1064bea..40b8fc4d4a87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,31 @@ + +# 1.6.9 fiery-basilisk (2018-02-02) + + +## Bug Fixes +- **input:** add `drop` event support for IE + ([5dc076](https://github.com/angular/angular.js/commit/5dc07667de00c5e85fd69c5b7b7fe4fb5fd65a77)) +- **ngMessages:** prevent memory leak from messages that are never attached + ([9d058d](https://github.com/angular/angular.js/commit/9d058de04bb78694b83179e9b97bc40214eca01a), + [#16389](https://github.com/angular/angular.js/issues/16389), + [#16404](https://github.com/angular/angular.js/issues/16404), + [#16406](https://github.com/angular/angular.js/issues/16406)) +- **ngTransclude:** remove terminal: true + ([1d826e](https://github.com/angular/angular.js/commit/1d826e2f1e941d14c3c56d7a0249f5796ba11f85), + [#16411](https://github.com/angular/angular.js/issues/16411), + [#16412](https://github.com/angular/angular.js/issues/16412)) +- **$sanitize:** sanitize `xml:base` attributes + ([b9ef65](https://github.com/angular/angular.js/commit/b9ef6585e10477fbbf912a971fe0b390bca692a6)) + + +## New Features +- **currencyFilter:** trim whitespace around an empty currency symbol + ([367390](https://github.com/angular/angular.js/commit/3673909896efb6ff47546caf7fc61549f193e043), + [#15018](https://github.com/angular/angular.js/issues/15018), + [#15085](https://github.com/angular/angular.js/issues/15085), + [#15105](https://github.com/angular/angular.js/issues/15105)) + + # 1.6.8 beneficial-tincture (2017-12-18) From d3bffc547697c8f2059f32402c9f02092c1a8b5c Mon Sep 17 00:00:00 2001 From: Martin Staffa Date: Fri, 2 Feb 2018 12:31:49 +0100 Subject: [PATCH 367/745] chore(docs.angularjs.org): add robots.txt --- docs/app/assets/robots.txt | 11 +++++++++++ scripts/docs.angularjs.org-firebase/firebase.json | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 docs/app/assets/robots.txt diff --git a/docs/app/assets/robots.txt b/docs/app/assets/robots.txt new file mode 100644 index 000000000000..a0de3bfda6b4 --- /dev/null +++ b/docs/app/assets/robots.txt @@ -0,0 +1,11 @@ +User-agent: * + +Disallow: /components/ +Disallow: /examples/ +Disallow: /img/ +Disallow: /js/ +Disallow: /partials/ +Disallow: /ptore2e/ +Disallow: /*.js$ +Disallow: /*.map$ +Disallow: /Error404.html diff --git a/scripts/docs.angularjs.org-firebase/firebase.json b/scripts/docs.angularjs.org-firebase/firebase.json index 8f82fc2d8e9c..5f5d70dc02d6 100644 --- a/scripts/docs.angularjs.org-firebase/firebase.json +++ b/scripts/docs.angularjs.org-firebase/firebase.json @@ -23,7 +23,7 @@ "destination": "/index-production.html" }, { - "source": "**/*!(.jpg|.jpeg|.gif|.png|.html|.js|.map|.json|.css|.svg|.ttf|.woff|.woff2|.eot)", + "source": "**/*!(.jpg|.jpeg|.gif|.png|.html|.js|.map|.json|.css|.svg|.ttf|.txt|.woff|.woff2|.eot)", "destination": "/index-production.html" } ] From fb00991460cf69ae8bc7f1f826363d09c73c0d5e Mon Sep 17 00:00:00 2001 From: frederikprijck Date: Sun, 4 Feb 2018 10:20:46 +0100 Subject: [PATCH 368/745] fix($templateRequest): always return the template that is stored in the cache Previously, `$templateRequest` returned the raw `$http` response data on the first request for a template and then the value from the cache for subsequent requests. If the value is transformed when being added to the cache (by decorating `$templateCache.put`) the return value of `$templateRequest` would be inconsistent depending upon when the request is made. This commit ensures the cached value is returned instead of the raw `$http` response data, thus allowing the `$templateCache` service to be decorated. Closes #16225 --- src/ng/templateRequest.js | 3 +-- test/ng/templateRequestSpec.js | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/ng/templateRequest.js b/src/ng/templateRequest.js index 7b3b04261e56..ff699d6cd0ef 100644 --- a/src/ng/templateRequest.js +++ b/src/ng/templateRequest.js @@ -99,8 +99,7 @@ function $TemplateRequestProvider() { handleRequestFn.totalPendingRequests--; }) .then(function(response) { - $templateCache.put(tpl, response.data); - return response.data; + return $templateCache.put(tpl, response.data); }, handleError); function handleError(resp) { diff --git a/test/ng/templateRequestSpec.js b/test/ng/templateRequestSpec.js index cb9c1c6f6ce8..3ca323613103 100644 --- a/test/ng/templateRequestSpec.js +++ b/test/ng/templateRequestSpec.js @@ -114,6 +114,24 @@ describe('$templateRequest', function() { expect($templateCache.get('tpl.html')).toBe('matias'); })); + it('should return the cached value on the first request', + inject(function($rootScope, $templateRequest, $templateCache, $httpBackend) { + + $httpBackend.expectGET('tpl.html').respond('matias'); + spyOn($templateCache, 'put').and.returnValue('_matias'); + + var content = []; + function tplRequestCb(html) { + content.push(html); + } + + $templateRequest('tpl.html').then(tplRequestCb); + $rootScope.$digest(); + $httpBackend.flush(); + + expect(content[0]).toBe('_matias'); + })); + it('should call `$exceptionHandler` on request error', function() { module(function($exceptionHandlerProvider) { $exceptionHandlerProvider.mode('log'); From fbe679dfbcb2108249931d44f452d09da6c98477 Mon Sep 17 00:00:00 2001 From: Martin Staffa Date: Mon, 5 Feb 2018 12:35:12 +0100 Subject: [PATCH 369/745] chore(doc-gen): generate sitemap.xml --- docs/config/index.js | 1 + docs/config/processors/sitemap.js | 25 +++++++++++++++++++ .../config/templates/app/sitemap.template.xml | 7 ++++++ 3 files changed, 33 insertions(+) create mode 100644 docs/config/processors/sitemap.js create mode 100644 docs/config/templates/app/sitemap.template.xml diff --git a/docs/config/index.js b/docs/config/index.js index ab5e45a3f8dc..4ddf7922c7bd 100644 --- a/docs/config/index.js +++ b/docs/config/index.js @@ -31,6 +31,7 @@ module.exports = new Package('angularjs', [ .processor(require('./processors/keywords')) .processor(require('./processors/pages-data')) .processor(require('./processors/versions-data')) +.processor(require('./processors/sitemap')) .config(function(dgeni, log, readFilesProcessor, writeFilesProcessor) { diff --git a/docs/config/processors/sitemap.js b/docs/config/processors/sitemap.js new file mode 100644 index 000000000000..aea84da9a17a --- /dev/null +++ b/docs/config/processors/sitemap.js @@ -0,0 +1,25 @@ +'use strict'; + +var exclusionRegex = /^index|examples\/|ptore2e\//; + +module.exports = function createSitemap() { + return { + $runAfter: ['paths-computed'], + $runBefore: ['rendering-docs'], + $process: function(docs) { + docs.push({ + id: 'sitemap.xml', + path: 'sitemap.xml', + outputPath: '../sitemap.xml', + template: 'sitemap.template.xml', + urls: docs.filter(function(doc) { + return doc.path && + doc.outputPath && + !exclusionRegex.test(doc.outputPath); + }).map(function(doc) { + return doc.path; + }) + }); + } + }; +}; diff --git a/docs/config/templates/app/sitemap.template.xml b/docs/config/templates/app/sitemap.template.xml new file mode 100644 index 000000000000..56953d903920 --- /dev/null +++ b/docs/config/templates/app/sitemap.template.xml @@ -0,0 +1,7 @@ + + + {%- for url in doc.urls %} + + https://docs.angularjs.org/{$ url $} + {% endfor %} + \ No newline at end of file From ea04dbb229ec69a7ffc954d57496f058d6ce6dcb Mon Sep 17 00:00:00 2001 From: Martin Staffa Date: Mon, 5 Feb 2018 12:38:44 +0100 Subject: [PATCH 370/745] chore(code.angularjs.org): fix robots.txt - allow all-versions-data.js in snapshot, which is used by docs.angularjs.org - disallow access to folders like docs-0.9.2 etc which are used by early versions --- scripts/code.angularjs.org-firebase/public/robots.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/code.angularjs.org-firebase/public/robots.txt b/scripts/code.angularjs.org-firebase/public/robots.txt index 480082428fa1..e83f2c10453d 100644 --- a/scripts/code.angularjs.org-firebase/public/robots.txt +++ b/scripts/code.angularjs.org-firebase/public/robots.txt @@ -1,5 +1,6 @@ User-agent: * -Disallow: /*docs/ +Disallow: /*docs*/ Disallow: /*i18n/ Disallow: /*.zip$ +Allow: /snapshot/docs/js/all-versions-data.js From 7d50b2e9eea9c7e8950beffc1e139c4e05af00f5 Mon Sep 17 00:00:00 2001 From: Martin Staffa Date: Mon, 5 Feb 2018 13:07:07 +0100 Subject: [PATCH 371/745] chore(docs.angularjs.org): allow robots to access js and css Otherwise, the google bot cannot execute the JS --- docs/app/assets/robots.txt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/app/assets/robots.txt b/docs/app/assets/robots.txt index a0de3bfda6b4..c00cb3c20320 100644 --- a/docs/app/assets/robots.txt +++ b/docs/app/assets/robots.txt @@ -1,11 +1,9 @@ User-agent: * -Disallow: /components/ Disallow: /examples/ Disallow: /img/ -Disallow: /js/ Disallow: /partials/ Disallow: /ptore2e/ -Disallow: /*.js$ -Disallow: /*.map$ +Disallow: /*.js$ # The js files in the root are used by the embedded examples, not by the app itself +Disallow: /*.map$ # The map files in the root are used by the embedded examples, not by the app itself Disallow: /Error404.html From 8d6ac5f3178cb6ead6b3b7526c50cd1c07112097 Mon Sep 17 00:00:00 2001 From: Maksim Ryzhikov Date: Sat, 11 Nov 2017 16:18:17 +0300 Subject: [PATCH 372/745] feat($sanitize): support enhancing elements/attributes white-lists Fixes #5900 Closes #16326 --- src/ngSanitize/sanitize.js | 139 +++++++++++++++++++++++++++++--- test/ngSanitize/sanitizeSpec.js | 50 ++++++++++++ 2 files changed, 176 insertions(+), 13 deletions(-) diff --git a/src/ngSanitize/sanitize.js b/src/ngSanitize/sanitize.js index b08850fba065..48ddad82341c 100644 --- a/src/ngSanitize/sanitize.js +++ b/src/ngSanitize/sanitize.js @@ -15,6 +15,7 @@ var $sanitizeMinErr = angular.$$minErr('$sanitize'); var bind; var extend; var forEach; +var isArray; var isDefined; var lowercase; var noop; @@ -144,9 +145,11 @@ var htmlSanitizeWriter; * Creates and configures {@link $sanitize} instance. */ function $SanitizeProvider() { + var hasBeenInstantiated = false; var svgEnabled = false; this.$get = ['$$sanitizeUri', function($$sanitizeUri) { + hasBeenInstantiated = true; if (svgEnabled) { extend(validElements, svgElements); } @@ -187,7 +190,7 @@ function $SanitizeProvider() { * * * @param {boolean=} flag Enable or disable SVG support in the sanitizer. - * @returns {boolean|ng.$sanitizeProvider} Returns the currently configured value if called + * @returns {boolean|$sanitizeProvider} Returns the currently configured value if called * without an argument or self for chaining otherwise. */ this.enableSvg = function(enableSvg) { @@ -199,6 +202,105 @@ function $SanitizeProvider() { } }; + + /** + * @ngdoc method + * @name $sanitizeProvider#addValidElements + * @kind function + * + * @description + * Extends the built-in lists of valid HTML/SVG elements, i.e. elements that are considered safe + * and are not stripped off during sanitization. You can extend the following lists of elements: + * + * - `htmlElements`: A list of elements (tag names) to extend the current list of safe HTML + * elements. HTML elements considered safe will not be removed during sanitization. All other + * elements will be stripped off. + * + * - `htmlVoidElements`: This is similar to `htmlElements`, but marks the elements as + * "void elements" (similar to HTML + * [void elements](https://rawgit.com/w3c/html/html5.1-2/single-page.html#void-elements)). These + * elements have no end tag and cannot have content. + * + * - `svgElements`: This is similar to `htmlElements`, but for SVG elements. This list is only + * taken into account if SVG is {@link ngSanitize.$sanitizeProvider#enableSvg enabled} for + * `$sanitize`. + * + *
        + * This method must be called during the {@link angular.Module#config config} phase. Once the + * `$sanitize` service has been instantiated, this method has no effect. + *
        + * + *
        + * Keep in mind that extending the built-in lists of elements may expose your app to XSS or + * other vulnerabilities. Be very mindful of the elements you add. + *
        + * + * @param {Array|Object} elements - A list of valid HTML elements or an object with one or + * more of the following properties: + * - **htmlElements** - `{Array}` - A list of elements to extend the current list of + * HTML elements. + * - **htmlVoidElements** - `{Array}` - A list of elements to extend the current list of + * void HTML elements; i.e. elements that do not have an end tag. + * - **svgElements** - `{Array}` - A list of elements to extend the current list of SVG + * elements. The list of SVG elements is only taken into account if SVG is + * {@link ngSanitize.$sanitizeProvider#enableSvg enabled} for `$sanitize`. + * + * Passing an array (`[...]`) is equivalent to passing `{htmlElements: [...]}`. + * + * @return {$sanitizeProvider} Returns self for chaining. + */ + this.addValidElements = function(elements) { + if (!hasBeenInstantiated) { + if (isArray(elements)) { + elements = {htmlElements: elements}; + } + + addElementsTo(svgElements, elements.svgElements); + addElementsTo(voidElements, elements.htmlVoidElements); + addElementsTo(validElements, elements.htmlVoidElements); + addElementsTo(validElements, elements.htmlElements); + } + + return this; + }; + + + /** + * @ngdoc method + * @name $sanitizeProvider#addValidAttrs + * @kind function + * + * @description + * Extends the built-in list of valid attributes, i.e. attributes that are considered safe and are + * not stripped off during sanitization. + * + * **Note**: + * The new attributes will not be treated as URI attributes, which means their values will not be + * sanitized as URIs using `$compileProvider`'s + * {@link ng.$compileProvider#aHrefSanitizationWhitelist aHrefSanitizationWhitelist} and + * {@link ng.$compileProvider#imgSrcSanitizationWhitelist imgSrcSanitizationWhitelist}. + * + *
        + * This method must be called during the {@link angular.Module#config config} phase. Once the + * `$sanitize` service has been instantiated, this method has no effect. + *
        + * + *
        + * Keep in mind that extending the built-in list of attributes may expose your app to XSS or + * other vulnerabilities. Be very mindful of the attributes you add. + *
        + * + * @param {Array} attrs - A list of valid attributes. + * + * @returns {$sanitizeProvider} Returns self for chaining. + */ + this.addValidAttrs = function(attrs) { + if (!hasBeenInstantiated) { + extend(validAttrs, arrayToMap(attrs, true)); + } + return this; + }; + ////////////////////////////////////////////////////////////////////////////////////////////////// // Private stuff ////////////////////////////////////////////////////////////////////////////////////////////////// @@ -206,6 +308,7 @@ function $SanitizeProvider() { bind = angular.bind; extend = angular.extend; forEach = angular.forEach; + isArray = angular.isArray; isDefined = angular.isDefined; lowercase = angular.$$lowercase; noop = angular.noop; @@ -230,23 +333,23 @@ function $SanitizeProvider() { // Safe Void Elements - HTML5 // http://dev.w3.org/html5/spec/Overview.html#void-elements - var voidElements = toMap('area,br,col,hr,img,wbr'); + var voidElements = stringToMap('area,br,col,hr,img,wbr'); // Elements that you can, intentionally, leave open (and which close themselves) // http://dev.w3.org/html5/spec/Overview.html#optional-tags - var optionalEndTagBlockElements = toMap('colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr'), - optionalEndTagInlineElements = toMap('rp,rt'), + var optionalEndTagBlockElements = stringToMap('colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr'), + optionalEndTagInlineElements = stringToMap('rp,rt'), optionalEndTagElements = extend({}, optionalEndTagInlineElements, optionalEndTagBlockElements); // Safe Block Elements - HTML5 - var blockElements = extend({}, optionalEndTagBlockElements, toMap('address,article,' + + var blockElements = extend({}, optionalEndTagBlockElements, stringToMap('address,article,' + 'aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,' + 'h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,section,table,ul')); // Inline Elements - HTML5 - var inlineElements = extend({}, optionalEndTagInlineElements, toMap('a,abbr,acronym,b,' + + var inlineElements = extend({}, optionalEndTagInlineElements, stringToMap('a,abbr,acronym,b,' + 'bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,' + 'samp,small,span,strike,strong,sub,sup,time,tt,u,var')); @@ -254,12 +357,12 @@ function $SanitizeProvider() { // https://wiki.whatwg.org/wiki/Sanitization_rules#svg_Elements // Note: the elements animate,animateColor,animateMotion,animateTransform,set are intentionally omitted. // They can potentially allow for arbitrary javascript to be executed. See #11290 - var svgElements = toMap('circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,' + + var svgElements = stringToMap('circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,' + 'hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,' + 'radialGradient,rect,stop,svg,switch,text,title,tspan'); // Blocked Elements (will be stripped) - var blockedElements = toMap('script,style'); + var blockedElements = stringToMap('script,style'); var validElements = extend({}, voidElements, @@ -268,9 +371,9 @@ function $SanitizeProvider() { optionalEndTagElements); //Attributes that have href and hence need to be sanitized - var uriAttrs = toMap('background,cite,href,longdesc,src,xlink:href,xml:base'); + var uriAttrs = stringToMap('background,cite,href,longdesc,src,xlink:href,xml:base'); - var htmlAttrs = toMap('abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,' + + var htmlAttrs = stringToMap('abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,' + 'color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,' + 'ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,' + 'scope,scrolling,shape,size,span,start,summary,tabindex,target,title,type,' + @@ -278,7 +381,7 @@ function $SanitizeProvider() { // SVG attributes (without "id" and "name" attributes) // https://wiki.whatwg.org/wiki/Sanitization_rules#svg_Attributes - var svgAttrs = toMap('accent-height,accumulate,additive,alphabetic,arabic-form,ascent,' + + var svgAttrs = stringToMap('accent-height,accumulate,additive,alphabetic,arabic-form,ascent,' + 'baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,' + 'cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,' + 'font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,' + @@ -299,14 +402,24 @@ function $SanitizeProvider() { svgAttrs, htmlAttrs); - function toMap(str, lowercaseKeys) { - var obj = {}, items = str.split(','), i; + function stringToMap(str, lowercaseKeys) { + return arrayToMap(str.split(','), lowercaseKeys); + } + + function arrayToMap(items, lowercaseKeys) { + var obj = {}, i; for (i = 0; i < items.length; i++) { obj[lowercaseKeys ? lowercase(items[i]) : items[i]] = true; } return obj; } + function addElementsTo(elementsMap, newElements) { + if (newElements && newElements.length) { + extend(elementsMap, arrayToMap(newElements)); + } + } + /** * Create an inert document that contains the dirty HTML that needs sanitizing * Depending upon browser support we use one of three strategies for doing this. diff --git a/test/ngSanitize/sanitizeSpec.js b/test/ngSanitize/sanitizeSpec.js index 69cb6abc9fda..a047be989642 100644 --- a/test/ngSanitize/sanitizeSpec.js +++ b/test/ngSanitize/sanitizeSpec.js @@ -293,10 +293,56 @@ describe('HTML', function() { expect(doc).toEqual('

        '); })); + describe('Custom white-list support', function() { + + var $sanitizeProvider; + beforeEach(module(function(_$sanitizeProvider_) { + $sanitizeProvider = _$sanitizeProvider_; + + $sanitizeProvider.addValidElements(['foo']); + $sanitizeProvider.addValidElements({ + htmlElements: ['foo-button', 'foo-video'], + htmlVoidElements: ['foo-input'], + svgElements: ['foo-svg'] + }); + $sanitizeProvider.addValidAttrs(['foo']); + })); + + it('should allow custom white-listed element', function() { + expectHTML('').toEqual(''); + expectHTML('').toEqual(''); + expectHTML('').toEqual(''); + }); + + it('should allow custom white-listed void element', function() { + expectHTML('').toEqual(''); + }); + + it('should allow custom white-listed void element to be used with closing tag', function() { + expectHTML('').toEqual(''); + }); + + it('should allow custom white-listed attribute', function() { + expectHTML('').toEqual(''); + }); + + it('should ignore custom white-listed SVG element if SVG disabled', function() { + expectHTML('').toEqual(''); + }); + + it('should not allow add custom element after service has been instantiated', inject(function($sanitize) { + $sanitizeProvider.addValidElements(['bar']); + expectHTML('').toEqual(''); + })); + }); + describe('SVG support', function() { beforeEach(module(function($sanitizeProvider) { $sanitizeProvider.enableSvg(true); + $sanitizeProvider.addValidElements({ + svgElements: ['font-face-uri'] + }); })); it('should accept SVG tags', function() { @@ -314,6 +360,10 @@ describe('HTML', function() { }); + it('should allow custom white-listed SVG element', function() { + expectHTML('').toEqual(''); + }); + it('should sanitize SVG xlink:href attribute values', function() { expectHTML('') .toBeOneOf('', From 02f4ca4887f337e87ce668f657c32f49e18beec8 Mon Sep 17 00:00:00 2001 From: frederikprijck Date: Mon, 30 Jan 2017 22:46:22 +0100 Subject: [PATCH 373/745] docs(ngClass): add docs regarding animation for `ngClassEven` and `ngClassOdd` Previously, the documentation has no information regarding using `ngAnimate` together with the `ngClassEven` and `ngClassOdd` directives. This commit adds the same docs used by the `ngClass` directive to the `ngClassEven` and `ngClassOdd` docs and adds an extra example for both `ngClassEven` and `ngClassOdd` that showcases animations. Closes #15654 --- docs/content/guide/animations.ngdoc | 7 +- src/ng/directive/ngClass.js | 124 ++++++++++++++++++++++++++++ 2 files changed, 128 insertions(+), 3 deletions(-) diff --git a/docs/content/guide/animations.ngdoc b/docs/content/guide/animations.ngdoc index a13661a36a68..22e4df094839 100644 --- a/docs/content/guide/animations.ngdoc +++ b/docs/content/guide/animations.ngdoc @@ -229,11 +229,12 @@ triggered: | {@link ngRoute.directive:ngView#animations ngView} | enter and leave | | {@link module:ngMessages#animations ngMessage / ngMessageExp} | enter and leave | | {@link ng.directive:ngClass#animations ngClass / {{class}​}} | add and remove | -| {@link ng.directive:ngClass#animations ngClassEven / ngClassOdd} | add and remove | +| {@link ng.directive:ngClassEven#animations ngClassEven} | add and remove | +| {@link ng.directive:ngClassOdd#animations ngClassOdd} | add and remove | | {@link ng.directive:ngHide#animations ngHide} | add and remove (the `ng-hide` class) | | {@link ng.directive:ngShow#animations ngShow} | add and remove (the `ng-hide` class) | -| {@link ng.directive:ngModel#animations ngModel} | add and remove ({@link ng.directive:ngModel#css-classes various classes}) | -| {@link ng.directive:form#animations form / ngForm} | add and remove ({@link ng.directive:form#css-classes various classes}) | +| {@link ng.directive:ngModel#animations ngModel} | add and remove ({@link ng.directive:ngModel#css-classes various classes}) | +| {@link ng.directive:form#animations form / ngForm} | add and remove ({@link ng.directive:form#css-classes various classes}) | | {@link module:ngMessages#animations ngMessages} | add and remove (the `ng-active`/`ng-inactive` classes) | For a full breakdown of the steps involved during each animation event, refer to the diff --git a/src/ng/directive/ngClass.js b/src/ng/directive/ngClass.js index e38c7c141938..7b1ca13b2915 100644 --- a/src/ng/directive/ngClass.js +++ b/src/ng/directive/ngClass.js @@ -338,6 +338,12 @@ var ngClassDirective = classDirective('', true); * This directive can be applied only within the scope of an * {@link ng.directive:ngRepeat ngRepeat}. * + * @animations + * | Animation | Occurs | + * |----------------------------------|-------------------------------------| + * | {@link ng.$animate#addClass addClass} | just before the class is applied to the element | + * | {@link ng.$animate#removeClass removeClass} | just before the class is removed from the element | + * * @element ANY * @param {expression} ngClassOdd {@link guide/expression Expression} to eval. The result * of the evaluation can be a string representing space delimited class names or an array. @@ -370,6 +376,62 @@ var ngClassDirective = classDirective('', true); }); + * + *
        + * @example + * An example on how to implement animations using `ngClassOdd`: + * + + +
        + +
        + + + + +
        {{ item }}
        +
        +
        + + .odd { + background: rgba(255, 255, 0, 0.25); + } + + .odd-add, .odd-remove { + transition: 1.5s; + } + + + it('should add new entries to the beginning of the list', function() { + var button = element(by.buttonText('Add item')); + var rows = element.all(by.repeater('item in items')); + + expect(rows.count()).toBe(4); + expect(rows.get(0).getText()).toBe('Item 3'); + expect(rows.get(1).getText()).toBe('Item 2'); + + button.click(); + + expect(rows.count()).toBe(5); + expect(rows.get(0).getText()).toBe('Item 4'); + expect(rows.get(1).getText()).toBe('Item 3'); + }); + + it('should add odd class to odd entries', function() { + var button = element(by.buttonText('Add item')); + var rows = element.all(by.repeater('item in items')); + + expect(rows.get(0).getAttribute('class')).toMatch(/odd/); + expect(rows.get(1).getAttribute('class')).not.toMatch(/odd/); + + button.click(); + + expect(rows.get(0).getAttribute('class')).toMatch(/odd/); + expect(rows.get(1).getAttribute('class')).not.toMatch(/odd/); + }); + +
        */ var ngClassOddDirective = classDirective('Odd', 0); @@ -386,6 +448,12 @@ var ngClassOddDirective = classDirective('Odd', 0); * This directive can be applied only within the scope of an * {@link ng.directive:ngRepeat ngRepeat}. * + * @animations + * | Animation | Occurs | + * |----------------------------------|-------------------------------------| + * | {@link ng.$animate#addClass addClass} | just before the class is applied to the element | + * | {@link ng.$animate#removeClass removeClass} | just before the class is removed from the element | + * * @element ANY * @param {expression} ngClassEven {@link guide/expression Expression} to eval. The * result of the evaluation can be a string representing space delimited class names or an array. @@ -418,5 +486,61 @@ var ngClassOddDirective = classDirective('Odd', 0); }); + * + *
        + * @example + * An example on how to implement animations using `ngClassEven`: + * + + +
        + +
        + + + + +
        {{ item }}
        +
        +
        + + .even { + background: rgba(255, 255, 0, 0.25); + } + + .even-add, .even-remove { + transition: 1.5s; + } + + + it('should add new entries to the beginning of the list', function() { + var button = element(by.buttonText('Add item')); + var rows = element.all(by.repeater('item in items')); + + expect(rows.count()).toBe(4); + expect(rows.get(0).getText()).toBe('Item 3'); + expect(rows.get(1).getText()).toBe('Item 2'); + + button.click(); + + expect(rows.count()).toBe(5); + expect(rows.get(0).getText()).toBe('Item 4'); + expect(rows.get(1).getText()).toBe('Item 3'); + }); + + it('should add even class to even entries', function() { + var button = element(by.buttonText('Add item')); + var rows = element.all(by.repeater('item in items')); + + expect(rows.get(0).getAttribute('class')).not.toMatch(/even/); + expect(rows.get(1).getAttribute('class')).toMatch(/even/); + + button.click(); + + expect(rows.get(0).getAttribute('class')).not.toMatch(/even/); + expect(rows.get(1).getAttribute('class')).toMatch(/even/); + }); + +
        */ var ngClassEvenDirective = classDirective('Even', 1); From e4e2024d1c0860b142a915fab3f7beff975aa048 Mon Sep 17 00:00:00 2001 From: Martin Staffa Date: Thu, 8 Feb 2018 17:59:36 +0100 Subject: [PATCH 374/745] chore(code.angularjs.org): increase the cache duration This is already set, but wasn't checked in --- scripts/code.angularjs.org-firebase/functions/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/code.angularjs.org-firebase/functions/index.js b/scripts/code.angularjs.org-firebase/functions/index.js index 90f02fc786eb..33f7ba04df7d 100644 --- a/scripts/code.angularjs.org-firebase/functions/index.js +++ b/scripts/code.angularjs.org-firebase/functions/index.js @@ -6,8 +6,8 @@ const path = require('path'); const gcsBucketId = `${process.env.GCLOUD_PROJECT}.appspot.com`; -const BROWSER_CACHE_DURATION = 300; -const CDN_CACHE_DURATION = 600; +const BROWSER_CACHE_DURATION = 60 * 10; +const CDN_CACHE_DURATION = 60 * 60 * 12; function sendStoredFile(request, response) { let filePathSegments = request.path.split('/').filter((segment) => { From 3ecb00115a95bce3add50680b452436fbf213d8c Mon Sep 17 00:00:00 2001 From: Martin Staffa Date: Mon, 5 Feb 2018 19:26:19 +0100 Subject: [PATCH 375/745] chore(docs.angularjs.org): serve xml files (sitemap) --- scripts/docs.angularjs.org-firebase/firebase.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/docs.angularjs.org-firebase/firebase.json b/scripts/docs.angularjs.org-firebase/firebase.json index 5f5d70dc02d6..91f9a778b634 100644 --- a/scripts/docs.angularjs.org-firebase/firebase.json +++ b/scripts/docs.angularjs.org-firebase/firebase.json @@ -23,7 +23,7 @@ "destination": "/index-production.html" }, { - "source": "**/*!(.jpg|.jpeg|.gif|.png|.html|.js|.map|.json|.css|.svg|.ttf|.txt|.woff|.woff2|.eot)", + "source": "**/*!(.jpg|.jpeg|.gif|.png|.html|.js|.map|.json|.css|.svg|.ttf|.txt|.woff|.woff2|.eot|.xml)", "destination": "/index-production.html" } ] From 3e7a87d7d1be2afea16d0863040fe51e26326d6f Mon Sep 17 00:00:00 2001 From: Martin Staffa Date: Fri, 12 Jan 2018 13:30:05 +0100 Subject: [PATCH 376/745] fix(browserTrigger): support CompositionEvent --- src/ngMock/browserTrigger.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/ngMock/browserTrigger.js b/src/ngMock/browserTrigger.js index 196772d1e3e9..eb80e15964dc 100644 --- a/src/ngMock/browserTrigger.js +++ b/src/ngMock/browserTrigger.js @@ -132,6 +132,24 @@ evnt.keyCode = eventData.keyCode; evnt.charCode = eventData.charCode; evnt.which = eventData.which; + } else if (/composition/.test(eventType)) { + try { + evnt = new window.CompositionEvent(eventType, { + data: eventData.data + }); + } catch (e) { + // Support: IE9+ + evnt = window.document.createEvent('CompositionEvent', {}); + evnt.initCompositionEvent( + eventType, + eventData.bubbles, + eventData.cancelable, + window, + eventData.data, + null + ); + } + } else { evnt = window.document.createEvent('MouseEvents'); x = x || 0; From 2789ccbcf9666b64211c08b188b168175109f563 Mon Sep 17 00:00:00 2001 From: Jae Ik Lee Date: Tue, 26 Dec 2017 03:11:51 +0900 Subject: [PATCH 377/745] fix(input): fix composition mode in IE for Korean input Fixes #6656 Closes #16273 --- src/ng/directive/input.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/ng/directive/input.js b/src/ng/directive/input.js index 7d1bec7cfe9d..3b841d25a348 100644 --- a/src/ng/directive/input.js +++ b/src/ng/directive/input.js @@ -1248,6 +1248,16 @@ function baseInputType(scope, element, attr, ctrl, $sniffer, $browser) { composing = true; }); + // Support: IE9+ + element.on('compositionupdate', function(ev) { + // End composition when ev.data is empty string on 'compositionupdate' event. + // When the input de-focusses (e.g. by clicking away), IE triggers 'compositionupdate' + // instead of 'compositionend'. + if (isUndefined(ev.data) || ev.data === '') { + composing = false; + } + }); + element.on('compositionend', function() { composing = false; listener(); From c484213180470c2a8044eeb09dfdc5ef11099bc8 Mon Sep 17 00:00:00 2001 From: Martin Staffa Date: Fri, 12 Jan 2018 13:30:33 +0100 Subject: [PATCH 378/745] test(input): add test for IE composition bug --- test/ng/directive/inputSpec.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/ng/directive/inputSpec.js b/test/ng/directive/inputSpec.js index 93d2184f969d..8c86b44ceada 100644 --- a/test/ng/directive/inputSpec.js +++ b/test/ng/directive/inputSpec.js @@ -134,6 +134,20 @@ describe('input', function() { browserTrigger(inputElm, 'compositionend'); expect($rootScope.name).toEqual('caitp'); }); + + + it('should end composition on "compositionupdate" when event.data is ""', function() { + // This tests a bug workaround for IE9-11 + // During composition, when an input is de-focussed by clicking away from it, + // the compositionupdate event is called with '', followed by a change event. + var inputElm = helper.compileInput(''); + browserTrigger(inputElm, 'compositionstart'); + helper.changeInputValueTo('caitp'); + expect($rootScope.name).toBeUndefined(); + browserTrigger(inputElm, 'compositionupdate', {data: ''}); + browserTrigger(inputElm, 'change'); + expect($rootScope.name).toEqual('caitp'); + }); }); From 9a0f1abddac5670a0d6efa7689f04d594bb9f274 Mon Sep 17 00:00:00 2001 From: Martin Staffa Date: Thu, 8 Feb 2018 23:43:00 +0100 Subject: [PATCH 379/745] chore(docs.angularjs.org): deploy sitemap.xml Closes #16445 --- Gruntfile.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 6d5b9e09b3df..08ff823f0145 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -162,7 +162,8 @@ module.exports = function(grunt) { clean: { build: ['build'], - tmp: ['tmp'] + tmp: ['tmp'], + deploy: ['uploadDocs', 'uploadCode'] }, eslint: { @@ -326,7 +327,7 @@ module.exports = function(grunt) { files: [ // The source files are needed by the embedded examples in the docs app. { - src: 'build/angular*.{js,js.map,min.js}', + src: ['build/angular*.{js,js.map,min.js}', 'build/sitemap.xml'], dest: 'uploadDocs/', expand: true, flatten: true @@ -363,10 +364,6 @@ module.exports = function(grunt) { }, shell: { - // Travis expects the firebase.json in the repository root, but we have it in a sub-folder - 'symlink-firebase-docs': { - command: 'ln -s ./scripts/docs.angularjs.org-firebase/firebase.json ./firebase.json' - }, 'install-node-dependencies': { command: 'yarn' }, From 32b1a0c5807a6b3148543676b920543e32162c69 Mon Sep 17 00:00:00 2001 From: Martin Staffa Date: Thu, 25 Jan 2018 19:35:04 +0100 Subject: [PATCH 380/745] chore(docs.angularjs.org): actually fix deployment When a file is symlinked, relative paths obviously aren't correct anymore. This error was masked because Travis didn't fail the job when Firebase couldn't find the public folder. To fix, we copy the file and adjust the folder path --- Gruntfile.js | 2 +- lib/grunt/plugins.js | 5 +++++ lib/grunt/utils.js | 11 +++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index 08ff823f0145..19732e7e1842 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -463,7 +463,7 @@ module.exports = function(grunt) { 'package', 'compress:deployFirebaseCode', 'copy:deployFirebaseCode', - 'shell:symlink-firebase-docs', + 'firebaseDocsJsonForTravis', 'copy:deployFirebaseDocs' ]); grunt.registerTask('default', ['package']); diff --git a/lib/grunt/plugins.js b/lib/grunt/plugins.js index 2d71b85501eb..7e5dc290b533 100644 --- a/lib/grunt/plugins.js +++ b/lib/grunt/plugins.js @@ -62,4 +62,9 @@ module.exports = function(grunt) { grunt.registerTask('collect-errors', 'Combine stripped error files', function() { util.collectErrors(); }); + + grunt.registerTask('firebaseDocsJsonForTravis', function() { + util.firebaseDocsJsonForTravis(); + }); + }; diff --git a/lib/grunt/utils.js b/lib/grunt/utils.js index 52dbcde8fa5e..80e529186514 100644 --- a/lib/grunt/utils.js +++ b/lib/grunt/utils.js @@ -292,5 +292,16 @@ module.exports = { } next(); }; + }, + + // Our Firebase projects are in subfolders, but Travis expects them in the root, + // so we need to modify the upload folder path and copy the file into the root + firebaseDocsJsonForTravis: function() { + var fileName = 'scripts/docs.angularjs.org-firebase/firebase.json'; + var json = grunt.file.readJSON(fileName); + + json.hosting.public = 'uploadDocs'; + + grunt.file.write('firebase.json', JSON.stringify(json)); } }; From a7a9688962039fb5af5e073faddbc239a9479e9b Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Sun, 11 Feb 2018 18:15:23 +0200 Subject: [PATCH 381/745] fix(docs): fix `@media` breakpoints for small/extra small devices Previously, our custom styles used `@media` breakpoints for small/extra small devices that were off-by-one from [Bootstrap breakpoints](https://getbootstrap.com/docs/3.3/css/#responsive-utilities-classes) (767px vs 768px). This caused the site to not be displayed correctly on these exact sizes, which affected for example all iPad devices (whose screens are exactly 768px wide). This commit fixes it by making our breakpoints match those of Bootstrap. Fixes #16448 Closes #16449 --- docs/app/assets/css/docs.css | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/app/assets/css/docs.css b/docs/app/assets/css/docs.css index ba69449090eb..54d81ada753d 100644 --- a/docs/app/assets/css/docs.css +++ b/docs/app/assets/css/docs.css @@ -713,14 +713,14 @@ ul.events > li { margin-right: 5px; } -@media only screen and (min-width: 769px) { +@media only screen and (min-width: 768px) { [ng-include="partialPath"].ng-hide { display: block !important; visibility: hidden; } } -@media only screen and (min-width: 769px) and (max-width: 991px) { +@media only screen and (min-width: 768px) and (max-width: 991px) { .main-body-grid { margin-top: 160px; } @@ -729,7 +729,7 @@ ul.events > li { } } -@media only screen and (max-width : 768px) { +@media only screen and (max-width: 767px) { .picker, .picker select { width: auto; display: block; From 9f1793fd2dc92225991f9db5ec661af6f86206ca Mon Sep 17 00:00:00 2001 From: Martin Staffa Date: Mon, 12 Feb 2018 12:26:32 +0100 Subject: [PATCH 382/745] chore(eslint): allow ES6 for node scripts --- .eslintrc-node.json | 9 +++++++-- Gruntfile.js | 1 + package.json | 1 + yarn.lock | 4 ++++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.eslintrc-node.json b/.eslintrc-node.json index 643f345d88e0..c16a8a883837 100644 --- a/.eslintrc-node.json +++ b/.eslintrc-node.json @@ -1,8 +1,13 @@ { "extends": "./.eslintrc-base.json", - "env": { "browser": false, "node": true - } + }, + "parserOptions": { + "ecmaVersion": 2017 + }, + "plugins": [ + "promise" + ] } diff --git a/Gruntfile.js b/Gruntfile.js index 19732e7e1842..0d6dc6b956be 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -174,6 +174,7 @@ module.exports = function(grunt) { 'docs/**/*.js', 'lib/**/*.js', 'scripts/**/*.js', + '!scripts/*/*/node_modules/**', 'src/**/*.js', 'test/**/*.js', 'i18n/**/*.js', diff --git a/package.json b/package.json index 255b569f30a6..c82bb19a829f 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,7 @@ "cz-conventional-changelog": "1.1.4", "dgeni": "^0.4.0", "dgeni-packages": "^0.16.4", + "eslint-plugin-promise": "^3.6.0", "event-stream": "~3.1.0", "glob": "^6.0.1", "google-code-prettify": "1.0.1", diff --git a/yarn.lock b/yarn.lock index 62016649857b..f635a238b14d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1994,6 +1994,10 @@ escope@^3.6.0: esrecurse "^4.1.0" estraverse "^4.1.1" +eslint-plugin-promise@^3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-3.6.0.tgz#54b7658c8f454813dc2a870aff8152ec4969ba75" + eslint@^3.0.0: version "3.15.0" resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.15.0.tgz#bdcc6a6c5ffe08160e7b93c066695362a91e30f2" From e1e2100e66acf79bafed7e07fbbdf7d865b2b035 Mon Sep 17 00:00:00 2001 From: Martin Staffa Date: Fri, 9 Feb 2018 20:18:29 +0100 Subject: [PATCH 383/745] chore(code.angularjs.org): don't gzip compressed image files --- Gruntfile.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 0d6dc6b956be..5cc2dd778620 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -315,12 +315,12 @@ module.exports = function(grunt) { }, deployFirebaseCode: { files: [ - // the zip file should not be compressed again. + // copy files that are not handled by compress { - src: 'build/*.zip', + cwd: 'build', + src: '**/*.{zip,jpg,jpeg,png}', dest: 'uploadCode/' + deployVersion + '/', - expand: true, - flatten: true + expand: true } ] }, @@ -357,7 +357,8 @@ module.exports = function(grunt) { options: { mode: 'gzip' }, - src: ['**', '!*.zip'], + // Already compressed files should not be compressed again + src: ['**', '!**/*.{zip,png,jpeg,jpg}'], cwd: 'build', expand: true, dest: 'uploadCode/' + deployVersion + '/' From 9196c80c3394d0afcfc4f3ab0ec881d501190fe3 Mon Sep 17 00:00:00 2001 From: Martin Staffa Date: Mon, 12 Feb 2018 10:47:42 +0100 Subject: [PATCH 384/745] chore(deploy): rename deploy folders --- .gitignore | 1 + .travis.yml | 2 +- Gruntfile.js | 17 +++++++++++------ lib/grunt/utils.js | 6 ++++-- .../docs.angularjs.org-firebase/firebase.json | 2 +- scripts/travis/build.sh | 2 +- 6 files changed, 19 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 2da934151e89..588beda3f172 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /build/ +/deploy/ /benchpress-build/ .DS_Store gen_docs.disable diff --git a/.travis.yml b/.travis.yml index 4c226f02fe85..3199f7718d4b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -94,7 +94,7 @@ jobs: secret_access_key: secure: tHIFdSq55qkyZf9zT/3+VkhUrTvOTMuswxXU3KyWaBrSieZqG0UnUDyNm+n3lSfX95zEl/+rJAWbfvhVSxZi13ndOtvRF+MdI1cvow2JynP0aDSiPffEvVrZOmihD6mt2SlMfhskr5FTduQ69kZG6DfLcve1PPDaIwnbOv3phb8= bucket: code-angularjs-org-338b8.appspot.com - local-dir: uploadCode + local-dir: deploy/code detect_encoding: true # detects gzip compression on: repo: angular/angular.js diff --git a/Gruntfile.js b/Gruntfile.js index 5cc2dd778620..c42113fc2ee4 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -163,7 +163,10 @@ module.exports = function(grunt) { clean: { build: ['build'], tmp: ['tmp'], - deploy: ['uploadDocs', 'uploadCode'] + deploy: [ + 'deploy/docs', + 'deploy/code' + ] }, eslint: { @@ -319,7 +322,7 @@ module.exports = function(grunt) { { cwd: 'build', src: '**/*.{zip,jpg,jpeg,png}', - dest: 'uploadCode/' + deployVersion + '/', + dest: 'deploy/code/' + deployVersion + '/', expand: true } ] @@ -329,14 +332,16 @@ module.exports = function(grunt) { // The source files are needed by the embedded examples in the docs app. { src: ['build/angular*.{js,js.map,min.js}', 'build/sitemap.xml'], - dest: 'uploadDocs/', + dest: 'deploy/docs/', expand: true, flatten: true }, { cwd: 'build/docs', src: '**', - dest: 'uploadDocs/', + dest: 'deploy/docs/', + expand: true + } expand: true } ] @@ -361,7 +366,7 @@ module.exports = function(grunt) { src: ['**', '!**/*.{zip,png,jpeg,jpg}'], cwd: 'build', expand: true, - dest: 'uploadCode/' + deployVersion + '/' + dest: 'deploy/code/' + deployVersion + '/' } }, @@ -461,7 +466,7 @@ module.exports = function(grunt) { 'merge-conflict', 'eslint' ]); - grunt.registerTask('prepareFirebaseDeploy', [ + grunt.registerTask('prepareDeploy', [ 'package', 'compress:deployFirebaseCode', 'copy:deployFirebaseCode', diff --git a/lib/grunt/utils.js b/lib/grunt/utils.js index 80e529186514..c5b16946ba8d 100644 --- a/lib/grunt/utils.js +++ b/lib/grunt/utils.js @@ -297,10 +297,12 @@ module.exports = { // Our Firebase projects are in subfolders, but Travis expects them in the root, // so we need to modify the upload folder path and copy the file into the root firebaseDocsJsonForTravis: function() { - var fileName = 'scripts/docs.angularjs.org-firebase/firebase.json'; + var docsScriptFolder = 'scripts/docs.angularjs.org-firebase/'; + + var fileName = docsScriptFolder + 'firebase.json'; var json = grunt.file.readJSON(fileName); - json.hosting.public = 'uploadDocs'; + json.hosting.public = 'deploy/docs'; grunt.file.write('firebase.json', JSON.stringify(json)); } diff --git a/scripts/docs.angularjs.org-firebase/firebase.json b/scripts/docs.angularjs.org-firebase/firebase.json index 91f9a778b634..abb70329f815 100644 --- a/scripts/docs.angularjs.org-firebase/firebase.json +++ b/scripts/docs.angularjs.org-firebase/firebase.json @@ -1,6 +1,6 @@ { "hosting": { - "public": "../../uploadDocs", + "public": "../../deploy/docs", "ignore": [ "/index.html", "/index-debug.html", diff --git a/scripts/travis/build.sh b/scripts/travis/build.sh index fdf94d8f13de..980855388492 100755 --- a/scripts/travis/build.sh +++ b/scripts/travis/build.sh @@ -79,7 +79,7 @@ case "$JOB" in fi if [[ "$DEPLOY_DOCS" == true || "$DEPLOY_CODE" == true ]]; then - grunt prepareFirebaseDeploy + grunt prepareDeploy else echo "Skipping deployment build because conditions have not been met." fi From 75bf199421011466b799b2eeec5223c0a9143516 Mon Sep 17 00:00:00 2001 From: Martin Staffa Date: Mon, 12 Feb 2018 10:49:19 +0100 Subject: [PATCH 385/745] chore(docs.angularjs.org): serve snapshots for googlebot This commit restores serving the plain partials (content) when a docs page is accessed with ?_escaped_fragment_=. The Google Ajax Crawler accesses these urls when the page has `` is set. During the migration to Firebase, this was lost, which resulted in Google dropping the docs almost completely from the index. We are using a Firebase cloud function to serve the partials. Since we cannot access the static hosted files from the function, we have to deploy them as part of the function directory instead, from which they can be read. Related to #16432 Related to #16417 --- Gruntfile.js | 17 +- lib/grunt/utils.js | 5 +- .../docs.angularjs.org-firebase/firebase.json | 11 +- .../functions/index.js | 49 + .../functions/package-lock.json | 4265 +++++++++++++++++ .../functions/package.json | 21 + .../readme.firebase.docs.md | 17 +- 7 files changed, 4376 insertions(+), 9 deletions(-) create mode 100644 scripts/docs.angularjs.org-firebase/functions/index.js create mode 100644 scripts/docs.angularjs.org-firebase/functions/package-lock.json create mode 100644 scripts/docs.angularjs.org-firebase/functions/package.json diff --git a/Gruntfile.js b/Gruntfile.js index c42113fc2ee4..ba5efa0d8f09 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -13,6 +13,8 @@ var semver = require('semver'); var exec = require('shelljs').exec; var pkg = require(__dirname + '/package.json'); +var docsScriptFolder = 'scripts/docs.angularjs.org-firebase'; + // Node.js version checks if (!semver.satisfies(process.version, pkg.engines.node)) { reportOrFail('Invalid node version (' + process.version + '). ' + @@ -165,7 +167,8 @@ module.exports = function(grunt) { tmp: ['tmp'], deploy: [ 'deploy/docs', - 'deploy/code' + 'deploy/code', + docsScriptFolder + '/functions/html' ] }, @@ -341,7 +344,17 @@ module.exports = function(grunt) { src: '**', dest: 'deploy/docs/', expand: true - } + }, + { + src: ['build/docs/index-production.html'], + dest: docsScriptFolder + '/functions/content', + expand: true, + flatten: true + }, + { + cwd: 'build/docs', + src: 'partials/**', + dest: docsScriptFolder + '/functions/content', expand: true } ] diff --git a/lib/grunt/utils.js b/lib/grunt/utils.js index c5b16946ba8d..64ddc6f185ec 100644 --- a/lib/grunt/utils.js +++ b/lib/grunt/utils.js @@ -297,12 +297,13 @@ module.exports = { // Our Firebase projects are in subfolders, but Travis expects them in the root, // so we need to modify the upload folder path and copy the file into the root firebaseDocsJsonForTravis: function() { - var docsScriptFolder = 'scripts/docs.angularjs.org-firebase/'; + var docsScriptFolder = 'scripts/docs.angularjs.org-firebase'; - var fileName = docsScriptFolder + 'firebase.json'; + var fileName = docsScriptFolder + '/firebase.json'; var json = grunt.file.readJSON(fileName); json.hosting.public = 'deploy/docs'; + json.functions.source = docsScriptFolder + '/functions'; grunt.file.write('firebase.json', JSON.stringify(json)); } diff --git a/scripts/docs.angularjs.org-firebase/firebase.json b/scripts/docs.angularjs.org-firebase/firebase.json index abb70329f815..880a5eca86de 100644 --- a/scripts/docs.angularjs.org-firebase/firebase.json +++ b/scripts/docs.angularjs.org-firebase/firebase.json @@ -23,9 +23,14 @@ "destination": "/index-production.html" }, { - "source": "**/*!(.jpg|.jpeg|.gif|.png|.html|.js|.map|.json|.css|.svg|.ttf|.txt|.woff|.woff2|.eot|.xml)", - "destination": "/index-production.html" + "source": "**/*!(.@(jpg|jpeg|gif|png|html|js|map|json|css|svg|ttf|txt|woff|woff2|eot|xml))", + "function": "sendFile" } ] + }, + "functions": { + "predeploy": [ + "npm --prefix $RESOURCE_DIR run lint" + ] } -} \ No newline at end of file +} diff --git a/scripts/docs.angularjs.org-firebase/functions/index.js b/scripts/docs.angularjs.org-firebase/functions/index.js new file mode 100644 index 000000000000..b86eb32f642a --- /dev/null +++ b/scripts/docs.angularjs.org-firebase/functions/index.js @@ -0,0 +1,49 @@ +'use strict'; + +const functions = require('firebase-functions'); +const fs = require('fs'); + +const BROWSER_CACHE_DURATION = 60 * 60; +const CDN_CACHE_DURATION = 60 * 60 * 12; + +const headers = { + 'Cache-Control': `public max-age=${BROWSER_CACHE_DURATION} s-maxage=${CDN_CACHE_DURATION}` +}; + +const buildSnapshot = data => ` + + + + + + + + ${data} + + `; + +function sendFile(request, response) { + + const snapshotRequested = typeof request.query._escaped_fragment_ !== 'undefined'; + const filePath = `content/${snapshotRequested ? `partials${request.path}` : 'index-production'}.html`; + + if (snapshotRequested) { + fs.readFile(filePath, {encoding: 'utf8'}, (error, data) => { + if (error) { + response + .status(404) + .end(); + } else { + response + .set(headers) + .send(buildSnapshot(data)); + } + }); + } else { + response + .set(headers) + .sendFile(filePath, {root: __dirname}); + } +} + +exports.sendFile = functions.https.onRequest(sendFile); diff --git a/scripts/docs.angularjs.org-firebase/functions/package-lock.json b/scripts/docs.angularjs.org-firebase/functions/package-lock.json new file mode 100644 index 000000000000..913ba90ff890 --- /dev/null +++ b/scripts/docs.angularjs.org-firebase/functions/package-lock.json @@ -0,0 +1,4265 @@ +{ + "name": "functions", + "requires": true, + "lockfileVersion": 1, + "dependencies": { + "@firebase/app": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/@firebase/app/-/app-0.1.8.tgz", + "integrity": "sha512-LkXMugZ2Z2S0r9zH62YNRhCscstFqJuufEjJmb/XWCTjCKzJZKdbE/6A+WNTitNSHgAkKEF0NoGsIuyhYAubkg==", + "requires": { + "@firebase/app-types": "0.1.1", + "@firebase/util": "0.1.8" + } + }, + "@firebase/app-types": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@firebase/app-types/-/app-types-0.1.1.tgz", + "integrity": "sha512-0CmY/orojHIJiTyDXUqrAtCSmk2nWw7h7qamJUPcBRgAIfc3ZsjFBLo1zj0sRVzZYbTWS9cKBC8tnpFZlEMLPw==" + }, + "@firebase/database": { + "version": "0.1.9", + "resolved": "https://registry.npmjs.org/@firebase/database/-/database-0.1.9.tgz", + "integrity": "sha512-w7bsItAvUDMGDX7v2NTIHmt5yRYDWAdUKqC7p152dopGw6AAFgxhR5jAikq7qB2UOPB1vRy8KHlcMk3RnF6cXw==", + "requires": { + "@firebase/database-types": "0.1.1", + "@firebase/util": "0.1.8", + "faye-websocket": "0.11.1" + }, + "dependencies": { + "faye-websocket": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.1.tgz", + "integrity": "sha1-8O/hjE9W5PQK/H4Gxxn9XuYYjzg=", + "requires": { + "websocket-driver": "0.7.0" + } + } + } + }, + "@firebase/database-types": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@firebase/database-types/-/database-types-0.1.1.tgz", + "integrity": "sha512-LbLnwXFeQuxQrsuUccbiXX4j3wdajLPNcbivzypJhww+VU4W/4grnbVn/zPlRlMcG6jTwSyBnjdtJFKMSeNU+A==" + }, + "@firebase/util": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/@firebase/util/-/util-0.1.8.tgz", + "integrity": "sha512-SfWLSfp1MXb5ItG3wGfdxxIDzFMcjq2E0iz9C7sstzD3mJ8/q55Sd8esAL3VQx5jD/hbfKUypsBczr5A0ML7Tw==" + }, + "@google-cloud/common": { + "version": "0.15.1", + "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-0.15.1.tgz", + "integrity": "sha512-cnVtHLvyiSQvb1RzXWDp7PA1sA8Jmc47+wp/xwHwdGOlQZfKog5iluZ0C/LB8iklFXpcTwlNMorqLuZ/qH0DDA==", + "requires": { + "array-uniq": "1.0.3", + "arrify": "1.0.1", + "concat-stream": "1.6.0", + "create-error-class": "3.0.2", + "duplexify": "3.5.3", + "ent": "2.2.0", + "extend": "3.0.1", + "google-auto-auth": "0.8.2", + "is": "3.2.1", + "log-driver": "1.2.6", + "methmeth": "1.1.0", + "modelo": "4.2.3", + "request": "2.83.0", + "retry-request": "3.3.1", + "split-array-stream": "1.0.3", + "stream-events": "1.0.2", + "string-format-obj": "1.1.1", + "through2": "2.0.3" + } + }, + "@google-cloud/common-grpc": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/@google-cloud/common-grpc/-/common-grpc-0.5.5.tgz", + "integrity": "sha512-wgtuBcgTZ7cUMGQV9MSz4y0+FReLqdsOOgzOifu+lsnRh9qsMEZJ9sBDLB6NrRxrvcAHZc4ayiBx7B7i5cDYoA==", + "requires": { + "@google-cloud/common": "0.16.1", + "dot-prop": "4.2.0", + "duplexify": "3.5.3", + "extend": "3.0.1", + "grpc": "1.7.3", + "is": "3.2.1", + "modelo": "4.2.3", + "retry-request": "3.3.1", + "through2": "2.0.3" + }, + "dependencies": { + "@google-cloud/common": { + "version": "0.16.1", + "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-0.16.1.tgz", + "integrity": "sha512-1sufDsSfgJ7fuBLq+ux8t3TlydMlyWl9kPZx2WdLINkGtf5RjvXX6EWYZiCMKe8flJ3oC0l95j5atN2uX5n3rg==", + "requires": { + "array-uniq": "1.0.3", + "arrify": "1.0.1", + "concat-stream": "1.6.0", + "create-error-class": "3.0.2", + "duplexify": "3.5.3", + "ent": "2.2.0", + "extend": "3.0.1", + "google-auto-auth": "0.9.3", + "is": "3.2.1", + "log-driver": "1.2.5", + "methmeth": "1.1.0", + "modelo": "4.2.3", + "request": "2.83.0", + "retry-request": "3.3.1", + "split-array-stream": "1.0.3", + "stream-events": "1.0.2", + "string-format-obj": "1.1.1", + "through2": "2.0.3" + } + }, + "gcp-metadata": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-0.4.1.tgz", + "integrity": "sha512-yFE7v+NyoMiTOi2L6r8q87eVbiZCKooJNPKXTHhBStga8pwwgWofK9iHl00qd0XevZxcpk7ORaEL/ALuTvlaGQ==", + "requires": { + "extend": "3.0.1", + "retry-request": "3.3.1" + } + }, + "google-auto-auth": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/google-auto-auth/-/google-auto-auth-0.9.3.tgz", + "integrity": "sha512-TbOZZs0WJOolrRmdQLK5qmWdOJQFG1oPnxcIBbAwL7XCWcv3XgZ9gHJ6W4byrdEZT8TahNFgMfkHd73mqxM9dw==", + "requires": { + "async": "2.6.0", + "gcp-metadata": "0.4.1", + "google-auth-library": "0.12.0", + "request": "2.83.0" + } + }, + "log-driver": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.5.tgz", + "integrity": "sha1-euTsJXMC/XkNVXyxDJcQDYV7AFY=" + } + } + }, + "@google-cloud/firestore": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/@google-cloud/firestore/-/firestore-0.11.2.tgz", + "integrity": "sha512-Dp5Im5y6LfJ2OuuGN/PX/w7+LdKPRhKbhgNOaUjreIULo7Ya9AyRMYn/E+w8Rm+b3CZXM7fzVpkkdg9Thq8uUQ==", + "requires": { + "@google-cloud/common": "0.15.1", + "@google-cloud/common-grpc": "0.5.5", + "bun": "0.0.12", + "extend": "3.0.1", + "functional-red-black-tree": "1.0.1", + "google-gax": "0.14.5", + "is": "3.2.1", + "safe-buffer": "5.1.1", + "through2": "2.0.3" + } + }, + "@google-cloud/storage": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-1.5.2.tgz", + "integrity": "sha512-E97x2oZr9w0N26H0LtyjR3XLFSLYXH5D8y8HwEZRWQnNVF9sO+x16MEhdHFdFclgdx687eGeCYbDVKpP+dKb6w==", + "requires": { + "@google-cloud/common": "0.15.1", + "arrify": "1.0.1", + "async": "2.6.0", + "concat-stream": "1.6.0", + "create-error-class": "3.0.2", + "duplexify": "3.5.3", + "extend": "3.0.1", + "gcs-resumable-upload": "0.8.2", + "hash-stream-validation": "0.2.1", + "is": "3.2.1", + "mime-types": "2.1.17", + "once": "1.4.0", + "pumpify": "1.4.0", + "request": "2.83.0", + "safe-buffer": "5.1.1", + "snakeize": "0.1.0", + "stream-events": "1.0.2", + "string-format-obj": "1.1.1", + "through2": "2.0.3" + } + }, + "@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78=" + }, + "@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" + }, + "@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" + }, + "@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A=" + }, + "@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=", + "requires": { + "@protobufjs/aspromise": "1.1.2", + "@protobufjs/inquire": "1.1.0" + } + }, + "@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E=" + }, + "@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=" + }, + "@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0=" + }, + "@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q=" + }, + "@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" + }, + "@types/body-parser": { + "version": "1.16.8", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.16.8.tgz", + "integrity": "sha512-BdN2PXxOFnTXFcyONPW6t0fHjz2fvRZHVMFpaS0wYr+Y8fWEaNOs4V8LEu/fpzQlMx+ahdndgTaGTwPC+J/EeA==", + "requires": { + "@types/express": "4.11.1", + "@types/node": "8.9.3" + } + }, + "@types/events": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@types/events/-/events-1.1.0.tgz", + "integrity": "sha512-y3bR98mzYOo0pAZuiLari+cQyiKk3UXRuT45h1RjhfeCzqkjaVsfZJNaxdgtk7/3tzOm1ozLTqEqMP3VbI48jw==" + }, + "@types/express": { + "version": "4.11.1", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.11.1.tgz", + "integrity": "sha512-ttWle8cnPA5rAelauSWeWJimtY2RsUf2aspYZs7xPHiWgOlPn6nnUfBMtrkcnjFJuIHJF4gNOdVvpLK2Zmvh6g==", + "requires": { + "@types/body-parser": "1.16.8", + "@types/express-serve-static-core": "4.11.1", + "@types/serve-static": "1.13.1" + } + }, + "@types/express-serve-static-core": { + "version": "4.11.1", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.11.1.tgz", + "integrity": "sha512-EehCl3tpuqiM8RUb+0255M8PhhSwTtLfmO7zBBdv0ay/VTd/zmrqDfQdZFsa5z/PVMbH2yCMZPXsnrImpATyIw==", + "requires": { + "@types/events": "1.1.0", + "@types/node": "8.9.3" + } + }, + "@types/google-cloud__storage": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/@types/google-cloud__storage/-/google-cloud__storage-1.1.7.tgz", + "integrity": "sha512-010Llp+5ze+XWWmZuLDxs0pZgFjOgtJQVt9icJ0Ed67ZFLq7PnXkYx8x/k9nwDojR5/X4XoLPNqB1F627TScdQ==", + "requires": { + "@types/node": "8.9.3" + } + }, + "@types/jsonwebtoken": { + "version": "7.2.5", + "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-7.2.5.tgz", + "integrity": "sha512-8CIcK1Vzq4w5TJyJYkLVhqASmCo1FSO1XIPQM1qv+Xo2nnb9RoRHxx8pkIzSZ4Tm9r3V4ZyFbF/fBewNPdclwA==", + "requires": { + "@types/node": "8.9.3" + } + }, + "@types/lodash": { + "version": "4.14.102", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.102.tgz", + "integrity": "sha512-k/SxycYmVc6sYo6kzm8cABHcbMs9MXn6jYsja1hLvZ/x9e31VHRRn+1UzWdpv6doVchphvKaOsZ0VTqbF7zvNg==" + }, + "@types/long": { + "version": "3.0.32", + "resolved": "https://registry.npmjs.org/@types/long/-/long-3.0.32.tgz", + "integrity": "sha512-ZXyOOm83p7X8p3s0IYM3VeueNmHpkk/yMlP8CLeOnEcu6hIwPH7YjZBvhQkR0ZFS2DqZAxKtJ/M5fcuv3OU5BA==" + }, + "@types/mime": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-2.0.0.tgz", + "integrity": "sha512-A2TAGbTFdBw9azHbpVd+/FkdW2T6msN1uct1O9bH3vTerEHKZhTXJUQXy+hNq1B0RagfU8U+KBdqiZpxjhOUQA==" + }, + "@types/node": { + "version": "8.9.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-8.9.3.tgz", + "integrity": "sha512-wqrPE4Uvj2fmL0E5JFQiY7D/5bAKvVUfWTnQ5NEV35ULkAU0j3QuqIi9Qyrytz8M5hsrh8Kijt+FsdLQaZR+IA==" + }, + "@types/serve-static": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.1.tgz", + "integrity": "sha512-jDMH+3BQPtvqZVIcsH700Dfi8Q3MIcEx16g/VdxjoqiGR/NntekB10xdBpirMKnPe9z2C5cBmL0vte0YttOr3Q==", + "requires": { + "@types/express-serve-static-core": "4.11.1", + "@types/mime": "2.0.0" + } + }, + "@types/sha1": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/sha1/-/sha1-1.1.1.tgz", + "integrity": "sha512-Yrz4TPsm/xaw7c39aTISskNirnRJj2W9OVeHv8ooOR9SG8NHEfh4lwvGeN9euzxDyPfBdFkvL/VHIY3kM45OpQ==", + "requires": { + "@types/node": "8.9.3" + } + }, + "accepts": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.4.tgz", + "integrity": "sha1-hiRnWMfdbSGmR0/whKR0DsBesh8=", + "requires": { + "mime-types": "2.1.17", + "negotiator": "0.6.1" + } + }, + "acorn": { + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz", + "integrity": "sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c=" + }, + "acorn-es7-plugin": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/acorn-es7-plugin/-/acorn-es7-plugin-1.1.7.tgz", + "integrity": "sha1-8u4fMiipDurRJF+asZIusucdM2s=" + }, + "acorn-jsx": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", + "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", + "dev": true, + "requires": { + "acorn": "3.3.0" + }, + "dependencies": { + "acorn": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", + "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", + "dev": true + } + } + }, + "ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "requires": { + "co": "4.6.0", + "fast-deep-equal": "1.0.0", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.3.1" + } + }, + "ajv-keywords": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz", + "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=", + "dev": true + }, + "ansi-escapes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.0.0.tgz", + "integrity": "sha512-O/klc27mWNUigtv0F8NJWbLF00OcegQalkqKURWdosW08YZKi4m6CnSUSvIZG1otNJbTWhN01Hhz389DW7mvDQ==", + "dev": true + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "argparse": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz", + "integrity": "sha1-c9g7wmP4bpf4zE9rrhsOkKfSLIY=", + "dev": true, + "requires": { + "sprintf-js": "1.0.3" + } + }, + "arguejs": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/arguejs/-/arguejs-0.2.3.tgz", + "integrity": "sha1-tvk59f4OPNHz+T4qqSYkJL8xKvc=" + }, + "array-filter": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-1.0.0.tgz", + "integrity": "sha1-uveeYubvTCpMC4MSMtr/7CUfnYM=" + }, + "array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" + }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "requires": { + "array-uniq": "1.0.3" + } + }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=" + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=" + }, + "ascli": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ascli/-/ascli-1.0.1.tgz", + "integrity": "sha1-vPpZdKYvGOgcq660lzKrSoj5Brw=", + "requires": { + "colour": "0.7.1", + "optjs": "3.2.2" + } + }, + "asn1": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", + "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=" + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + }, + "async": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz", + "integrity": "sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==", + "requires": { + "lodash": "4.17.5" + } + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" + }, + "aws4": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", + "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=" + }, + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "esutils": "2.0.2", + "js-tokens": "3.0.2" + }, + "dependencies": { + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + } + } + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "base64url": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/base64url/-/base64url-2.0.0.tgz", + "integrity": "sha1-6sFuA+oUOO/5Qj1puqNiYu0fcLs=" + }, + "bcrypt-pbkdf": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", + "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", + "optional": true, + "requires": { + "tweetnacl": "0.14.5" + } + }, + "bl": { + "version": "0.9.5", + "resolved": "https://registry.npmjs.org/bl/-/bl-0.9.5.tgz", + "integrity": "sha1-wGt5evCF6gC8Unr8jvzxHeIjIFQ=", + "requires": { + "readable-stream": "1.0.34" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + } + } + }, + "body-parser": { + "version": "1.18.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.2.tgz", + "integrity": "sha1-h2eKGdhLR9hZuDGZvVm84iKxBFQ=", + "requires": { + "bytes": "3.0.0", + "content-type": "1.0.4", + "debug": "2.6.9", + "depd": "1.1.2", + "http-errors": "1.6.2", + "iconv-lite": "0.4.19", + "on-finished": "2.3.0", + "qs": "6.5.1", + "raw-body": "2.3.2", + "type-is": "1.6.15" + } + }, + "boom": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz", + "integrity": "sha1-T4owBctKfjiJ90kDD9JbluAdLjE=", + "requires": { + "hoek": "4.2.0" + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "buffer-equal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-1.0.0.tgz", + "integrity": "sha1-WWFrSYME1Var1GaWayLu2j7KX74=" + }, + "buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" + }, + "bun": { + "version": "0.0.12", + "resolved": "https://registry.npmjs.org/bun/-/bun-0.0.12.tgz", + "integrity": "sha512-Toms18J9DqnT+IfWkwxVTB2EaBprHvjlMWrTIsfX4xbu3ZBqVBwrERU0em1IgtRe04wT+wJxMlKHZok24hrcSQ==", + "requires": { + "readable-stream": "1.0.34" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + } + } + }, + "bytebuffer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/bytebuffer/-/bytebuffer-5.0.1.tgz", + "integrity": "sha1-WC7qSxqHO20CCkjVjfhfC7ps/d0=", + "requires": { + "long": "3.2.0" + } + }, + "bytes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", + "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" + }, + "call-signature": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/call-signature/-/call-signature-0.0.2.tgz", + "integrity": "sha1-qEq8glpV70yysCi9dOIFpluaSZY=" + }, + "caller-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", + "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", + "dev": true, + "requires": { + "callsites": "0.2.0" + } + }, + "callsites": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", + "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", + "dev": true + }, + "camelcase": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", + "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=" + }, + "capture-stack-trace": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/capture-stack-trace/-/capture-stack-trace-1.0.0.tgz", + "integrity": "sha1-Sm+gc5nCa7pH8LJJa00PtAjFVQ0=" + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + }, + "chalk": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.1.tgz", + "integrity": "sha512-QUU4ofkDoMIVO7hcx1iPTISs88wsO8jA92RQIm4JAwZvFGGAV2hSAA1NX7oVj2Ej2Q6NDTcRDjPTFrMCRZoJ6g==", + "dev": true, + "requires": { + "ansi-styles": "3.2.0", + "escape-string-regexp": "1.0.5", + "supports-color": "5.2.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "supports-color": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.2.0.tgz", + "integrity": "sha512-F39vS48la4YvTZUPVeTqsjsFNrvcMwrV3RLZINsmHo+7djCvuUzSIeXOnZ5hmjef4bajL1dNccN+tg5XAliO5Q==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "chardet": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", + "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", + "dev": true + }, + "charenc": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", + "integrity": "sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc=" + }, + "circular-json": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", + "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", + "dev": true + }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "dev": true, + "requires": { + "restore-cursor": "2.0.0" + } + }, + "cli-width": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "dev": true + }, + "cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "requires": { + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wrap-ansi": "2.1.0" + } + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" + }, + "codecov.io": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/codecov.io/-/codecov.io-0.0.1.tgz", + "integrity": "sha1-JeorCV4enqEYcr36WEIRgTDfeLE=", + "requires": { + "request": "2.42.0", + "urlgrey": "0.4.0" + }, + "dependencies": { + "asn1": { + "version": "0.1.11", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz", + "integrity": "sha1-VZvhg3bQik7E2+gId9J4GGObLfc=", + "optional": true + }, + "assert-plus": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.1.5.tgz", + "integrity": "sha1-7nQAlBMALYTOxyGcasgRgS5yMWA=", + "optional": true + }, + "async": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", + "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=", + "optional": true + }, + "aws-sign2": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.5.0.tgz", + "integrity": "sha1-xXED96F/wDfwLXwuZLYC6iI/fWM=", + "optional": true + }, + "boom": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/boom/-/boom-0.4.2.tgz", + "integrity": "sha1-emNune1O/O+xnO9JR6PGffrukRs=", + "requires": { + "hoek": "0.9.1" + } + }, + "caseless": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.6.0.tgz", + "integrity": "sha1-gWfBq4OX+1u5X5bSjlqBxQ8kesQ=" + }, + "combined-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.7.tgz", + "integrity": "sha1-ATfmV7qlp1QcV6w3rF/AfXO03B8=", + "optional": true, + "requires": { + "delayed-stream": "0.0.5" + } + }, + "cryptiles": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-0.2.2.tgz", + "integrity": "sha1-7ZH/HxetE9N0gohZT4pIoNJvMlw=", + "optional": true, + "requires": { + "boom": "0.4.2" + } + }, + "delayed-stream": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz", + "integrity": "sha1-1LH0OpPoKW3+AmlPRoC8N6MTxz8=", + "optional": true + }, + "forever-agent": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.5.2.tgz", + "integrity": "sha1-bQ4JxJIflKJ/Y9O0nF/v8epMUTA=" + }, + "form-data": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-0.1.4.tgz", + "integrity": "sha1-kavXiKupcCsaq/qLwBAxoqyeOxI=", + "optional": true, + "requires": { + "async": "0.9.2", + "combined-stream": "0.0.7", + "mime": "1.2.11" + } + }, + "hawk": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-1.1.1.tgz", + "integrity": "sha1-h81JH5tG5OKurKM1QWdmiF0tHtk=", + "optional": true, + "requires": { + "boom": "0.4.2", + "cryptiles": "0.2.2", + "hoek": "0.9.1", + "sntp": "0.2.4" + } + }, + "hoek": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-0.9.1.tgz", + "integrity": "sha1-PTIkYrrfB3Fup+uFuviAec3c5QU=" + }, + "http-signature": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-0.10.1.tgz", + "integrity": "sha1-T72sEyVZqoMjEh5UB3nAoBKyfmY=", + "optional": true, + "requires": { + "asn1": "0.1.11", + "assert-plus": "0.1.5", + "ctype": "0.5.3" + } + }, + "mime": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz", + "integrity": "sha1-WCA+7Ybjpe8XrtK32evUfwpg3RA=", + "optional": true + }, + "mime-types": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-1.0.2.tgz", + "integrity": "sha1-mVrhOSq4r/y/yyZB3QVOlDwNXc4=" + }, + "node-uuid": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.8.tgz", + "integrity": "sha1-sEDrCSOWivq/jTL7HxfxFn/auQc=" + }, + "oauth-sign": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.4.0.tgz", + "integrity": "sha1-8ilW8x6nFRqCHl8vsywRPK2Ln2k=", + "optional": true + }, + "qs": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-1.2.2.tgz", + "integrity": "sha1-GbV/8k3CqZzh+L32r82ln472H4g=" + }, + "request": { + "version": "2.42.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.42.0.tgz", + "integrity": "sha1-VyvQFIk4VkBArHqxSLlkI6BjMEo=", + "requires": { + "aws-sign2": "0.5.0", + "bl": "0.9.5", + "caseless": "0.6.0", + "forever-agent": "0.5.2", + "form-data": "0.1.4", + "hawk": "1.1.1", + "http-signature": "0.10.1", + "json-stringify-safe": "5.0.1", + "mime-types": "1.0.2", + "node-uuid": "1.4.8", + "oauth-sign": "0.4.0", + "qs": "1.2.2", + "stringstream": "0.0.5", + "tough-cookie": "2.3.3", + "tunnel-agent": "0.4.3" + } + }, + "sntp": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-0.2.4.tgz", + "integrity": "sha1-+4hfGLDzqtGJ+CSGJTa87ux1CQA=", + "optional": true, + "requires": { + "hoek": "0.9.1" + } + }, + "tunnel-agent": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", + "integrity": "sha1-Y3PbdpCf5XDgjXNYM2Xtgop07us=" + } + } + }, + "color-convert": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", + "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "colour": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/colour/-/colour-0.7.1.tgz", + "integrity": "sha1-nLFpkX7F0SwHNtPoaFdG3xyt93g=" + }, + "combined-stream": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", + "integrity": "sha1-k4NwpXtKUd6ix3wV1cX9+JUWQAk=", + "requires": { + "delayed-stream": "1.0.0" + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "concat-stream": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.0.tgz", + "integrity": "sha1-CqxmL9Ur54lk1VMvaUeE5wEQrPc=", + "requires": { + "inherits": "2.0.3", + "readable-stream": "2.3.4", + "typedarray": "0.0.6" + } + }, + "configstore": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/configstore/-/configstore-3.1.1.tgz", + "integrity": "sha512-5oNkD/L++l0O6xGXxb1EWS7SivtjfGQlRyxJsYgE0Z495/L81e2h4/d3r969hoPXuFItzNOKMtsXgYG4c7dYvw==", + "requires": { + "dot-prop": "4.2.0", + "graceful-fs": "4.1.11", + "make-dir": "1.1.0", + "unique-string": "1.0.0", + "write-file-atomic": "2.3.0", + "xdg-basedir": "3.0.0" + } + }, + "content-disposition": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", + "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=" + }, + "content-type": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" + }, + "cookie": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", + "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=" + }, + "cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" + }, + "core-js": { + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.3.tgz", + "integrity": "sha1-isw4NFgk8W2DZbfJtCWRaOjtYD4=" + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "create-error-class": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/create-error-class/-/create-error-class-3.0.2.tgz", + "integrity": "sha1-Br56vvlHo/FKMP1hBnHUAbyot7Y=", + "requires": { + "capture-stack-trace": "1.0.0" + } + }, + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "dev": true, + "requires": { + "lru-cache": "4.1.1", + "shebang-command": "1.2.0", + "which": "1.3.0" + } + }, + "crypt": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", + "integrity": "sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs=" + }, + "cryptiles": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-3.1.2.tgz", + "integrity": "sha1-qJ+7Ig9c4l7FboxKqKT9e1sNKf4=", + "requires": { + "boom": "5.2.0" + }, + "dependencies": { + "boom": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz", + "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==", + "requires": { + "hoek": "4.2.0" + } + } + } + }, + "crypto-random-string": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-1.0.0.tgz", + "integrity": "sha1-ojD2T1aDEOFJgAmUB5DsmVRbyn4=" + }, + "ctype": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/ctype/-/ctype-0.5.3.tgz", + "integrity": "sha1-gsGMJGH3QRTvFsE1IkrQuRRMoS8=", + "optional": true + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "requires": { + "assert-plus": "1.0.0" + } + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + }, + "dependencies": { + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + } + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" + }, + "deep-equal": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-0.1.2.tgz", + "integrity": "sha1-skbCuApXCkfBG+HZvRBw7IeLh84=" + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "define-properties": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.2.tgz", + "integrity": "sha1-g6c/L+pWmJj7c3GTyPhzyvbUXJQ=", + "requires": { + "foreach": "2.0.5", + "object-keys": "1.0.11" + } + }, + "defined": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/defined/-/defined-0.0.0.tgz", + "integrity": "sha1-817qfXBekzuvE7LwOz+D2SFAOz4=" + }, + "del": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", + "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", + "dev": true, + "requires": { + "globby": "5.0.0", + "is-path-cwd": "1.0.0", + "is-path-in-cwd": "1.0.0", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1", + "rimraf": "2.6.2" + }, + "dependencies": { + "globby": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", + "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", + "dev": true, + "requires": { + "array-union": "1.0.2", + "arrify": "1.0.1", + "glob": "7.1.2", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + } + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" + }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" + }, + "diff-match-patch": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/diff-match-patch/-/diff-match-patch-1.0.0.tgz", + "integrity": "sha1-HMPIOkkNZ/ldkeOfatHy4Ia2MEg=" + }, + "dir-glob": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.0.0.tgz", + "integrity": "sha512-37qirFDz8cA5fimp9feo43fSuRo2gHwaIn6dXL8Ber1dGwUosDrGZeCCXq57WnIqE4aQ+u3eQZzsk1yOzhdwag==", + "requires": { + "arrify": "1.0.1", + "path-type": "3.0.0" + } + }, + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "requires": { + "esutils": "2.0.2" + } + }, + "dot-prop": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", + "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==", + "requires": { + "is-obj": "1.0.1" + } + }, + "duplexer": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", + "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=" + }, + "duplexify": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.5.3.tgz", + "integrity": "sha512-g8ID9OroF9hKt2POf8YLayy+9594PzmM3scI00/uBXocX3TWNgoB67hjzkFe9ITAbQOne/lLdBxHXvYUM4ZgGA==", + "requires": { + "end-of-stream": "1.4.1", + "inherits": "2.0.3", + "readable-stream": "2.3.4", + "stream-shift": "1.0.0" + } + }, + "eastasianwidth": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.1.1.tgz", + "integrity": "sha1-RNZW3p2kFWlEZzNTZfsxR7hXK3w=" + }, + "ecc-jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", + "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", + "optional": true, + "requires": { + "jsbn": "0.1.1" + } + }, + "ecdsa-sig-formatter": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.9.tgz", + "integrity": "sha1-S8kmJ07Dtau1AW5+HWCSGsJisqE=", + "requires": { + "base64url": "2.0.0", + "safe-buffer": "5.1.1" + } + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" + }, + "empower": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/empower/-/empower-1.2.3.tgz", + "integrity": "sha1-bw2nNEf07dg4/sXGAxOoi6XLhSs=", + "requires": { + "core-js": "2.5.3", + "empower-core": "0.6.2" + } + }, + "empower-core": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/empower-core/-/empower-core-0.6.2.tgz", + "integrity": "sha1-Wt71ZgiOMfuoC6CjbfR9cJQWkUQ=", + "requires": { + "call-signature": "0.0.2", + "core-js": "2.5.3" + } + }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" + }, + "end-of-stream": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", + "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "requires": { + "once": "1.4.0" + } + }, + "ent": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/ent/-/ent-2.2.0.tgz", + "integrity": "sha1-6WQhkyWiHQX0RGai9obtbOX13R0=" + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "eslint": { + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.17.0.tgz", + "integrity": "sha512-AyxBUCANU/o/xC0ijGMKavo5Ls3oK6xykiOITlMdjFjrKOsqLrA7Nf5cnrDgcKrHzBirclAZt63XO7YZlVUPwA==", + "dev": true, + "requires": { + "ajv": "5.5.2", + "babel-code-frame": "6.26.0", + "chalk": "2.3.1", + "concat-stream": "1.6.0", + "cross-spawn": "5.1.0", + "debug": "3.1.0", + "doctrine": "2.1.0", + "eslint-scope": "3.7.1", + "eslint-visitor-keys": "1.0.0", + "espree": "3.5.3", + "esquery": "1.0.0", + "esutils": "2.0.2", + "file-entry-cache": "2.0.0", + "functional-red-black-tree": "1.0.1", + "glob": "7.1.2", + "globals": "11.3.0", + "ignore": "3.3.7", + "imurmurhash": "0.1.4", + "inquirer": "3.3.0", + "is-resolvable": "1.1.0", + "js-yaml": "3.10.0", + "json-stable-stringify-without-jsonify": "1.0.1", + "levn": "0.3.0", + "lodash": "4.17.5", + "minimatch": "3.0.4", + "mkdirp": "0.5.1", + "natural-compare": "1.4.0", + "optionator": "0.8.2", + "path-is-inside": "1.0.2", + "pluralize": "7.0.0", + "progress": "2.0.0", + "require-uncached": "1.0.3", + "semver": "5.5.0", + "strip-ansi": "4.0.0", + "strip-json-comments": "2.0.1", + "table": "4.0.2", + "text-table": "0.2.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + } + } + }, + "eslint-plugin-promise": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-3.6.0.tgz", + "integrity": "sha512-YQzM6TLTlApAr7Li8vWKR+K3WghjwKcYzY0d2roWap4SLK+kzuagJX/leTetIDWsFcTFnKNJXWupDCD6aZkP2Q==", + "dev": true + }, + "eslint-scope": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.1.tgz", + "integrity": "sha1-PWPD7f2gLgbgGkUq2IyqzHzctug=", + "dev": true, + "requires": { + "esrecurse": "4.2.0", + "estraverse": "4.2.0" + } + }, + "eslint-visitor-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==", + "dev": true + }, + "espree": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.3.tgz", + "integrity": "sha512-Zy3tAJDORxQZLl2baguiRU1syPERAIg0L+JB2MWorORgTu/CplzvxS9WWA7Xh4+Q+eOQihNs/1o1Xep8cvCxWQ==", + "dev": true, + "requires": { + "acorn": "5.4.1", + "acorn-jsx": "3.0.1" + }, + "dependencies": { + "acorn": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.4.1.tgz", + "integrity": "sha512-XLmq3H/BVvW6/GbxKryGxWORz1ebilSsUDlyC27bXhWGWAZWkGwS6FLHjOlwFXNFoWFQEO/Df4u0YYd0K3BQgQ==", + "dev": true + } + } + }, + "esprima": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", + "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", + "dev": true + }, + "espurify": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/espurify/-/espurify-1.7.0.tgz", + "integrity": "sha1-HFz2y8zDLm9jk4C9T5kfq5up0iY=", + "requires": { + "core-js": "2.5.3" + } + }, + "esquery": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.0.tgz", + "integrity": "sha1-z7qLV9f7qT8XKYqKAGoEzaE9gPo=", + "dev": true, + "requires": { + "estraverse": "4.2.0" + } + }, + "esrecurse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.0.tgz", + "integrity": "sha1-+pVo2Y04I/mkHZHpAtyrnqblsWM=", + "dev": true, + "requires": { + "estraverse": "4.2.0", + "object-assign": "4.1.1" + } + }, + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=" + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" + }, + "express": { + "version": "4.16.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.16.2.tgz", + "integrity": "sha1-41xt/i1kt9ygpc1PIXgb4ymeB2w=", + "requires": { + "accepts": "1.3.4", + "array-flatten": "1.1.1", + "body-parser": "1.18.2", + "content-disposition": "0.5.2", + "content-type": "1.0.4", + "cookie": "0.3.1", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "1.1.2", + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "etag": "1.8.1", + "finalhandler": "1.1.0", + "fresh": "0.5.2", + "merge-descriptors": "1.0.1", + "methods": "1.1.2", + "on-finished": "2.3.0", + "parseurl": "1.3.2", + "path-to-regexp": "0.1.7", + "proxy-addr": "2.0.2", + "qs": "6.5.1", + "range-parser": "1.2.0", + "safe-buffer": "5.1.1", + "send": "0.16.1", + "serve-static": "1.13.1", + "setprototypeof": "1.1.0", + "statuses": "1.3.1", + "type-is": "1.6.15", + "utils-merge": "1.0.1", + "vary": "1.1.2" + } + }, + "extend": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", + "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=" + }, + "external-editor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.1.0.tgz", + "integrity": "sha512-E44iT5QVOUJBKij4IIV3uvxuNlbKS38Tw1HiupxEIHPv9qtC2PrDYohbXV5U+1jnfIXttny8gUhj+oZvflFlzA==", + "dev": true, + "requires": { + "chardet": "0.4.2", + "iconv-lite": "0.4.19", + "tmp": "0.0.33" + } + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + }, + "fast-deep-equal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz", + "integrity": "sha1-liVqO8l1WV6zbYLpkp0GDYk0Of8=" + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "faye-websocket": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.9.3.tgz", + "integrity": "sha1-SCpQWw3wrmJrlphm0710DNuWLoM=", + "requires": { + "websocket-driver": "0.7.0" + } + }, + "figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "dev": true, + "requires": { + "escape-string-regexp": "1.0.5" + } + }, + "file-entry-cache": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", + "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", + "dev": true, + "requires": { + "flat-cache": "1.3.0", + "object-assign": "4.1.1" + } + }, + "finalhandler": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.0.tgz", + "integrity": "sha1-zgtoVbRYU+eRsvzGgARtiCU91/U=", + "requires": { + "debug": "2.6.9", + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "on-finished": "2.3.0", + "parseurl": "1.3.2", + "statuses": "1.3.1", + "unpipe": "1.0.0" + } + }, + "firebase-admin": { + "version": "5.8.2", + "resolved": "https://registry.npmjs.org/firebase-admin/-/firebase-admin-5.8.2.tgz", + "integrity": "sha1-TDkN87b9MlZ9jUVYrASXS+vRV0k=", + "requires": { + "@firebase/app": "0.1.8", + "@firebase/database": "0.1.9", + "@google-cloud/firestore": "0.11.2", + "@google-cloud/storage": "1.5.2", + "@types/google-cloud__storage": "1.1.7", + "@types/node": "8.9.3", + "faye-websocket": "0.9.3", + "jsonwebtoken": "8.1.0", + "node-forge": "0.7.1" + } + }, + "firebase-functions": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/firebase-functions/-/firebase-functions-0.8.1.tgz", + "integrity": "sha1-pC/m0kOGLEBq8W4cFrHQqB7CTAM=", + "requires": { + "@types/express": "4.11.1", + "@types/jsonwebtoken": "7.2.5", + "@types/lodash": "4.14.102", + "@types/sha1": "1.1.1", + "express": "4.16.2", + "jsonwebtoken": "7.4.3", + "lodash": "4.17.5", + "sha1": "1.1.1" + }, + "dependencies": { + "jsonwebtoken": { + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-7.4.3.tgz", + "integrity": "sha1-d/UCHeBYtgWheD+hKD6ZgS5kVjg=", + "requires": { + "joi": "6.10.1", + "jws": "3.1.4", + "lodash.once": "4.1.1", + "ms": "2.1.1", + "xtend": "4.0.1" + } + } + } + }, + "flat-cache": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz", + "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=", + "dev": true, + "requires": { + "circular-json": "0.3.3", + "del": "2.2.2", + "graceful-fs": "4.1.11", + "write": "0.2.1" + } + }, + "foreach": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", + "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=" + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + }, + "form-data": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.1.tgz", + "integrity": "sha1-b7lPvXGIUwbXPRXMSX/kzE7NRL8=", + "requires": { + "asynckit": "0.4.0", + "combined-stream": "1.0.5", + "mime-types": "2.1.17" + } + }, + "forwarded": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", + "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" + }, + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" + }, + "gcp-metadata": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-0.3.1.tgz", + "integrity": "sha512-5kJPX/RXuqoLmHiOOgkSDk/LI0QaXpEvZ3pvQP4ifjGGDKZKVSOjL/GcDjXA5kLxppFCOjmmsu0Uoop9d1upaQ==", + "requires": { + "extend": "3.0.1", + "retry-request": "3.3.1" + } + }, + "gcs-resumable-upload": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/gcs-resumable-upload/-/gcs-resumable-upload-0.8.2.tgz", + "integrity": "sha512-PBl1OFABYxubxfYPh000I0+JLbQzBRtNqxzgxYboIQk2tdw7BvjJ2dVukk3YH4QM6GiUwqItyNqWBuxjLH8GhA==", + "requires": { + "buffer-equal": "1.0.0", + "configstore": "3.1.1", + "google-auto-auth": "0.7.2", + "pumpify": "1.4.0", + "request": "2.83.0", + "stream-events": "1.0.2", + "through2": "2.0.3" + }, + "dependencies": { + "google-auth-library": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-0.10.0.tgz", + "integrity": "sha1-bhW6vuhf0d0U2NEoopW2g41SE24=", + "requires": { + "gtoken": "1.2.3", + "jws": "3.1.4", + "lodash.noop": "3.0.1", + "request": "2.83.0" + } + }, + "google-auto-auth": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/google-auto-auth/-/google-auto-auth-0.7.2.tgz", + "integrity": "sha512-ux2n2AE2g3+vcLXwL4dP/M12SFMRX5dzCzBfhAEkTeAB7dpyGdOIEj7nmUx0BHKaCcUQrRWg9kT63X/Mmtk1+A==", + "requires": { + "async": "2.6.0", + "gcp-metadata": "0.3.1", + "google-auth-library": "0.10.0", + "request": "2.83.0" + } + } + } + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "requires": { + "assert-plus": "1.0.0" + } + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "globals": { + "version": "11.3.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.3.0.tgz", + "integrity": "sha512-kkpcKNlmQan9Z5ZmgqKH/SMbSmjxQ7QjyNqfXVc8VJcoBV2UEg+sxQD15GQofGRh2hfpwUb70VC31DR7Rq5Hdw==", + "dev": true + }, + "globby": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/globby/-/globby-7.1.1.tgz", + "integrity": "sha1-+yzP+UAfhgCUXfral0QMypcrhoA=", + "requires": { + "array-union": "1.0.2", + "dir-glob": "2.0.0", + "glob": "7.1.2", + "ignore": "3.3.7", + "pify": "3.0.0", + "slash": "1.0.0" + } + }, + "google-auth-library": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-0.12.0.tgz", + "integrity": "sha512-79qCXtJ1VweBmmLr4yLq9S4clZB2p5Y+iACvuKk9gu4JitEnPc+bQFmYvtCYehVR44MQzD1J8DVmYW2w677IEw==", + "requires": { + "gtoken": "1.2.3", + "jws": "3.1.4", + "lodash.isstring": "4.0.1", + "lodash.merge": "4.6.1", + "request": "2.83.0" + } + }, + "google-auto-auth": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/google-auto-auth/-/google-auto-auth-0.8.2.tgz", + "integrity": "sha512-W91J1paFbyG45gpDWdTu9tKDxbiTDWYkOAxytNVF4oHVVgTCBV/8+lWdjj/6ldjN3eb+sEd9PKJBjm0kmCxvcw==", + "requires": { + "async": "2.6.0", + "gcp-metadata": "0.3.1", + "google-auth-library": "0.12.0", + "request": "2.83.0" + } + }, + "google-gax": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/google-gax/-/google-gax-0.14.5.tgz", + "integrity": "sha512-3A6KbrtLDavrqZnnzurnSydRIJnyH+2Sm56fAvXciQ/62aEnSDaR43MCgWhtReCLVjeFjBiCEIdX5zV0LVLVBg==", + "requires": { + "extend": "3.0.1", + "globby": "7.1.1", + "google-auto-auth": "0.9.3", + "google-proto-files": "0.14.2", + "grpc": "1.7.3", + "is-stream-ended": "0.1.3", + "lodash": "4.17.5", + "protobufjs": "6.8.4", + "readable-stream": "2.3.4", + "through2": "2.0.3" + }, + "dependencies": { + "gcp-metadata": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-0.4.1.tgz", + "integrity": "sha512-yFE7v+NyoMiTOi2L6r8q87eVbiZCKooJNPKXTHhBStga8pwwgWofK9iHl00qd0XevZxcpk7ORaEL/ALuTvlaGQ==", + "requires": { + "extend": "3.0.1", + "retry-request": "3.3.1" + } + }, + "google-auto-auth": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/google-auto-auth/-/google-auto-auth-0.9.3.tgz", + "integrity": "sha512-TbOZZs0WJOolrRmdQLK5qmWdOJQFG1oPnxcIBbAwL7XCWcv3XgZ9gHJ6W4byrdEZT8TahNFgMfkHd73mqxM9dw==", + "requires": { + "async": "2.6.0", + "gcp-metadata": "0.4.1", + "google-auth-library": "0.12.0", + "request": "2.83.0" + } + }, + "protobufjs": { + "version": "6.8.4", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.8.4.tgz", + "integrity": "sha512-d+WZqUDXKM+oZhr8yprAtQW07q08p9/V35AJ2J1fds+r903S/aH9P8uO1gmTwozOKugt2XCjdrre3OxuPRGkGg==", + "requires": { + "@protobufjs/aspromise": "1.1.2", + "@protobufjs/base64": "1.1.2", + "@protobufjs/codegen": "2.0.4", + "@protobufjs/eventemitter": "1.1.0", + "@protobufjs/fetch": "1.1.0", + "@protobufjs/float": "1.0.2", + "@protobufjs/inquire": "1.1.0", + "@protobufjs/path": "1.1.2", + "@protobufjs/pool": "1.1.0", + "@protobufjs/utf8": "1.1.0", + "@types/long": "3.0.32", + "@types/node": "8.9.3", + "long": "3.2.0" + } + } + } + }, + "google-p12-pem": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-0.1.2.tgz", + "integrity": "sha1-M8RqsCGqc0+gMys5YKmj/8svMXc=", + "requires": { + "node-forge": "0.7.1" + } + }, + "google-proto-files": { + "version": "0.14.2", + "resolved": "https://registry.npmjs.org/google-proto-files/-/google-proto-files-0.14.2.tgz", + "integrity": "sha512-wwm2TIlfTgAjDbjrxAb3akznO7vBM0PRLS6Xf2QfR3L7b0p+szD3iwOW0wMSFl3B0UbLv27hUVk+clePqCVmXA==", + "requires": { + "globby": "7.1.1", + "power-assert": "1.4.4", + "prettier": "1.10.2", + "protobufjs": "6.8.4" + }, + "dependencies": { + "protobufjs": { + "version": "6.8.4", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.8.4.tgz", + "integrity": "sha512-d+WZqUDXKM+oZhr8yprAtQW07q08p9/V35AJ2J1fds+r903S/aH9P8uO1gmTwozOKugt2XCjdrre3OxuPRGkGg==", + "requires": { + "@protobufjs/aspromise": "1.1.2", + "@protobufjs/base64": "1.1.2", + "@protobufjs/codegen": "2.0.4", + "@protobufjs/eventemitter": "1.1.0", + "@protobufjs/fetch": "1.1.0", + "@protobufjs/float": "1.0.2", + "@protobufjs/inquire": "1.1.0", + "@protobufjs/path": "1.1.2", + "@protobufjs/pool": "1.1.0", + "@protobufjs/utf8": "1.1.0", + "@types/long": "3.0.32", + "@types/node": "8.9.3", + "long": "3.2.0" + } + } + } + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" + }, + "grpc": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/grpc/-/grpc-1.7.3.tgz", + "integrity": "sha512-7zXQJlDXMr/ZaDqdaIchgclViyoWo8GQxZSmFUAxR8GwSr28b6/BTgF221WG+2W693jpp74XJ/+I9DcPXsgt9Q==", + "requires": { + "arguejs": "0.2.3", + "lodash": "4.17.5", + "nan": "2.8.0", + "node-pre-gyp": "0.6.39", + "protobufjs": "5.0.2" + }, + "dependencies": { + "abbrev": { + "version": "1.0.9", + "bundled": true + }, + "ajv": { + "version": "4.11.8", + "bundled": true, + "requires": { + "co": "4.6.0", + "json-stable-stringify": "1.0.1" + } + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true + }, + "aproba": { + "version": "1.2.0", + "bundled": true + }, + "are-we-there-yet": { + "version": "1.1.4", + "bundled": true, + "requires": { + "delegates": "1.0.0", + "readable-stream": "2.3.3" + } + }, + "asn1": { + "version": "0.2.3", + "bundled": true + }, + "assert-plus": { + "version": "0.2.0", + "bundled": true + }, + "asynckit": { + "version": "0.4.0", + "bundled": true + }, + "aws-sign2": { + "version": "0.6.0", + "bundled": true + }, + "aws4": { + "version": "1.6.0", + "bundled": true + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true + }, + "bcrypt-pbkdf": { + "version": "1.0.1", + "bundled": true, + "optional": true, + "requires": { + "tweetnacl": "0.14.5" + } + }, + "block-stream": { + "version": "0.0.9", + "bundled": true, + "requires": { + "inherits": "2.0.3" + } + }, + "boom": { + "version": "2.10.1", + "bundled": true, + "requires": { + "hoek": "2.16.3" + } + }, + "brace-expansion": { + "version": "1.1.8", + "bundled": true, + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "caseless": { + "version": "0.12.0", + "bundled": true + }, + "co": { + "version": "4.6.0", + "bundled": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true + }, + "combined-stream": { + "version": "1.0.5", + "bundled": true, + "requires": { + "delayed-stream": "1.0.0" + } + }, + "concat-map": { + "version": "0.0.1", + "bundled": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true + }, + "cryptiles": { + "version": "2.0.5", + "bundled": true, + "requires": { + "boom": "2.10.1" + } + }, + "dashdash": { + "version": "1.14.1", + "bundled": true, + "requires": { + "assert-plus": "1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true + } + } + }, + "debug": { + "version": "2.6.8", + "bundled": true, + "requires": { + "ms": "2.0.0" + } + }, + "deep-extend": { + "version": "0.4.2", + "bundled": true + }, + "delayed-stream": { + "version": "1.0.0", + "bundled": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true + }, + "detect-libc": { + "version": "1.0.2", + "bundled": true + }, + "ecc-jsbn": { + "version": "0.1.1", + "bundled": true, + "optional": true, + "requires": { + "jsbn": "0.1.1" + } + }, + "extend": { + "version": "3.0.1", + "bundled": true + }, + "extsprintf": { + "version": "1.3.0", + "bundled": true + }, + "forever-agent": { + "version": "0.6.1", + "bundled": true + }, + "form-data": { + "version": "2.1.4", + "bundled": true, + "requires": { + "asynckit": "0.4.0", + "combined-stream": "1.0.5", + "mime-types": "2.1.17" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true + }, + "fstream": { + "version": "1.0.11", + "bundled": true, + "requires": { + "graceful-fs": "4.1.11", + "inherits": "2.0.3", + "mkdirp": "0.5.1", + "rimraf": "2.6.2" + } + }, + "fstream-ignore": { + "version": "1.0.5", + "bundled": true, + "requires": { + "fstream": "1.0.11", + "inherits": "2.0.3", + "minimatch": "3.0.4" + } + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "requires": { + "aproba": "1.2.0", + "console-control-strings": "1.1.0", + "has-unicode": "2.0.1", + "object-assign": "4.1.1", + "signal-exit": "3.0.2", + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wide-align": "1.1.2" + } + }, + "getpass": { + "version": "0.1.7", + "bundled": true, + "requires": { + "assert-plus": "1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true + } + } + }, + "glob": { + "version": "7.1.1", + "bundled": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "graceful-fs": { + "version": "4.1.11", + "bundled": true + }, + "har-schema": { + "version": "1.0.5", + "bundled": true + }, + "har-validator": { + "version": "4.2.1", + "bundled": true, + "requires": { + "ajv": "4.11.8", + "har-schema": "1.0.5" + } + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true + }, + "hawk": { + "version": "3.1.3", + "bundled": true, + "requires": { + "boom": "2.10.1", + "cryptiles": "2.0.5", + "hoek": "2.16.3", + "sntp": "1.0.9" + } + }, + "hoek": { + "version": "2.16.3", + "bundled": true + }, + "http-signature": { + "version": "1.1.1", + "bundled": true, + "requires": { + "assert-plus": "0.2.0", + "jsprim": "1.4.1", + "sshpk": "1.13.1" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true + }, + "ini": { + "version": "1.3.4", + "bundled": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "is-typedarray": { + "version": "1.0.0", + "bundled": true + }, + "isarray": { + "version": "1.0.0", + "bundled": true + }, + "isstream": { + "version": "0.1.2", + "bundled": true + }, + "jsbn": { + "version": "0.1.1", + "bundled": true, + "optional": true + }, + "json-schema": { + "version": "0.2.3", + "bundled": true + }, + "json-stable-stringify": { + "version": "1.0.1", + "bundled": true, + "requires": { + "jsonify": "0.0.0" + } + }, + "json-stringify-safe": { + "version": "5.0.1", + "bundled": true + }, + "jsonify": { + "version": "0.0.0", + "bundled": true + }, + "jsprim": { + "version": "1.4.1", + "bundled": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true + } + } + }, + "mime-db": { + "version": "1.30.0", + "bundled": true + }, + "mime-types": { + "version": "2.1.17", + "bundled": true, + "requires": { + "mime-db": "1.30.0" + } + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "requires": { + "brace-expansion": "1.1.8" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "bundled": true + }, + "node-pre-gyp": { + "version": "0.6.39", + "bundled": true, + "requires": { + "detect-libc": "1.0.2", + "hawk": "3.1.3", + "mkdirp": "0.5.1", + "nopt": "4.0.1", + "npmlog": "4.1.2", + "rc": "1.2.2", + "request": "2.81.0", + "rimraf": "2.6.2", + "semver": "5.4.1", + "tar": "2.2.1", + "tar-pack": "3.4.1" + }, + "dependencies": { + "nopt": { + "version": "4.0.1", + "bundled": true, + "requires": { + "abbrev": "1.0.9", + "osenv": "0.1.4" + } + } + } + }, + "npmlog": { + "version": "4.1.2", + "bundled": true, + "requires": { + "are-we-there-yet": "1.1.4", + "console-control-strings": "1.1.0", + "gauge": "2.7.4", + "set-blocking": "2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true + }, + "oauth-sign": { + "version": "0.8.2", + "bundled": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true + }, + "osenv": { + "version": "0.1.4", + "bundled": true, + "requires": { + "os-homedir": "1.0.2", + "os-tmpdir": "1.0.2" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true + }, + "performance-now": { + "version": "0.2.0", + "bundled": true + }, + "process-nextick-args": { + "version": "1.0.7", + "bundled": true + }, + "punycode": { + "version": "1.4.1", + "bundled": true + }, + "qs": { + "version": "6.4.0", + "bundled": true + }, + "rc": { + "version": "1.2.2", + "bundled": true, + "requires": { + "deep-extend": "0.4.2", + "ini": "1.3.4", + "minimist": "1.2.0", + "strip-json-comments": "2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true + } + } + }, + "readable-stream": { + "version": "2.3.3", + "bundled": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "safe-buffer": "5.1.1", + "string_decoder": "1.0.3", + "util-deprecate": "1.0.2" + } + }, + "request": { + "version": "2.81.0", + "bundled": true, + "requires": { + "aws-sign2": "0.6.0", + "aws4": "1.6.0", + "caseless": "0.12.0", + "combined-stream": "1.0.5", + "extend": "3.0.1", + "forever-agent": "0.6.1", + "form-data": "2.1.4", + "har-validator": "4.2.1", + "hawk": "3.1.3", + "http-signature": "1.1.1", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.17", + "oauth-sign": "0.8.2", + "performance-now": "0.2.0", + "qs": "6.4.0", + "safe-buffer": "5.1.1", + "stringstream": "0.0.5", + "tough-cookie": "2.3.3", + "tunnel-agent": "0.6.0", + "uuid": "3.1.0" + } + }, + "rimraf": { + "version": "2.6.2", + "bundled": true, + "requires": { + "glob": "7.1.1" + } + }, + "safe-buffer": { + "version": "5.1.1", + "bundled": true + }, + "semver": { + "version": "5.4.1", + "bundled": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true + }, + "sntp": { + "version": "1.0.9", + "bundled": true, + "requires": { + "hoek": "2.16.3" + } + }, + "sshpk": { + "version": "1.13.1", + "bundled": true, + "requires": { + "asn1": "0.2.3", + "assert-plus": "1.0.0", + "bcrypt-pbkdf": "1.0.1", + "dashdash": "1.14.1", + "ecc-jsbn": "0.1.1", + "getpass": "0.1.7", + "jsbn": "0.1.1", + "tweetnacl": "0.14.5" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true + } + } + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + }, + "string_decoder": { + "version": "1.0.3", + "bundled": true, + "requires": { + "safe-buffer": "5.1.1" + } + }, + "stringstream": { + "version": "0.0.5", + "bundled": true + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true + }, + "tar": { + "version": "2.2.1", + "bundled": true, + "requires": { + "block-stream": "0.0.9", + "fstream": "1.0.11", + "inherits": "2.0.3" + } + }, + "tar-pack": { + "version": "3.4.1", + "bundled": true, + "requires": { + "debug": "2.6.8", + "fstream": "1.0.11", + "fstream-ignore": "1.0.5", + "once": "1.4.0", + "readable-stream": "2.3.3", + "rimraf": "2.6.2", + "tar": "2.2.1", + "uid-number": "0.0.6" + } + }, + "tough-cookie": { + "version": "2.3.3", + "bundled": true, + "requires": { + "punycode": "1.4.1" + } + }, + "tunnel-agent": { + "version": "0.6.0", + "bundled": true, + "requires": { + "safe-buffer": "5.1.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "bundled": true, + "optional": true + }, + "uid-number": { + "version": "0.0.6", + "bundled": true + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true + }, + "uuid": { + "version": "3.1.0", + "bundled": true + }, + "verror": { + "version": "1.10.0", + "bundled": true, + "requires": { + "assert-plus": "1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "1.3.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true + } + } + }, + "wide-align": { + "version": "1.1.2", + "bundled": true, + "requires": { + "string-width": "1.0.2" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true + } + } + }, + "gtoken": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-1.2.3.tgz", + "integrity": "sha512-wQAJflfoqSgMWrSBk9Fg86q+sd6s7y6uJhIvvIPz++RElGlMtEqsdAR2oWwZ/WTEtp7P9xFbJRrT976oRgzJ/w==", + "requires": { + "google-p12-pem": "0.1.2", + "jws": "3.1.4", + "mime": "1.6.0", + "request": "2.83.0" + } + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" + }, + "har-validator": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", + "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", + "requires": { + "ajv": "5.5.2", + "har-schema": "2.0.0" + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "hash-stream-validation": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/hash-stream-validation/-/hash-stream-validation-0.2.1.tgz", + "integrity": "sha1-7Mm5l7IYvluzEphii7gHhptz3NE=", + "requires": { + "through2": "2.0.3" + } + }, + "hawk": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-6.0.2.tgz", + "integrity": "sha512-miowhl2+U7Qle4vdLqDdPt9m09K6yZhkLDTWGoUiUzrQCn+mHHSmfJgAyGaLRZbPmTqfFFjRV1QWCW0VWUJBbQ==", + "requires": { + "boom": "4.3.1", + "cryptiles": "3.1.2", + "hoek": "4.2.0", + "sntp": "2.1.0" + } + }, + "hoek": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.0.tgz", + "integrity": "sha512-v0XCLxICi9nPfYrS9RL8HbYnXi9obYAeLbSP00BmnZwCK9+Ih9WOjoZ8YoHCoav2csqn4FOz4Orldsy2dmDwmQ==" + }, + "http-errors": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz", + "integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=", + "requires": { + "depd": "1.1.1", + "inherits": "2.0.3", + "setprototypeof": "1.0.3", + "statuses": "1.3.1" + }, + "dependencies": { + "depd": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz", + "integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k=" + }, + "setprototypeof": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz", + "integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=" + } + } + }, + "http-parser-js": { + "version": "0.4.10", + "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.4.10.tgz", + "integrity": "sha1-ksnBN0w1CF912zWexWzCV8u5P6Q=" + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "requires": { + "assert-plus": "1.0.0", + "jsprim": "1.4.1", + "sshpk": "1.13.1" + } + }, + "iconv-lite": { + "version": "0.4.19", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", + "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==" + }, + "ignore": { + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.7.tgz", + "integrity": "sha512-YGG3ejvBNHRqu0559EOxxNFihD0AjpvHlC/pdGKd3X3ofe+CoJkYazwNJYTNebqpPKN+VVQbh4ZFn1DivMNuHA==" + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" + }, + "indexof": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", + "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=" + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "inquirer": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz", + "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", + "dev": true, + "requires": { + "ansi-escapes": "3.0.0", + "chalk": "2.3.1", + "cli-cursor": "2.1.0", + "cli-width": "2.2.0", + "external-editor": "2.1.0", + "figures": "2.0.0", + "lodash": "4.17.5", + "mute-stream": "0.0.7", + "run-async": "2.3.0", + "rx-lite": "4.0.8", + "rx-lite-aggregates": "4.0.8", + "string-width": "2.1.1", + "strip-ansi": "4.0.0", + "through": "2.3.8" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "2.0.0", + "strip-ansi": "4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + } + } + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" + }, + "ipaddr.js": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.5.2.tgz", + "integrity": "sha1-1LUFvemUaYfM8PxY2QEP+WB+P6A=" + }, + "is": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/is/-/is-3.2.1.tgz", + "integrity": "sha1-0Kwq1V63sL7JJqUmb2xmKqqD3KU=" + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "requires": { + "number-is-nan": "1.0.1" + } + }, + "is-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=" + }, + "is-path-cwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", + "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=", + "dev": true + }, + "is-path-in-cwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz", + "integrity": "sha1-ZHdYK4IU1gI0YJRWcAO+ip6sBNw=", + "dev": true, + "requires": { + "is-path-inside": "1.0.1" + } + }, + "is-path-inside": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", + "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", + "dev": true, + "requires": { + "path-is-inside": "1.0.2" + } + }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", + "dev": true + }, + "is-resolvable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", + "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", + "dev": true + }, + "is-stream-ended": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/is-stream-ended/-/is-stream-ended-0.1.3.tgz", + "integrity": "sha1-oEc7Jnx1ZjVIa+7cfjNE5UnRUqw=" + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "isemail": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/isemail/-/isemail-1.2.0.tgz", + "integrity": "sha1-vgPfjMPineTSxd9lASY/H6RZXpo=" + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + }, + "joi": { + "version": "6.10.1", + "resolved": "https://registry.npmjs.org/joi/-/joi-6.10.1.tgz", + "integrity": "sha1-TVDDGAeRIgAP5fFq8f+OGRe3fgY=", + "requires": { + "hoek": "2.16.3", + "isemail": "1.2.0", + "moment": "2.20.1", + "topo": "1.1.0" + }, + "dependencies": { + "hoek": { + "version": "2.16.3", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", + "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=" + } + } + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + }, + "js-yaml": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.10.0.tgz", + "integrity": "sha512-O2v52ffjLa9VeM43J4XocZE//WT9N0IiwDa3KSHH7Tu8CtH+1qM8SIZvnsTh6v+4yFy5KUY3BHUVwjpfAWsjIA==", + "dev": true, + "requires": { + "argparse": "1.0.9", + "esprima": "4.0.0" + } + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "optional": true + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" + }, + "json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=" + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + }, + "jsonify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", + "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=" + }, + "jsonwebtoken": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.1.0.tgz", + "integrity": "sha1-xjl80uX9WD1lwAeoPce7eOaYK4M=", + "requires": { + "jws": "3.1.4", + "lodash.includes": "4.3.0", + "lodash.isboolean": "3.0.3", + "lodash.isinteger": "4.0.4", + "lodash.isnumber": "3.0.3", + "lodash.isplainobject": "4.0.6", + "lodash.isstring": "4.0.1", + "lodash.once": "4.1.1", + "ms": "2.1.1", + "xtend": "4.0.1" + } + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "jwa": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.1.5.tgz", + "integrity": "sha1-oFUs4CIHQs1S4VN3SjKQXDDnVuU=", + "requires": { + "base64url": "2.0.0", + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.9", + "safe-buffer": "5.1.1" + } + }, + "jws": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.1.4.tgz", + "integrity": "sha1-+ei5M46KhHJ31kRLFGT2GIDgUKI=", + "requires": { + "base64url": "2.0.0", + "jwa": "1.1.5", + "safe-buffer": "5.1.1" + } + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "requires": { + "invert-kv": "1.0.0" + } + }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "1.1.2", + "type-check": "0.3.2" + } + }, + "lodash": { + "version": "4.17.5", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", + "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==" + }, + "lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8=" + }, + "lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY=" + }, + "lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha1-YZwK89A/iwTDH1iChAt3sRzWg0M=" + }, + "lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha1-POdoEMWSjQM1IwGsKHMX8RwLH/w=" + }, + "lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=" + }, + "lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=" + }, + "lodash.merge": { + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.1.tgz", + "integrity": "sha512-AOYza4+Hf5z1/0Hztxpm2/xiPZgi/cjMqdnKTUWTBSKchJlxXXuUSxCCl8rJlf4g6yww/j6mA8nC8Hw/EZWxKQ==" + }, + "lodash.noop": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/lodash.noop/-/lodash.noop-3.0.1.tgz", + "integrity": "sha1-OBiPTWUKOkdCWEObluxFsyYXEzw=" + }, + "lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=" + }, + "log-driver": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.6.tgz", + "integrity": "sha512-iUHz4WAGsXwUmL1UergWrkFD2iTUrGLMsQDRYUWtS9FI+wSyM76vIL+THQt7vrQq5fZDGdrPSCFUfIlqII28tg==", + "requires": { + "codecov.io": "0.0.1" + } + }, + "long": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/long/-/long-3.2.0.tgz", + "integrity": "sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s=" + }, + "lru-cache": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz", + "integrity": "sha512-q4spe4KTfsAS1SUHLO0wz8Qiyf1+vMIAgpRYioFYDMNqKfHQbg+AVDH3i4fvpl71/P1L0dBl+fQi+P37UYf0ew==", + "dev": true, + "requires": { + "pseudomap": "1.0.2", + "yallist": "2.1.2" + } + }, + "make-dir": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.1.0.tgz", + "integrity": "sha512-0Pkui4wLJ7rxvmfUvs87skoEaxmu0hCUApF8nonzpl7q//FWp9zu8W61Scz4sd/kUiqDxvUhtoam2efDyiBzcA==", + "requires": { + "pify": "3.0.0" + } + }, + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" + }, + "merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" + }, + "methmeth": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/methmeth/-/methmeth-1.1.0.tgz", + "integrity": "sha1-6AomYY5S9cQiKGG7dIUQvRDikIk=" + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" + }, + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" + }, + "mime-db": { + "version": "1.30.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.30.0.tgz", + "integrity": "sha1-dMZD2i3Z1qRTmZY0ZbJtXKfXHwE=" + }, + "mime-types": { + "version": "2.1.17", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.17.tgz", + "integrity": "sha1-Cdejk/A+mVp5+K+Fe3Cp4KsWVXo=", + "requires": { + "mime-db": "1.30.0" + } + }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "1.1.11" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "modelo": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/modelo/-/modelo-4.2.3.tgz", + "integrity": "sha512-9DITV2YEMcw7XojdfvGl3gDD8J9QjZTJ7ZOUuSAkP+F3T6rDbzMJuPktxptsdHYEvZcmXrCD3LMOhdSAEq6zKA==" + }, + "moment": { + "version": "2.20.1", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.20.1.tgz", + "integrity": "sha512-Yh9y73JRljxW5QxN08Fner68eFLxM5ynNOAw2LbIB1YAGeQzZT8QFSUvkAz609Zf+IHhhaUxqZK8dG3W/+HEvg==" + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" + }, + "mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "dev": true + }, + "nan": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.8.0.tgz", + "integrity": "sha1-7XFfP+neArV6XmJS2QqWZ14fCFo=" + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "negotiator": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", + "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=" + }, + "node-forge": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.7.1.tgz", + "integrity": "sha1-naYR6giYL0uUIGs760zJZl8gwwA=" + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" + }, + "oauth-sign": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", + "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=" + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "object-keys": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.11.tgz", + "integrity": "sha1-xUYBd4rVYPEULODgG8yotW0TQm0=" + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "requires": { + "ee-first": "1.1.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1.0.2" + } + }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "requires": { + "mimic-fn": "1.2.0" + } + }, + "optionator": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", + "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "dev": true, + "requires": { + "deep-is": "0.1.3", + "fast-levenshtein": "2.0.6", + "levn": "0.3.0", + "prelude-ls": "1.1.2", + "type-check": "0.3.2", + "wordwrap": "1.0.0" + } + }, + "optjs": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/optjs/-/optjs-3.2.2.tgz", + "integrity": "sha1-aabOicRCpEQDFBrS+bNwvVu29O4=" + }, + "os-locale": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "requires": { + "lcid": "1.0.0" + } + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "parseurl": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", + "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=" + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true + }, + "path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" + }, + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "requires": { + "pify": "3.0.0" + } + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "2.0.4" + } + }, + "pluralize": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", + "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", + "dev": true + }, + "power-assert": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/power-assert/-/power-assert-1.4.4.tgz", + "integrity": "sha1-kpXqdDcZb1pgH95CDwQmMRhtdRc=", + "requires": { + "define-properties": "1.1.2", + "empower": "1.2.3", + "power-assert-formatter": "1.4.1", + "universal-deep-strict-equal": "1.2.2", + "xtend": "4.0.1" + } + }, + "power-assert-context-formatter": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/power-assert-context-formatter/-/power-assert-context-formatter-1.1.1.tgz", + "integrity": "sha1-7bo1LT7YpgMRTWZyZazOYNaJzN8=", + "requires": { + "core-js": "2.5.3", + "power-assert-context-traversal": "1.1.1" + } + }, + "power-assert-context-reducer-ast": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/power-assert-context-reducer-ast/-/power-assert-context-reducer-ast-1.1.2.tgz", + "integrity": "sha1-SEqZ4m9Jc/+IMuXFzHVnAuYJQXQ=", + "requires": { + "acorn": "4.0.13", + "acorn-es7-plugin": "1.1.7", + "core-js": "2.5.3", + "espurify": "1.7.0", + "estraverse": "4.2.0" + } + }, + "power-assert-context-traversal": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/power-assert-context-traversal/-/power-assert-context-traversal-1.1.1.tgz", + "integrity": "sha1-iMq8oNE7Y1nwfT0+ivppkmRXftk=", + "requires": { + "core-js": "2.5.3", + "estraverse": "4.2.0" + } + }, + "power-assert-formatter": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/power-assert-formatter/-/power-assert-formatter-1.4.1.tgz", + "integrity": "sha1-XcEl7VCj37HdomwZNH879Y7CiEo=", + "requires": { + "core-js": "2.5.3", + "power-assert-context-formatter": "1.1.1", + "power-assert-context-reducer-ast": "1.1.2", + "power-assert-renderer-assertion": "1.1.1", + "power-assert-renderer-comparison": "1.1.1", + "power-assert-renderer-diagram": "1.1.2", + "power-assert-renderer-file": "1.1.1" + } + }, + "power-assert-renderer-assertion": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/power-assert-renderer-assertion/-/power-assert-renderer-assertion-1.1.1.tgz", + "integrity": "sha1-y/wOd+AIao+Wrz8djme57n4ozpg=", + "requires": { + "power-assert-renderer-base": "1.1.1", + "power-assert-util-string-width": "1.1.1" + } + }, + "power-assert-renderer-base": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/power-assert-renderer-base/-/power-assert-renderer-base-1.1.1.tgz", + "integrity": "sha1-lqZQxv0F7hvB9mtUrWFELIs/Y+s=" + }, + "power-assert-renderer-comparison": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/power-assert-renderer-comparison/-/power-assert-renderer-comparison-1.1.1.tgz", + "integrity": "sha1-10Odl9hRVr5OMKAPL7WnJRTOPAg=", + "requires": { + "core-js": "2.5.3", + "diff-match-patch": "1.0.0", + "power-assert-renderer-base": "1.1.1", + "stringifier": "1.3.0", + "type-name": "2.0.2" + } + }, + "power-assert-renderer-diagram": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/power-assert-renderer-diagram/-/power-assert-renderer-diagram-1.1.2.tgz", + "integrity": "sha1-ZV+PcRk1qbbVQbhjJ2VHF8Y3qYY=", + "requires": { + "core-js": "2.5.3", + "power-assert-renderer-base": "1.1.1", + "power-assert-util-string-width": "1.1.1", + "stringifier": "1.3.0" + } + }, + "power-assert-renderer-file": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/power-assert-renderer-file/-/power-assert-renderer-file-1.1.1.tgz", + "integrity": "sha1-o34rvReMys0E5427eckv40kzxec=", + "requires": { + "power-assert-renderer-base": "1.1.1" + } + }, + "power-assert-util-string-width": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/power-assert-util-string-width/-/power-assert-util-string-width-1.1.1.tgz", + "integrity": "sha1-vmWet5N/3S5smncmjar2S9W3xZI=", + "requires": { + "eastasianwidth": "0.1.1" + } + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "prettier": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.10.2.tgz", + "integrity": "sha512-TcdNoQIWFoHblurqqU6d1ysopjq7UX0oRcT/hJ8qvBAELiYWn+Ugf0AXdnzISEJ7vuhNnQ98N8jR8Sh53x4IZg==" + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" + }, + "progress": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.0.tgz", + "integrity": "sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8=", + "dev": true + }, + "protobufjs": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-5.0.2.tgz", + "integrity": "sha1-WXSNfc8D0tsiwT2p/rAk4Wq4DJE=", + "requires": { + "ascli": "1.0.1", + "bytebuffer": "5.0.1", + "glob": "7.1.2", + "yargs": "3.32.0" + } + }, + "proxy-addr": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.2.tgz", + "integrity": "sha1-ZXFQT0e7mI7IGAJT+F3X4UlSvew=", + "requires": { + "forwarded": "0.1.2", + "ipaddr.js": "1.5.2" + } + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "dev": true + }, + "pump": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", + "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", + "requires": { + "end-of-stream": "1.4.1", + "once": "1.4.0" + } + }, + "pumpify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.4.0.tgz", + "integrity": "sha512-2kmNR9ry+Pf45opRVirpNuIFotsxUGLaYqxIwuR77AYrYRMuFCz9eryHBS52L360O+NcR383CL4QYlMKPq4zYA==", + "requires": { + "duplexify": "3.5.3", + "inherits": "2.0.3", + "pump": "2.0.1" + } + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" + }, + "qs": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", + "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==" + }, + "range-parser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", + "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=" + }, + "raw-body": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.2.tgz", + "integrity": "sha1-vNYMd9Prk83gBQKVw/N5OJvIj4k=", + "requires": { + "bytes": "3.0.0", + "http-errors": "1.6.2", + "iconv-lite": "0.4.19", + "unpipe": "1.0.0" + } + }, + "readable-stream": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.4.tgz", + "integrity": "sha512-vuYxeWYM+fde14+rajzqgeohAI7YoJcHE7kXDAc4Nk0EbuKnJfqtY9YtRkLo/tqkuF7MsBQRhPnPeyjYITp3ZQ==", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "2.0.0", + "safe-buffer": "5.1.1", + "string_decoder": "1.0.3", + "util-deprecate": "1.0.2" + } + }, + "request": { + "version": "2.83.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.83.0.tgz", + "integrity": "sha512-lR3gD69osqm6EYLk9wB/G1W/laGWjzH90t1vEa2xuxHD5KUrSzp9pUSfTm+YC5Nxt2T8nMPEvKlhbQayU7bgFw==", + "requires": { + "aws-sign2": "0.7.0", + "aws4": "1.6.0", + "caseless": "0.12.0", + "combined-stream": "1.0.5", + "extend": "3.0.1", + "forever-agent": "0.6.1", + "form-data": "2.3.1", + "har-validator": "5.0.3", + "hawk": "6.0.2", + "http-signature": "1.2.0", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.17", + "oauth-sign": "0.8.2", + "performance-now": "2.1.0", + "qs": "6.5.1", + "safe-buffer": "5.1.1", + "stringstream": "0.0.5", + "tough-cookie": "2.3.3", + "tunnel-agent": "0.6.0", + "uuid": "3.2.1" + } + }, + "require-uncached": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", + "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", + "dev": true, + "requires": { + "caller-path": "0.1.0", + "resolve-from": "1.0.1" + } + }, + "resolve-from": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", + "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", + "dev": true + }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "dev": true, + "requires": { + "onetime": "2.0.1", + "signal-exit": "3.0.2" + } + }, + "resumer": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/resumer/-/resumer-0.0.0.tgz", + "integrity": "sha1-8ej0YeQGS6Oegq883CqMiT0HZ1k=", + "requires": { + "through": "2.3.8" + } + }, + "retry-request": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/retry-request/-/retry-request-3.3.1.tgz", + "integrity": "sha512-PjAmtWIxjNj4Co/6FRtBl8afRP3CxrrIAnUzb1dzydfROd+6xt7xAebFeskgQgkfFf8NmzrXIoaB3HxmswXyxw==", + "requires": { + "request": "2.83.0", + "through2": "2.0.3" + } + }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "dev": true, + "requires": { + "glob": "7.1.2" + } + }, + "run-async": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", + "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "dev": true, + "requires": { + "is-promise": "2.1.0" + } + }, + "rx-lite": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz", + "integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=", + "dev": true + }, + "rx-lite-aggregates": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz", + "integrity": "sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74=", + "dev": true, + "requires": { + "rx-lite": "4.0.8" + } + }, + "safe-buffer": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" + }, + "semver": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "dev": true + }, + "send": { + "version": "0.16.1", + "resolved": "https://registry.npmjs.org/send/-/send-0.16.1.tgz", + "integrity": "sha512-ElCLJdJIKPk6ux/Hocwhk7NFHpI3pVm/IZOYWqUmoxcgeyM+MpxHHKhb8QmlJDX1pU6WrgaHBkVNm73Sv7uc2A==", + "requires": { + "debug": "2.6.9", + "depd": "1.1.2", + "destroy": "1.0.4", + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "etag": "1.8.1", + "fresh": "0.5.2", + "http-errors": "1.6.2", + "mime": "1.4.1", + "ms": "2.0.0", + "on-finished": "2.3.0", + "range-parser": "1.2.0", + "statuses": "1.3.1" + }, + "dependencies": { + "mime": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", + "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==" + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + } + } + }, + "serve-static": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.1.tgz", + "integrity": "sha512-hSMUZrsPa/I09VYFJwa627JJkNs0NrfL1Uzuup+GqHfToR2KcsXFymXSV90hoyw3M+msjFuQly+YzIH/q0MGlQ==", + "requires": { + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "parseurl": "1.3.2", + "send": "0.16.1" + } + }, + "setprototypeof": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", + "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==" + }, + "sha1": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/sha1/-/sha1-1.1.1.tgz", + "integrity": "sha1-rdqnqTFo85PxnrKxUJFhjicA+Eg=", + "requires": { + "charenc": "0.0.2", + "crypt": "0.0.2" + } + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" + }, + "slash": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", + "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=" + }, + "slice-ansi": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", + "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "2.0.0" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + } + } + }, + "snakeize": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/snakeize/-/snakeize-0.1.0.tgz", + "integrity": "sha1-EMCI2LWOsHazIpu1oE4jLOEmQi0=" + }, + "sntp": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-2.1.0.tgz", + "integrity": "sha512-FL1b58BDrqS3A11lJ0zEdnJ3UOKqVxawAkF3k7F0CVN7VQ34aZrV+G8BZ1WC9ZL7NyrwsW0oviwsWDgRuVYtJg==", + "requires": { + "hoek": "4.2.0" + } + }, + "split": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/split/-/split-0.2.10.tgz", + "integrity": "sha1-Zwl8YB1pfOE2j0GPBs0gHPBSGlc=", + "requires": { + "through": "2.3.8" + } + }, + "split-array-stream": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/split-array-stream/-/split-array-stream-1.0.3.tgz", + "integrity": "sha1-0rdajl4Ngk1S/eyLgiWDncLjXfo=", + "requires": { + "async": "2.6.0", + "is-stream-ended": "0.1.3" + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "sshpk": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.13.1.tgz", + "integrity": "sha1-US322mKHFEMW3EwY/hzx2UBzm+M=", + "requires": { + "asn1": "0.2.3", + "assert-plus": "1.0.0", + "bcrypt-pbkdf": "1.0.1", + "dashdash": "1.14.1", + "ecc-jsbn": "0.1.1", + "getpass": "0.1.7", + "jsbn": "0.1.1", + "tweetnacl": "0.14.5" + } + }, + "statuses": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", + "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=" + }, + "stream-combiner": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz", + "integrity": "sha1-TV5DPBhSYd3mI8o/RMWGvPXErRQ=", + "requires": { + "duplexer": "0.1.1" + } + }, + "stream-events": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/stream-events/-/stream-events-1.0.2.tgz", + "integrity": "sha1-q/OfZsCJCk63lbyNXoWbJhW1kLI=", + "requires": { + "stubs": "3.0.0" + } + }, + "stream-shift": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", + "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=" + }, + "string-format-obj": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string-format-obj/-/string-format-obj-1.1.1.tgz", + "integrity": "sha512-Mm+sROy+pHJmx0P/0Bs1uxIX6UhGJGj6xDGQZ5zh9v/SZRmLGevp+p0VJxV7lirrkAmQ2mvva/gHKpnF/pTb+Q==" + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "requires": { + "safe-buffer": "5.1.1" + } + }, + "stringifier": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/stringifier/-/stringifier-1.3.0.tgz", + "integrity": "sha1-3vGDQvaTPbDy2/yaoCF1tEjBeVk=", + "requires": { + "core-js": "2.5.3", + "traverse": "0.6.6", + "type-name": "2.0.2" + } + }, + "stringstream": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", + "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=" + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "2.1.1" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + }, + "stubs": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/stubs/-/stubs-3.0.0.tgz", + "integrity": "sha1-6NK6H6nJBXAwPAMLaQD31fiavls=" + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + }, + "table": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz", + "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==", + "dev": true, + "requires": { + "ajv": "5.5.2", + "ajv-keywords": "2.1.1", + "chalk": "2.3.1", + "lodash": "4.17.5", + "slice-ansi": "1.0.0", + "string-width": "2.1.1" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "2.0.0", + "strip-ansi": "4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + } + } + }, + "tape": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tape/-/tape-2.3.0.tgz", + "integrity": "sha1-Df7scJIn+8yRcKvn8EaWKycUMds=", + "requires": { + "deep-equal": "0.1.2", + "defined": "0.0.0", + "inherits": "2.0.3", + "jsonify": "0.0.0", + "resumer": "0.0.0", + "split": "0.2.10", + "stream-combiner": "0.0.4", + "through": "2.3.8" + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" + }, + "through2": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "requires": { + "readable-stream": "2.3.4", + "xtend": "4.0.1" + } + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "1.0.2" + } + }, + "topo": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/topo/-/topo-1.1.0.tgz", + "integrity": "sha1-6ddRYV0buH3IZdsYL6HKCl71NtU=", + "requires": { + "hoek": "2.16.3" + }, + "dependencies": { + "hoek": { + "version": "2.16.3", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", + "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=" + } + } + }, + "tough-cookie": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.3.tgz", + "integrity": "sha1-C2GKVWW23qkL80JdBNVe3EdadWE=", + "requires": { + "punycode": "1.4.1" + } + }, + "traverse": { + "version": "0.6.6", + "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.6.tgz", + "integrity": "sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc=" + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "requires": { + "safe-buffer": "5.1.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "optional": true + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "1.1.2" + } + }, + "type-is": { + "version": "1.6.15", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.15.tgz", + "integrity": "sha1-yrEPtJCeRByChC6v4a1kbIGARBA=", + "requires": { + "media-typer": "0.3.0", + "mime-types": "2.1.17" + } + }, + "type-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/type-name/-/type-name-2.0.2.tgz", + "integrity": "sha1-7+fUEj2KxSr/9/QMfk3sUmYAj7Q=" + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" + }, + "unique-string": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-1.0.0.tgz", + "integrity": "sha1-nhBXzKhRq7kzmPizOuGHuZyuwRo=", + "requires": { + "crypto-random-string": "1.0.0" + } + }, + "universal-deep-strict-equal": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/universal-deep-strict-equal/-/universal-deep-strict-equal-1.2.2.tgz", + "integrity": "sha1-DaSsL3PP95JMgfpN4BjKViyisKc=", + "requires": { + "array-filter": "1.0.0", + "indexof": "0.0.1", + "object-keys": "1.0.11" + } + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" + }, + "urlgrey": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/urlgrey/-/urlgrey-0.4.0.tgz", + "integrity": "sha1-8GU1cED7NcOzEdTl3DZITZbb6gY=", + "requires": { + "tape": "2.3.0" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" + }, + "uuid": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.2.1.tgz", + "integrity": "sha512-jZnMwlb9Iku/O3smGWvZhauCf6cvvpKi4BKRiliS3cxnI+Gz9j5MEpTz2UFuXiKPJocb7gnsLHwiS05ige5BEA==" + }, + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "requires": { + "assert-plus": "1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "1.3.0" + } + }, + "websocket-driver": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.0.tgz", + "integrity": "sha1-DK+dLXVdk67gSdS90NP+LMoqJOs=", + "requires": { + "http-parser-js": "0.4.10", + "websocket-extensions": "0.1.3" + } + }, + "websocket-extensions": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.3.tgz", + "integrity": "sha512-nqHUnMXmBzT0w570r2JpJxfiSD1IzoI+HGVdd3aZ0yNi3ngvQ4jv1dtHt5VGxfI2yj5yqImPhOK4vmIh2xMbGg==" + }, + "which": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", + "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "dev": true, + "requires": { + "isexe": "2.0.0" + } + }, + "window-size": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.4.tgz", + "integrity": "sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY=" + }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "requires": { + "string-width": "1.0.2", + "strip-ansi": "3.0.1" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "write": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", + "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", + "dev": true, + "requires": { + "mkdirp": "0.5.1" + } + }, + "write-file-atomic": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.3.0.tgz", + "integrity": "sha512-xuPeK4OdjWqtfi59ylvVL0Yn35SF3zgcAcv7rBPFHVaEapaDr4GdGgm3j7ckTwH9wHL7fGmgfAnb0+THrHb8tA==", + "requires": { + "graceful-fs": "4.1.11", + "imurmurhash": "0.1.4", + "signal-exit": "3.0.2" + } + }, + "xdg-basedir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-3.0.0.tgz", + "integrity": "sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ=" + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" + }, + "y18n": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=" + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "dev": true + }, + "yargs": { + "version": "3.32.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.32.0.tgz", + "integrity": "sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU=", + "requires": { + "camelcase": "2.1.1", + "cliui": "3.2.0", + "decamelize": "1.2.0", + "os-locale": "1.4.0", + "string-width": "1.0.2", + "window-size": "0.1.4", + "y18n": "3.2.1" + } + } + } +} diff --git a/scripts/docs.angularjs.org-firebase/functions/package.json b/scripts/docs.angularjs.org-firebase/functions/package.json new file mode 100644 index 000000000000..fdfb9cf8b46d --- /dev/null +++ b/scripts/docs.angularjs.org-firebase/functions/package.json @@ -0,0 +1,21 @@ +{ + "name": "functions", + "description": "Cloud Functions for Firebase", + "scripts": { + "lint": "./node_modules/.bin/eslint .", + "serve": "firebase serve --only functions", + "shell": "firebase experimental:functions:shell", + "start": "npm run shell", + "deploy": "firebase deploy --only functions", + "logs": "firebase functions:log" + }, + "dependencies": { + "firebase-admin": "~5.8.1", + "firebase-functions": "^0.8.1" + }, + "devDependencies": { + "eslint": "^4.12.0", + "eslint-plugin-promise": "^3.6.0" + }, + "private": true +} diff --git a/scripts/docs.angularjs.org-firebase/readme.firebase.docs.md b/scripts/docs.angularjs.org-firebase/readme.firebase.docs.md index d73e9a74f5d2..cd6019d77b64 100644 --- a/scripts/docs.angularjs.org-firebase/readme.firebase.docs.md +++ b/scripts/docs.angularjs.org-firebase/readme.firebase.docs.md @@ -1,10 +1,23 @@ Firebase for docs.angularjs.org =============================== +# Continuous integration + The docs are deployed to Google Firebase hosting via Travis deployment config, which expects -firebase.json and .firebaserc in the repository root. +firebase.json in the repository root, which is done by a Grunt task (firebaseDocsJsonForTravis) +that modifies the paths in the firebase.json and copies it into the repository root. + +See travis.yml for the complete deployment config, and scripts/travis/build.sh for the full deployment +build steps. + +# Serving locally: + +- Run `grunt:prepareDeploy`. + This copies docs content files into deploy/docs and the partials for Search Engine AJAX + Crawling into ./functions/content. -See travis.yml for the complete deployment config. +- Run `firebase serve --only functions,hosting` + Creates a server at localhost:5000 that serves from deploy/docs and uses the local function See /scripts/code.angularjs.org-firebase/readme.firebase.code.md for the firebase deployment to code.angularjs.org \ No newline at end of file From fb479188f5312310094ee8f6c7366000181d6130 Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Mon, 12 Feb 2018 21:55:41 +0200 Subject: [PATCH 386/745] chore(docs.angular.js): do not break when deploying Follow-up to #16451. Closes #16452 --- lib/grunt/utils.js | 4 ++-- scripts/docs.angularjs.org-firebase/firebase.json | 5 ----- scripts/docs.angularjs.org-firebase/functions/package.json | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/lib/grunt/utils.js b/lib/grunt/utils.js index 64ddc6f185ec..73e8b1efc790 100644 --- a/lib/grunt/utils.js +++ b/lib/grunt/utils.js @@ -302,8 +302,8 @@ module.exports = { var fileName = docsScriptFolder + '/firebase.json'; var json = grunt.file.readJSON(fileName); - json.hosting.public = 'deploy/docs'; - json.functions.source = docsScriptFolder + '/functions'; + (json.hosting || (json.hosting = {})).public = 'deploy/docs'; + (json.functions || (json.functions = {})).source = docsScriptFolder + '/functions'; grunt.file.write('firebase.json', JSON.stringify(json)); } diff --git a/scripts/docs.angularjs.org-firebase/firebase.json b/scripts/docs.angularjs.org-firebase/firebase.json index 880a5eca86de..bf080d386fd7 100644 --- a/scripts/docs.angularjs.org-firebase/firebase.json +++ b/scripts/docs.angularjs.org-firebase/firebase.json @@ -27,10 +27,5 @@ "function": "sendFile" } ] - }, - "functions": { - "predeploy": [ - "npm --prefix $RESOURCE_DIR run lint" - ] } } diff --git a/scripts/docs.angularjs.org-firebase/functions/package.json b/scripts/docs.angularjs.org-firebase/functions/package.json index fdfb9cf8b46d..381fbc501096 100644 --- a/scripts/docs.angularjs.org-firebase/functions/package.json +++ b/scripts/docs.angularjs.org-firebase/functions/package.json @@ -2,7 +2,7 @@ "name": "functions", "description": "Cloud Functions for Firebase", "scripts": { - "lint": "./node_modules/.bin/eslint .", + "lint": "eslint .", "serve": "firebase serve --only functions", "shell": "firebase experimental:functions:shell", "start": "npm run shell", From ba140dbff9dddcdad239241fbe0240a25b29d188 Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Tue, 13 Feb 2018 01:25:34 +0200 Subject: [PATCH 387/745] chore(docs.angularjs.org): install firebase dependencies before deploying Firebase is trying to execute our functions code locally in order to parse the triggers. Install npm dependencies to avoid errors like: ``` Error: Error parsing triggers: Cannot find module 'firebase-functions' ``` Closes #16453 --- .../readme.firebase.docs.md | 2 +- scripts/travis/build.sh | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/scripts/docs.angularjs.org-firebase/readme.firebase.docs.md b/scripts/docs.angularjs.org-firebase/readme.firebase.docs.md index cd6019d77b64..10da862469df 100644 --- a/scripts/docs.angularjs.org-firebase/readme.firebase.docs.md +++ b/scripts/docs.angularjs.org-firebase/readme.firebase.docs.md @@ -20,4 +20,4 @@ build steps. Creates a server at localhost:5000 that serves from deploy/docs and uses the local function See /scripts/code.angularjs.org-firebase/readme.firebase.code.md for the firebase deployment to -code.angularjs.org \ No newline at end of file +code.angularjs.org diff --git a/scripts/travis/build.sh b/scripts/travis/build.sh index 980855388492..ed8838cc9574 100755 --- a/scripts/travis/build.sh +++ b/scripts/travis/build.sh @@ -2,6 +2,9 @@ set -e +readonly THIS_DIR=$(cd $(dirname $0); pwd) +readonly ROOT_DIR="$THIS_DIR/../.." + export BROWSER_STACK_ACCESS_KEY export SAUCE_ACCESS_KEY @@ -80,6 +83,14 @@ case "$JOB" in if [[ "$DEPLOY_DOCS" == true || "$DEPLOY_CODE" == true ]]; then grunt prepareDeploy + + if [[ "$DEPLOY_DOCS" == true ]]; then + # Install npm dependencies for Firebase functions. + ( + cd "$ROOT_DIR/scripts/docs.angularjs.org-firebase/functions" + npm install + ) + fi else echo "Skipping deployment build because conditions have not been met." fi @@ -94,4 +105,4 @@ case "$JOB" in or\ 'deploy'." ;; -esac \ No newline at end of file +esac From a126b346ff0f99562231a3721868d23a7c48495e Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Tue, 13 Feb 2018 01:52:02 +0200 Subject: [PATCH 388/745] chore(travis): fix `ROOT_DIR` path when `build.sh` is sourced --- scripts/travis/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/travis/build.sh b/scripts/travis/build.sh index ed8838cc9574..9338247915a3 100755 --- a/scripts/travis/build.sh +++ b/scripts/travis/build.sh @@ -2,7 +2,7 @@ set -e -readonly THIS_DIR=$(cd $(dirname $0); pwd) +readonly THIS_DIR=$(cd $(dirname ${BASH_SOURCE[0]}); pwd) readonly ROOT_DIR="$THIS_DIR/../.." export BROWSER_STACK_ACCESS_KEY From 04ee1e781b931725cded2e40ce9bdc2674186b11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82=C4=99biowski-Owczarek?= Date: Thu, 15 Feb 2018 14:28:47 +0100 Subject: [PATCH 389/745] docs(*): add CODE_OF_CONDUCT.md Closes #16456 --- CODE_OF_CONDUCT.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 CODE_OF_CONDUCT.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 000000000000..baa757d028ae --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,3 @@ +# Contributor Code of Conduct + +The AngularJS project follows the Code of Conduct defined in [the angular/code-of-conduct repository](https://github.com/angular/code-of-conduct/blob/master/CODE_OF_CONDUCT.md). Please read it. From 9645a08b61bf4e0b52f3cde9567e4a12524ea488 Mon Sep 17 00:00:00 2001 From: Martin Staffa Date: Tue, 13 Feb 2018 10:00:12 +0100 Subject: [PATCH 390/745] chore(docs.angularjs.org): allow robots access to js files Related to #16432 --- docs/app/assets/robots.txt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/app/assets/robots.txt b/docs/app/assets/robots.txt index c00cb3c20320..96b3734af696 100644 --- a/docs/app/assets/robots.txt +++ b/docs/app/assets/robots.txt @@ -1,9 +1,14 @@ User-agent: * Disallow: /examples/ -Disallow: /img/ Disallow: /partials/ Disallow: /ptore2e/ -Disallow: /*.js$ # The js files in the root are used by the embedded examples, not by the app itself -Disallow: /*.map$ # The map files in the root are used by the embedded examples, not by the app itself Disallow: /Error404.html + +# The js / map files in the root are used by the embedded examples, not by the app itself +Disallow: /*.js$ +Disallow: /*.map$ + +# (Javascript) crawlers need to access JS files +Allow: /components/*.js +Allow: /js/*.js From 3eabaab009c9b8d86759374a3b66a6b7a71dd5aa Mon Sep 17 00:00:00 2001 From: Martin Staffa Date: Thu, 15 Feb 2018 11:54:14 +0100 Subject: [PATCH 391/745] chore(docs.angularjs.org): allow crawling but not indexing of partials/ The sitemap.xml might also prevent the indexing, as the partials are not listed. Related to #16432 Closes #16457 --- docs/app/assets/robots.txt | 1 - scripts/docs.angularjs.org-firebase/firebase.json | 9 +++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/app/assets/robots.txt b/docs/app/assets/robots.txt index 96b3734af696..36b7daeca859 100644 --- a/docs/app/assets/robots.txt +++ b/docs/app/assets/robots.txt @@ -1,7 +1,6 @@ User-agent: * Disallow: /examples/ -Disallow: /partials/ Disallow: /ptore2e/ Disallow: /Error404.html diff --git a/scripts/docs.angularjs.org-firebase/firebase.json b/scripts/docs.angularjs.org-firebase/firebase.json index bf080d386fd7..9e112f2ff9ee 100644 --- a/scripts/docs.angularjs.org-firebase/firebase.json +++ b/scripts/docs.angularjs.org-firebase/firebase.json @@ -26,6 +26,15 @@ "source": "**/*!(.@(jpg|jpeg|gif|png|html|js|map|json|css|svg|ttf|txt|woff|woff2|eot|xml))", "function": "sendFile" } + ], + "headers": [ + { + "source": "/partials/**", + "headers" : [{ + "key" : "X-Robots-Tag", + "value" : "noindex" + }] + } ] } } From f1c164c92f880b41fed38246baa0c1d4d914dd61 Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Mon, 19 Feb 2018 19:31:43 +0000 Subject: [PATCH 392/745] docs($parse): add missing error documents --- docs/content/error/$parse/esc.ngdoc | 10 ++++++++++ docs/content/error/$parse/lval.ngdoc | 13 +++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 docs/content/error/$parse/esc.ngdoc create mode 100644 docs/content/error/$parse/lval.ngdoc diff --git a/docs/content/error/$parse/esc.ngdoc b/docs/content/error/$parse/esc.ngdoc new file mode 100644 index 000000000000..3f308b2d2fec --- /dev/null +++ b/docs/content/error/$parse/esc.ngdoc @@ -0,0 +1,10 @@ +@ngdoc error +@name $parse:esc +@fullName Value cannot be escaped +@description + +Occurs when the parser tries to escape a value that is not known. + +This should never occur in practice. If it does then that indicates a programming +error in the AngularJS `$parse` service itself and should be reported as an issue +at https://github.com/angular/angular.js/issues. \ No newline at end of file diff --git a/docs/content/error/$parse/lval.ngdoc b/docs/content/error/$parse/lval.ngdoc new file mode 100644 index 000000000000..03d23465a73d --- /dev/null +++ b/docs/content/error/$parse/lval.ngdoc @@ -0,0 +1,13 @@ +@ngdoc error +@name $parse:lval +@fullName Trying to assign a value to a non l-value +@description + +Occurs when an expression is trying to assign a value to a non-assignable expression. + +This can happen if the left side of an assigment is not a valid reference to a variable +or property. E.g. In the following snippet `1+2` is not assignable. + +``` +(1+2) = 'hello'; +``` From 56b6ba8e0b891b88687b826a9c4b2100bfd4901a Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Mon, 19 Feb 2018 19:37:26 +0000 Subject: [PATCH 393/745] docs($route): add missing error document --- docs/content/error/$route/norout.ngdoc | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 docs/content/error/$route/norout.ngdoc diff --git a/docs/content/error/$route/norout.ngdoc b/docs/content/error/$route/norout.ngdoc new file mode 100644 index 000000000000..30a12d151442 --- /dev/null +++ b/docs/content/error/$route/norout.ngdoc @@ -0,0 +1,8 @@ +@ngdoc error +@name $route:norout +@fullName Tried updating route when with no current route +@description + +Occurs when an attempt is made to update the parameters on the current route when +there is no current route. This can happen if you try to call `$route.updateParams();` +before the first route transition has completed. \ No newline at end of file From c617d6dceee5b000bfceda44ced22fc16b48b18b Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Tue, 20 Feb 2018 10:25:33 +0000 Subject: [PATCH 394/745] fix($templateRequest): give tpload error the correct namespace BREAKING CHANGE Previously the `tpload` error was namespaced to `$compile`. If you have code that matches errors of the form `[$compile:tpload]` it will no longer run. You should change the code to match `[$templateRequest:tpload]`. --- docs/content/error/$compile/tpload.ngdoc | 11 ----------- .../error/$templateRequest/tpload.ngdoc | 18 ++++++++++++++++++ src/ng/templateRequest.js | 2 +- 3 files changed, 19 insertions(+), 12 deletions(-) delete mode 100644 docs/content/error/$compile/tpload.ngdoc create mode 100644 docs/content/error/$templateRequest/tpload.ngdoc diff --git a/docs/content/error/$compile/tpload.ngdoc b/docs/content/error/$compile/tpload.ngdoc deleted file mode 100644 index b2b4fb2d0c2c..000000000000 --- a/docs/content/error/$compile/tpload.ngdoc +++ /dev/null @@ -1,11 +0,0 @@ -@ngdoc error -@name $compile:tpload -@fullName Error Loading Template -@description - -This error occurs when {@link ng.$compile `$compile`} attempts to fetch a template from some URL, and the request fails. - -To resolve this error, ensure that the URL of the template is spelled correctly and resolves to correct absolute URL. -The [Chrome Developer Tools](https://developers.google.com/chrome-developer-tools/docs/network#network_panel_overview) might also be helpful in determining why the request failed. - -If you are using {@link ng.$templateCache} to pre-load templates, ensure that the cache was populated with the template. diff --git a/docs/content/error/$templateRequest/tpload.ngdoc b/docs/content/error/$templateRequest/tpload.ngdoc new file mode 100644 index 000000000000..dba0788ce62b --- /dev/null +++ b/docs/content/error/$templateRequest/tpload.ngdoc @@ -0,0 +1,18 @@ +@ngdoc error +@name $templateRequest:tpload +@fullName Error Loading Template +@description + +This error occurs when {@link $templateRequest} attempts to fetch a template from some URL, and +the request fails. + +The template URL might be defined in a directive/component definition, an instance of `ngInclude`, +an instance of `ngMessagesInclude` or a templated route in a `$route` route definition. + +To resolve this error, ensure that the URL of the template is spelled correctly and resolves to +correct absolute URL. +The [Chrome Developer Tools](https://developers.google.com/chrome-developer-tools/docs/network#network_panel_overview) +might also be helpful in determining why the request failed. + +If you are using {@link ng.$templateCache} to pre-load templates, ensure that the cache was +populated with the template. diff --git a/src/ng/templateRequest.js b/src/ng/templateRequest.js index ff699d6cd0ef..7653b92a9126 100644 --- a/src/ng/templateRequest.js +++ b/src/ng/templateRequest.js @@ -1,6 +1,6 @@ 'use strict'; -var $templateRequestMinErr = minErr('$compile'); +var $templateRequestMinErr = minErr('$templateRequest'); /** * @ngdoc provider From b87c6a6d4d3d73fbc4d8aeecca58503d5d958d2c Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Tue, 20 Feb 2018 11:10:03 +0000 Subject: [PATCH 395/745] test(*): fix references to `tpload` minerr in tests --- test/ng/compileSpec.js | 2 +- test/ng/templateRequestSpec.js | 4 ++-- test/ngRoute/routeSpec.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/ng/compileSpec.js b/test/ng/compileSpec.js index acda50470485..e65b951ff90f 100644 --- a/test/ng/compileSpec.js +++ b/test/ng/compileSpec.js @@ -1917,7 +1917,7 @@ describe('$compile', function() { expect(function() { $httpBackend.flush(); - }).toThrowMinErr('$compile', 'tpload', 'Failed to load template: hello.html'); + }).toThrowMinErr('$templateRequest', 'tpload', 'Failed to load template: hello.html'); expect(sortedHtml(element)).toBe('
        '); }) ); diff --git a/test/ng/templateRequestSpec.js b/test/ng/templateRequestSpec.js index 3ca323613103..23f05f1e8d08 100644 --- a/test/ng/templateRequestSpec.js +++ b/test/ng/templateRequestSpec.js @@ -144,9 +144,9 @@ describe('$templateRequest', function() { $templateRequest('tpl.html').catch(function(reason) { err = reason; }); $httpBackend.flush(); - expect(err).toEqualMinErr('$compile', 'tpload', + expect(err).toEqualMinErr('$templateRequest', 'tpload', 'Failed to load template: tpl.html (HTTP status: 404 Not Found)'); - expect($exceptionHandler.errors[0]).toEqualMinErr('$compile', 'tpload', + expect($exceptionHandler.errors[0]).toEqualMinErr('$templateRequest', 'tpload', 'Failed to load template: tpl.html (HTTP status: 404 Not Found)'); }); }); diff --git a/test/ngRoute/routeSpec.js b/test/ngRoute/routeSpec.js index 772bdc7bc226..36832ab57884 100644 --- a/test/ngRoute/routeSpec.js +++ b/test/ngRoute/routeSpec.js @@ -892,7 +892,7 @@ describe('$route', function() { $httpBackend.flush(); expect($exceptionHandler.errors.pop()). - toEqualMinErr('$compile', 'tpload', 'Failed to load template: r1.html'); + toEqualMinErr('$templateRequest', 'tpload', 'Failed to load template: r1.html'); $httpBackend.expectGET('r2.html').respond(''); $location.path('/r2'); From 8b399545a5098cb2576594a26a03cd7268c55fb6 Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Tue, 20 Feb 2018 11:13:38 +0000 Subject: [PATCH 396/745] docs($route): fix typo in error message --- docs/content/error/$route/norout.ngdoc | 2 +- src/ngRoute/route.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/content/error/$route/norout.ngdoc b/docs/content/error/$route/norout.ngdoc index 30a12d151442..5dc5a9b8b7ee 100644 --- a/docs/content/error/$route/norout.ngdoc +++ b/docs/content/error/$route/norout.ngdoc @@ -1,6 +1,6 @@ @ngdoc error @name $route:norout -@fullName Tried updating route when with no current route +@fullName Tried updating route with no current route @description Occurs when an attempt is made to update the parameters on the current route when diff --git a/src/ngRoute/route.js b/src/ngRoute/route.js index 76f915b97da6..f0e6c19b9079 100644 --- a/src/ngRoute/route.js +++ b/src/ngRoute/route.js @@ -605,7 +605,7 @@ function $RouteProvider() { // interpolate modifies newParams, only query params are left $location.search(newParams); } else { - throw $routeMinErr('norout', 'Tried updating route when with no current route'); + throw $routeMinErr('norout', 'Tried updating route with no current route'); } } }; From ea0585773bb93fd891576e2271254a17e15f1ddd Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Sat, 10 Feb 2018 22:39:28 +0200 Subject: [PATCH 397/745] fix($resource): fix interceptors and success/error callbacks Previously, action-specific interceptors and `success`/`error` callbacks were executed in inconsistent relative orders and in a way that did not meet the general expectation for interceptor behavior (e.g. ability to recover from errors, performing asynchronous operations, etc). This commit fixes the behavior to make it more consistent and expected. The main differences are that `success`/`error` callbacks will now be run _after_ `response`/`responseError` interceptors complete (even if interceptors return a promise) and the correct callback will be called based on the result of the interceptor (e.g. if the `responseError` interceptor recovers from an error, the `success` callback will be called). See also https://github.com/angular/angular.js/issues/9334#issuecomment-364650642. This commit also replaces the use of `success`/`error` callbacks in the docs with using the returned promise. Fixes #6731 Fixes #9334 Closes #6865 Closes #16446 BREAKING CHANGE: If you are not using `success` or `error` callbacks with `$resource`, your app should not be affected by this change. If you are using `success` or `error` callbacks (with or without response interceptors), one (subtle) difference is that throwing an error inside the callbacks will not propagate to the returned `$promise`. Therefore, you should try to use the promises whenever possible. E.g.: ```js // Avoid User.query(function onSuccess(users) { throw new Error(); }). $promise. catch(function onError() { /* Will not be called. */ }); // Prefer User.query(). $promise. then(function onSuccess(users) { throw new Error(); }). catch(function onError() { /* Will be called. */ }); ``` Finally, if you are using `success` or `error` callbacks with response interceptors, the callbacks will now always run _after_ the interceptors (and wait for them to resolve in case they return a promise). Previously, the `error` callback was called before the `responseError` interceptor and the `success` callback was synchronously called after the `response` interceptor. E.g.: ```js var User = $resource('/api/users/:id', {id: '@id'}, { get: { method: 'get', interceptor: { response: function(response) { console.log('responseInterceptor-1'); return $timeout(1000).then(function() { console.log('responseInterceptor-2'); return response.resource; }); }, responseError: function(response) { console.log('responseErrorInterceptor-1'); return $timeout(1000).then(function() { console.log('responseErrorInterceptor-2'); return $q.reject('Ooops!'); }); } } } }); var onSuccess = function(value) { console.log('successCallback', value); }; var onError = function(error) { console.log('errorCallback', error); }; // Assuming the following call is successful... User.get({id: 1}, onSuccess, onError); // Old behavior: // responseInterceptor-1 // successCallback, {/* Promise object */} // responseInterceptor-2 // New behavior: // responseInterceptor-1 // responseInterceptor-2 // successCallback, {/* User object */} // Assuming the following call returns an error... User.get({id: 2}, onSuccess, onError); // Old behavior: // errorCallback, {/* Response object */} // responseErrorInterceptor-1 // responseErrorInterceptor-2 // New behavior: // responseErrorInterceptor-1 // responseErrorInterceptor-2 // errorCallback, Ooops! ``` --- src/ngResource/resource.js | 395 ++++++++++++++++++-------------- test/ngResource/resourceSpec.js | 288 +++++++++++++++++------ 2 files changed, 441 insertions(+), 242 deletions(-) diff --git a/src/ngResource/resource.js b/src/ngResource/resource.js index c8a79274ca2b..11bb45ba20b3 100644 --- a/src/ngResource/resource.js +++ b/src/ngResource/resource.js @@ -110,13 +110,13 @@ function shallowClearAndCopy(src, dst) { * * @param {Object=} paramDefaults Default values for `url` parameters. These can be overridden in * `actions` methods. If a parameter value is a function, it will be called every time - * a param value needs to be obtained for a request (unless the param was overridden). The function - * will be passed the current data value as an argument. + * a param value needs to be obtained for a request (unless the param was overridden). The + * function will be passed the current data value as an argument. * * Each key value in the parameter object is first bound to url template if present and then any * excess keys are appended to the url search query after the `?`. * - * Given a template `/path/:verb` and parameter `{verb:'greet', salutation:'Hello'}` results in + * Given a template `/path/:verb` and parameter `{verb: 'greet', salutation: 'Hello'}` results in * URL `/path/greet?salutation=Hello`. * * If the parameter value is prefixed with `@`, then the value for that parameter will be @@ -125,7 +125,7 @@ function shallowClearAndCopy(src, dst) { * For example, if the `defaultParam` object is `{someParam: '@someProp'}` then the value of * `someParam` will be `data.someProp`. * Note that the parameter will be ignored, when calling a "GET" action method (i.e. an action - * method that does not accept a request body) + * method that does not accept a request body). * * @param {Object.=} actions Hash with declaration of custom actions that will be available * in addition to the default set of resource actions (see below). If a custom action has the same @@ -134,9 +134,11 @@ function shallowClearAndCopy(src, dst) { * * The declaration should be created in the format of {@link ng.$http#usage $http.config}: * - * {action1: {method:?, params:?, isArray:?, headers:?, ...}, - * action2: {method:?, params:?, isArray:?, headers:?, ...}, - * ...} + * { + * action1: {method:?, params:?, isArray:?, headers:?, ...}, + * action2: {method:?, params:?, isArray:?, headers:?, ...}, + * ... + * } * * Where: * @@ -148,55 +150,58 @@ function shallowClearAndCopy(src, dst) { * the parameter value is a function, it will be called every time when a param value needs to * be obtained for a request (unless the param was overridden). The function will be passed the * current data value as an argument. - * - **`url`** – {string} – action specific `url` override. The url templating is supported just + * - **`url`** – {string} – Action specific `url` override. The url templating is supported just * like for the resource-level urls. * - **`isArray`** – {boolean=} – If true then the returned object for this action is an array, * see `returns` section. * - **`transformRequest`** – * `{function(data, headersGetter)|Array.}` – - * transform function or an array of such functions. The transform function takes the http + * Transform function or an array of such functions. The transform function takes the http * request body and headers and returns its transformed (typically serialized) version. * By default, transformRequest will contain one function that checks if the request data is * an object and serializes it using `angular.toJson`. To prevent this behavior, set * `transformRequest` to an empty array: `transformRequest: []` * - **`transformResponse`** – * `{function(data, headersGetter, status)|Array.}` – - * transform function or an array of such functions. The transform function takes the http + * Transform function or an array of such functions. The transform function takes the HTTP * response body, headers and status and returns its transformed (typically deserialized) * version. * By default, transformResponse will contain one function that checks if the response looks * like a JSON string and deserializes it using `angular.fromJson`. To prevent this behavior, * set `transformResponse` to an empty array: `transformResponse: []` - * - **`cache`** – `{boolean|Cache}` – If true, a default $http cache will be used to cache the - * GET request, otherwise if a cache instance built with - * {@link ng.$cacheFactory $cacheFactory} is supplied, this cache will be used for - * caching. - * - **`timeout`** – `{number}` – timeout in milliseconds.
        + * - **`cache`** – `{boolean|Cache}` – A boolean value or object created with + * {@link ng.$cacheFactory `$cacheFactory`} to enable or disable caching of the HTTP response. + * See {@link $http#caching $http Caching} for more information. + * - **`timeout`** – `{number}` – Timeout in milliseconds.
        * **Note:** In contrast to {@link ng.$http#usage $http.config}, {@link ng.$q promises} are - * **not** supported in $resource, because the same value would be used for multiple requests. + * **not** supported in `$resource`, because the same value would be used for multiple requests. * If you are looking for a way to cancel requests, you should use the `cancellable` option. - * - **`cancellable`** – `{boolean}` – if set to true, the request made by a "non-instance" call - * will be cancelled (if not already completed) by calling `$cancelRequest()` on the call's - * return value. Calling `$cancelRequest()` for a non-cancellable or an already - * completed/cancelled request will have no effect.
        - * - **`withCredentials`** - `{boolean}` - whether to set the `withCredentials` flag on the + * - **`cancellable`** – `{boolean}` – If true, the request made by a "non-instance" call will be + * cancelled (if not already completed) by calling `$cancelRequest()` on the call's return + * value. Calling `$cancelRequest()` for a non-cancellable or an already completed/cancelled + * request will have no effect. + * - **`withCredentials`** – `{boolean}` – Whether to set the `withCredentials` flag on the * XHR object. See - * [requests with credentials](https://developer.mozilla.org/en/http_access_control#section_5) + * [XMLHttpRequest.withCredentials](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials) * for more information. - * - **`responseType`** - `{string}` - see - * [requestType](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#responseType). - * - **`interceptor`** - `{Object=}` - The interceptor object has four optional methods - + * - **`responseType`** – `{string}` – See + * [XMLHttpRequest.responseType](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseType). + * - **`interceptor`** – `{Object=}` – The interceptor object has four optional methods - * `request`, `requestError`, `response`, and `responseError`. See - * {@link ng.$http $http interceptors} for details. Note that `request`/`requestError` - * interceptors are applied before calling `$http`, thus before any global `$http` interceptors. - * The resource instance or array object is accessible by the `resource` property of the - * `http response` object passed to response interceptors. + * {@link ng.$http#interceptors $http interceptors} for details. Note that + * `request`/`requestError` interceptors are applied before calling `$http`, thus before any + * global `$http` interceptors. Also, rejecting or throwing an error inside the `request` + * interceptor will result in calling the `responseError` interceptor. + * The resource instance or collection is available on the `resource` property of the + * `http response` object passed to `response`/`responseError` interceptors. * Keep in mind that the associated promise will be resolved with the value returned by the - * response interceptor, if one is specified. The default response interceptor returns - * `response.resource` (i.e. the resource instance or array). - * - **`hasBody`** - `{boolean}` - allows to specify if a request body should be included or not. - * If not specified only POST, PUT and PATCH requests will have a body. - * + * response interceptors. Make sure you return an appropriate value and not the `response` + * object passed as input. For reference, the default `response` interceptor (which gets applied + * if you don't specify a custom one) returns `response.resource`.
        + * See {@link ngResource.$resource#using-interceptors below} for an example of using + * interceptors in `$resource`. + * - **`hasBody`** – `{boolean}` – If true, then the request will have a body. + * If not specified, then only POST, PUT and PATCH requests will have a body. * * @param {Object} options Hash with custom settings that should extend the * default `$resourceProvider` behavior. The supported options are: * @@ -209,27 +214,29 @@ function shallowClearAndCopy(src, dst) { * @returns {Object} A resource "class" object with methods for the default set of resource actions * optionally extended with custom `actions`. The default set contains these actions: * ```js - * { 'get': {method:'GET'}, - * 'save': {method:'POST'}, - * 'query': {method:'GET', isArray:true}, - * 'remove': {method:'DELETE'}, - * 'delete': {method:'DELETE'} }; + * { + * 'get': {method: 'GET'}, + * 'save': {method: 'POST'}, + * 'query': {method: 'GET', isArray: true}, + * 'remove': {method: 'DELETE'}, + * 'delete': {method: 'DELETE'} + * } * ``` * - * Calling these methods invoke an {@link ng.$http} with the specified http method, - * destination and parameters. When the data is returned from the server then the object is an - * instance of the resource class. The actions `save`, `remove` and `delete` are available on it - * as methods with the `$` prefix. This allows you to easily perform CRUD operations (create, - * read, update, delete) on server-side data like this: + * Calling these methods invoke {@link ng.$http} with the specified http method, destination and + * parameters. When the data is returned from the server then the object is an instance of the + * resource class. The actions `save`, `remove` and `delete` are available on it as methods with + * the `$` prefix. This allows you to easily perform CRUD operations (create, read, update, + * delete) on server-side data like this: * ```js - * var User = $resource('/user/:userId', {userId:'@id'}); - * var user = User.get({userId:123}, function() { + * var User = $resource('/user/:userId', {userId: '@id'}); + * User.get({userId: 123}).$promise.then(function(user) { * user.abc = true; * user.$save(); * }); * ``` * - * It is important to realize that invoking a $resource object method immediately returns an + * It is important to realize that invoking a `$resource` object method immediately returns an * empty reference (object or array depending on `isArray`). Once the data is returned from the * server the existing reference is populated with the actual data. This is a useful trick since * usually the resource is assigned to a model which is then rendered by the view. Having an empty @@ -252,30 +259,31 @@ function shallowClearAndCopy(src, dst) { * * * Success callback is called with (value (Object|Array), responseHeaders (Function), - * status (number), statusText (string)) arguments, where the value is the populated resource + * status (number), statusText (string)) arguments, where `value` is the populated resource * instance or collection object. The error callback is called with (httpResponse) argument. * - * Class actions return empty instance (with additional properties below). - * Instance actions return promise of the action. + * Class actions return an empty instance (with the additional properties listed below). + * Instance actions return a promise for the operation. * * The Resource instances and collections have these additional properties: * - * - `$promise`: the {@link ng.$q promise} of the original server interaction that created this + * - `$promise`: The {@link ng.$q promise} of the original server interaction that created this * instance or collection. * * On success, the promise is resolved with the same resource instance or collection object, - * updated with data from server. This makes it easy to use in - * {@link ngRoute.$routeProvider resolve section of $routeProvider.when()} to defer view + * updated with data from server. This makes it easy to use in the + * {@link ngRoute.$routeProvider `resolve` section of `$routeProvider.when()`} to defer view * rendering until the resource(s) are loaded. * * On failure, the promise is rejected with the {@link ng.$http http response} object. * * If an interceptor object was provided, the promise will instead be resolved with the value - * returned by the interceptor. + * returned by the response interceptor (on success) or responceError interceptor (on failure). * * - `$resolved`: `true` after first server interaction is completed (either with success or * rejection), `false` before that. Knowing if the Resource has been resolved is useful in - * data-binding. + * data-binding. If there is a response/responseError interceptor and it returns a promise, + * `$resolved` will wait for that too. * * The Resource instances and collections have these additional methods: * @@ -292,121 +300,128 @@ function shallowClearAndCopy(src, dst) { * * @example * - * ### Credit card resource + * ### Basic usage * - * ```js - // Define CreditCard class - var CreditCard = $resource('/user/:userId/card/:cardId', - {userId:123, cardId:'@id'}, { - charge: {method:'POST', params:{charge:true}} - }); + ```js + // Define a CreditCard class + var CreditCard = $resource('/users/:userId/cards/:cardId', + {userId: 123, cardId: '@id'}, { + charge: {method: 'POST', params: {charge: true}} + }); // We can retrieve a collection from the server - var cards = CreditCard.query(function() { - // GET: /user/123/card - // server returns: [ {id:456, number:'1234', name:'Smith'} ]; + var cards = CreditCard.query(); + // GET: /users/123/cards + // server returns: [{id: 456, number: '1234', name: 'Smith'}] + // Wait for the request to complete + cards.$promise.then(function() { var card = cards[0]; - // each item is an instance of CreditCard + + // Each item is an instance of CreditCard expect(card instanceof CreditCard).toEqual(true); - card.name = "J. Smith"; - // non GET methods are mapped onto the instances + + // Non-GET methods are mapped onto the instances + card.name = 'J. Smith'; card.$save(); - // POST: /user/123/card/456 {id:456, number:'1234', name:'J. Smith'} - // server returns: {id:456, number:'1234', name: 'J. Smith'}; + // POST: /users/123/cards/456 {id: 456, number: '1234', name: 'J. Smith'} + // server returns: {id: 456, number: '1234', name: 'J. Smith'} - // our custom method is mapped as well. - card.$charge({amount:9.99}); - // POST: /user/123/card/456?amount=9.99&charge=true {id:456, number:'1234', name:'J. Smith'} + // Our custom method is mapped as well (since it uses POST) + card.$charge({amount: 9.99}); + // POST: /users/123/cards/456?amount=9.99&charge=true {id: 456, number: '1234', name: 'J. Smith'} }); - // we can create an instance as well - var newCard = new CreditCard({number:'0123'}); - newCard.name = "Mike Smith"; - newCard.$save(); - // POST: /user/123/card {number:'0123', name:'Mike Smith'} - // server returns: {id:789, number:'0123', name: 'Mike Smith'}; - expect(newCard.id).toEqual(789); - * ``` + // We can create an instance as well + var newCard = new CreditCard({number: '0123'}); + newCard.name = 'Mike Smith'; + + var savePromise = newCard.$save(); + // POST: /users/123/cards {number: '0123', name: 'Mike Smith'} + // server returns: {id: 789, number: '0123', name: 'Mike Smith'} + + savePromise.then(function() { + // Once the promise is resolved, the created instance + // is populated with the data returned by the server + expect(newCard.id).toEqual(789); + }); + ``` * - * The object returned from this function execution is a resource "class" which has "static" method - * for each action in the definition. + * The object returned from a call to `$resource` is a resource "class" which has one "static" + * method for each action in the definition. * - * Calling these methods invoke `$http` on the `url` template with the given `method`, `params` and - * `headers`. + * Calling these methods invokes `$http` on the `url` template with the given HTTP `method`, + * `params` and `headers`. * * @example * - * ### User resource + * ### Accessing the response * * When the data is returned from the server then the object is an instance of the resource type and * all of the non-GET methods are available with `$` prefix. This allows you to easily support CRUD * operations (create, read, update, delete) on server-side data. - + * ```js - var User = $resource('/user/:userId', {userId:'@id'}); - User.get({userId:123}, function(user) { + var User = $resource('/users/:userId', {userId: '@id'}); + User.get({userId: 123}).$promise.then(function(user) { user.abc = true; user.$save(); }); ``` * - * It's worth noting that the success callback for `get`, `query` and other methods gets passed - * in the response that came from the server as well as $http header getter function, so one - * could rewrite the above example and get access to http headers as: + * It's worth noting that the success callback for `get`, `query` and other methods gets called with + * the resource instance (populated with the data that came from the server) as well as an `$http` + * header getter function, the HTTP status code and the response status text. So one could rewrite + * the above example and get access to HTTP headers as follows: * ```js - var User = $resource('/user/:userId', {userId:'@id'}); - User.get({userId:123}, function(user, getResponseHeaders){ + var User = $resource('/users/:userId', {userId: '@id'}); + User.get({userId: 123}, function(user, getResponseHeaders) { user.abc = true; user.$save(function(user, putResponseHeaders) { - //user => saved user object - //putResponseHeaders => $http header getter + // `user` => saved `User` object + // `putResponseHeaders` => `$http` header getter }); }); ``` * - * You can also access the raw `$http` promise via the `$promise` property on the object returned - * - ``` - var User = $resource('/user/:userId', {userId:'@id'}); - User.get({userId:123}) - .$promise.then(function(user) { - $scope.user = user; - }); - ``` - * * @example * - * ### Creating a custom 'PUT' request + * ### Creating custom actions * - * In this example we create a custom method on our resource to make a PUT request - * ```js - * var app = angular.module('app', ['ngResource', 'ngRoute']); - * - * // Some APIs expect a PUT request in the format URL/object/ID - * // Here we are creating an 'update' method - * app.factory('Notes', ['$resource', function($resource) { - * return $resource('/notes/:id', null, - * { - * 'update': { method:'PUT' } - * }); - * }]); - * - * // In our controller we get the ID from the URL using ngRoute and $routeParams - * // We pass in $routeParams and our Notes factory along with $scope - * app.controller('NotesCtrl', ['$scope', '$routeParams', 'Notes', - function($scope, $routeParams, Notes) { - * // First get a note object from the factory - * var note = Notes.get({ id:$routeParams.id }); - * $id = note.id; - * - * // Now call update passing in the ID first then the object you are updating - * Notes.update({ id:$id }, note); - * - * // This will PUT /notes/ID with the note object in the request payload - * }]); - * ``` + * In this example we create a custom method on our resource to make a PUT request: + * + ```js + var app = angular.module('app', ['ngResource']); + + // Some APIs expect a PUT request in the format URL/object/ID + // Here we are creating an 'update' method + app.factory('Notes', ['$resource', function($resource) { + return $resource('/notes/:id', {id: '@id'}, { + update: {method: 'PUT'} + }); + }]); + + // In our controller we get the ID from the URL using `$location` + app.controller('NotesCtrl', ['$location', 'Notes', function($location, Notes) { + // First, retrieve the corresponding `Note` object from the server + // (Assuming a URL of the form `.../notes?id=XYZ`) + var noteId = $location.search().id; + var note = Notes.get({id: noteId}); + + note.$promise.then(function() { + note.content = 'Hello, world!'; + + // Now call `update` to save the changes on the server + Notes.update(note); + // This will PUT /notes/ID with the note object as the request payload + + // Since `update` is a non-GET method, it will also be available on the instance + // (prefixed with `$`), so we could replace the `Note.update()` call with: + //note.$update(); + }); + }]); + ``` * * @example * @@ -417,7 +432,7 @@ function shallowClearAndCopy(src, dst) { * ```js // ...defining the `Hotel` resource... - var Hotel = $resource('/api/hotel/:id', {id: '@id'}, { + var Hotel = $resource('/api/hotels/:id', {id: '@id'}, { // Let's make the `query()` method cancellable query: {method: 'get', isArray: true, cancellable: true} }); @@ -427,14 +442,54 @@ function shallowClearAndCopy(src, dst) { this.onDestinationChanged = function onDestinationChanged(destination) { // We don't care about any pending request for hotels // in a different destination any more - this.availableHotels.$cancelRequest(); + if (this.availableHotels) { + this.availableHotels.$cancelRequest(); + } - // Let's query for hotels in '' - // (calls: /api/hotel?location=) + // Let's query for hotels in `destination` + // (calls: /api/hotels?location=) this.availableHotels = Hotel.query({location: destination}); }; ``` * + * @example + * + * ### Using interceptors + * + * You can use interceptors to transform the request or response, perform additional operations, and + * modify the returned instance/collection. The following example, uses `request` and `response` + * interceptors to augment the returned instance with additional info: + * + ```js + var Thing = $resource('/api/things/:id', {id: '@id'}, { + save: { + method: 'POST', + interceptor: { + request: function(config) { + // Before the request is sent out, store a timestamp on the request config + config.requestTimestamp = Date.now(); + return config; + }, + response: function(response) { + // Get the instance from the response object + var instance = response.resource; + + // Augment the instance with a custom `saveLatency` property, computed as the time + // between sending the request and receiving the response. + instance.saveLatency = Date.now() - response.config.requestTimestamp; + + // Return the instance + return instance; + } + } + } + }); + + Thing.save({foo: 'bar'}).$promise.then(function(thing) { + console.log('That thing was saved in ' + thing.saveLatency + 'ms.'); + }); + ``` + * */ angular.module('ngResource', ['ng']). info({ angularVersion: '"NG_VERSION_FULL"' }). @@ -667,34 +722,34 @@ angular.module('ngResource', ['ng']). } Resource[name] = function(a1, a2, a3, a4) { - var params = {}, data, success, error; + var params = {}, data, onSuccess, onError; switch (arguments.length) { case 4: - error = a4; - success = a3; + onError = a4; + onSuccess = a3; // falls through case 3: case 2: if (isFunction(a2)) { if (isFunction(a1)) { - success = a1; - error = a2; + onSuccess = a1; + onError = a2; break; } - success = a2; - error = a3; + onSuccess = a2; + onError = a3; // falls through } else { params = a1; data = a2; - success = a3; + onSuccess = a3; break; } // falls through case 1: - if (isFunction(a1)) success = a1; + if (isFunction(a1)) onSuccess = a1; else if (hasBody) data = a1; else params = a1; break; @@ -714,11 +769,14 @@ angular.module('ngResource', ['ng']). var responseInterceptor = action.interceptor && action.interceptor.response || defaultResponseInterceptor; var responseErrorInterceptor = action.interceptor && action.interceptor.responseError || - undefined; - var hasError = !!error; - var hasResponseErrorInterceptor = !!responseErrorInterceptor; + $q.reject; + var successCallback = onSuccess ? function(val) { + onSuccess(val, response.headers, response.status, response.statusText); + } : undefined; + var errorCallback = onError || undefined; var timeoutDeferred; var numericTimeoutPromise; + var response; forEach(action, function(value, key) { switch (key) { @@ -754,8 +812,8 @@ angular.module('ngResource', ['ng']). catch(requestErrorInterceptor). then($http); - promise = promise.then(function(response) { - var data = response.data; + promise = promise.then(function(resp) { + var data = resp.data; if (data) { // Need to convert action.isArray to boolean in case it is undefined @@ -783,12 +841,14 @@ angular.module('ngResource', ['ng']). value.$promise = promise; // Restore the promise } } - response.resource = value; - return response; - }, function(response) { - response.resource = value; - return $q.reject(response); + resp.resource = value; + response = resp; + return responseInterceptor(resp); + }, function(rejectionOrResponse) { + rejectionOrResponse.resource = value; + response = rejectionOrResponse; + return responseErrorInterceptor(rejectionOrResponse); }); promise = promise['finally'](function() { @@ -800,25 +860,8 @@ angular.module('ngResource', ['ng']). } }); - promise = promise.then( - function(response) { - var value = responseInterceptor(response); - (success || noop)(value, response.headers, response.status, response.statusText); - return value; - }, - (hasError || hasResponseErrorInterceptor) ? - function(response) { - if (hasError && !hasResponseErrorInterceptor) { - // Avoid `Possibly Unhandled Rejection` error, - // but still fulfill the returned promise with a rejection - promise.catch(noop); - } - if (hasError) error(response); - return hasResponseErrorInterceptor ? - responseErrorInterceptor(response) : - $q.reject(response); - } : - undefined); + // Run the `success`/`error` callbacks, but do not let them affect the returned promise. + promise.then(successCallback, errorCallback); if (!isInstanceCall) { // we are creating instance / collection diff --git a/test/ngResource/resourceSpec.js b/test/ngResource/resourceSpec.js index 00fce4b662a8..077281a134ba 100644 --- a/test/ngResource/resourceSpec.js +++ b/test/ngResource/resourceSpec.js @@ -34,11 +34,11 @@ describe('basic usage', function() { callback = jasmine.createSpy('callback'); })); - afterEach(function() { $httpBackend.verifyNoOutstandingExpectation(); }); + describe('isValidDottedPath', function() { /* global isValidDottedPath: false */ it('should support arbitrary dotted names', function() { @@ -1312,102 +1312,225 @@ describe('basic usage', function() { }); }); - it('should allow per action response interceptor that gets full response', function() { - CreditCard = $resource('/CreditCard', {}, { - query: { - method: 'get', - isArray: true, - interceptor: { - response: function(response) { - return response; - } + + describe('responseInterceptor', function() { + it('should allow per action response interceptor that gets full response', function() { + var response; + + $httpBackend.expect('GET', '/CreditCard').respond(201, {id: 1}, {foo: 'bar'}, 'Ack'); + CreditCard = $resource('/CreditCard', {}, { + get: { + method: 'get', + interceptor: {response: function(resp) { response = resp; }} } - } + }); + + var cc = CreditCard.get(); + $httpBackend.flush(); + + expect(response.resource).toBe(cc); + expect(response.config).toBeDefined(); + expect(response.status).toBe(201); + expect(response.statusText).toBe('Ack'); + expect(response.headers()).toEqual({foo: 'bar'}); }); - $httpBackend.expect('GET', '/CreditCard').respond([{id: 1}]); - var ccs = CreditCard.query(); + it('should allow per action responseError interceptor that gets full response', function() { + var response; - ccs.$promise.then(callback); + $httpBackend.expect('GET', '/CreditCard').respond(404, {ignored: 'stuff'}, {foo: 'bar'}, 'Ack'); + CreditCard = $resource('/CreditCard', {}, { + get: { + method: 'get', + interceptor: {responseError: function(resp) { response = resp; }} + } + }); - $httpBackend.flush(); - expect(callback).toHaveBeenCalledOnce(); + var cc = CreditCard.get(); + $httpBackend.flush(); - var response = callback.calls.mostRecent().args[0]; - expect(response.resource).toBe(ccs); - expect(response.status).toBe(200); - expect(response.config).toBeDefined(); - }); + expect(response.resource).toBe(cc); + expect(response.config).toBeDefined(); + expect(response.status).toBe(404); + expect(response.statusText).toBe('Ack'); + expect(response.headers()).toEqual({foo: 'bar'}); + }); - it('should allow per action responseError interceptor that gets full response', function() { - CreditCard = $resource('/CreditCard', {}, { - query: { - method: 'get', - isArray: true, - interceptor: { - responseError: function(response) { - return response; + it('should fulfill the promise with the value returned by the response interceptor', + function() { + $httpBackend.whenGET('/CreditCard').respond(200); + CreditCard = $resource('/CreditCard', {}, { + test1: { + method: 'get', + interceptor: {response: function() { return 'foo'; }} + }, + test2: { + method: 'get', + interceptor: {response: function() { return $q.resolve('bar'); }} + }, + test3: { + method: 'get', + interceptor: {response: function() { return $q.reject('baz'); }} } - } + }); + + CreditCard.test1().$promise.then(callback); + $httpBackend.flush(); + expect(callback).toHaveBeenCalledOnceWith('foo'); + + callback.calls.reset(); + + CreditCard.test2().$promise.then(callback); + $httpBackend.flush(); + expect(callback).toHaveBeenCalledOnceWith('bar'); + + callback.calls.reset(); + + CreditCard.test3().$promise.then(null, callback); + $httpBackend.flush(); + expect(callback).toHaveBeenCalledOnceWith('baz'); } - }); + ); - $httpBackend.expect('GET', '/CreditCard').respond(404); - var ccs = CreditCard.query(); + it('should fulfill the promise with the value returned by the responseError interceptor', + function() { + $httpBackend.whenGET('/CreditCard').respond(404); + CreditCard = $resource('/CreditCard', {}, { + test1: { + method: 'get', + interceptor: {responseError: function() { return 'foo'; }} + }, + test2: { + method: 'get', + interceptor: {responseError: function() { return $q.resolve('bar'); }} + }, + test3: { + method: 'get', + interceptor: {responseError: function() { return $q.reject('baz'); }} + } + }); - ccs.$promise.then(callback); + CreditCard.test1().$promise.then(callback); + $httpBackend.flush(); + expect(callback).toHaveBeenCalledOnceWith('foo'); - $httpBackend.flush(); - expect(callback).toHaveBeenCalledOnce(); + callback.calls.reset(); - var response = callback.calls.mostRecent().args[0]; - expect(response.resource).toBe(ccs); - expect(response.status).toBe(404); - expect(response.config).toBeDefined(); - }); + CreditCard.test2().$promise.then(callback); + $httpBackend.flush(); + expect(callback).toHaveBeenCalledOnceWith('bar'); + callback.calls.reset(); + + CreditCard.test3().$promise.then(null, callback); + $httpBackend.flush(); + expect(callback).toHaveBeenCalledOnceWith('baz'); + } + ); - it('should fulfill the promise with the value returned by the responseError interceptor', - inject(function($q) { + + it('should call the success callback when response interceptor succeeds', function() { + $httpBackend.whenGET('/CreditCard').respond(200); CreditCard = $resource('/CreditCard', {}, { test1: { - method: 'GET', - interceptor: {responseError: function() { return 'foo'; }} + method: 'get', + interceptor: {response: function() { return 'foo'; }} }, test2: { - method: 'GET', - interceptor: {responseError: function() { return $q.resolve('bar'); }} - }, - test3: { - method: 'GET', - interceptor: {responseError: function() { return $q.reject('baz'); }} + method: 'get', + interceptor: {response: function() { return $q.resolve('bar'); }} } }); - $httpBackend.whenGET('/CreditCard').respond(404); + CreditCard.test1(callback); + $httpBackend.flush(); + expect(callback).toHaveBeenCalledOnceWith('foo', jasmine.any(Function), 200, ''); callback.calls.reset(); - CreditCard.test1().$promise.then(callback); + + CreditCard.test2(callback); $httpBackend.flush(); + expect(callback).toHaveBeenCalledOnceWith('bar', jasmine.any(Function), 200, ''); + }); + + + it('should call the error callback when response interceptor fails', function() { + $httpBackend.whenGET('/CreditCard').respond(200); + CreditCard = $resource('/CreditCard', {}, { + test1: { + method: 'get', + interceptor: {response: function() { throw 'foo'; }} + }, + test2: { + method: 'get', + interceptor: {response: function() { return $q.reject('bar'); }} + } + }); + CreditCard.test1(noop, callback); + $httpBackend.flush(); expect(callback).toHaveBeenCalledOnceWith('foo'); callback.calls.reset(); - CreditCard.test2().$promise.then(callback); - $httpBackend.flush(); + CreditCard.test2(noop, callback); + $httpBackend.flush(); expect(callback).toHaveBeenCalledOnceWith('bar'); + }); + + + it('should call the success callback when responseError interceptor succeeds', function() { + $httpBackend.whenGET('/CreditCard').respond(404); + CreditCard = $resource('/CreditCard', {}, { + test1: { + method: 'get', + interceptor: {responseError: function() { return 'foo'; }} + }, + test2: { + method: 'get', + interceptor: {responseError: function() { return $q.resolve('bar'); }} + } + }); + + CreditCard.test1(callback); + $httpBackend.flush(); + expect(callback).toHaveBeenCalledOnceWith('foo', jasmine.any(Function), 404, ''); callback.calls.reset(); - CreditCard.test3().$promise.then(null, callback); + + CreditCard.test2(callback); $httpBackend.flush(); + expect(callback).toHaveBeenCalledOnceWith('bar', jasmine.any(Function), 404, ''); + }); + - expect(callback).toHaveBeenCalledOnceWith('baz'); - }) - ); + it('should call the error callback when responseError interceptor fails', function() { + $httpBackend.whenGET('/CreditCard').respond(404); + CreditCard = $resource('/CreditCard', {}, { + test1: { + method: 'get', + interceptor: {responseError: function() { throw 'foo'; }} + }, + test2: { + method: 'get', + interceptor: {responseError: function() { return $q.reject('bar'); }} + } + }); + + CreditCard.test1(noop, callback); + $httpBackend.flush(); + expect(callback).toHaveBeenCalledOnceWith('foo'); + + callback.calls.reset(); + + CreditCard.test2(noop, callback); + $httpBackend.flush(); + expect(callback).toHaveBeenCalledOnceWith('bar'); + }); + }); }); @@ -1810,7 +1933,7 @@ describe('extra params', function() { }); describe('errors', function() { - var $httpBackend, $resource, $q, $rootScope; + var $httpBackend, $resource; beforeEach(module(function($exceptionHandlerProvider) { $exceptionHandlerProvider.mode('log'); @@ -1821,8 +1944,6 @@ describe('errors', function() { beforeEach(inject(function($injector) { $httpBackend = $injector.get('$httpBackend'); $resource = $injector.get('$resource'); - $q = $injector.get('$q'); - $rootScope = $injector.get('$rootScope'); })); @@ -1961,7 +2082,7 @@ describe('handling rejections', function() { function() { $httpBackend.expectGET('/CreditCard/123').respond(null); var CreditCard = $resource('/CreditCard/:id'); - var cc = CreditCard.get({id: 123}, + CreditCard.get({id: 123}, function(res) { throw new Error('should be caught'); }, function() {}); @@ -1976,7 +2097,7 @@ describe('handling rejections', function() { function() { $httpBackend.expectGET('/CreditCard/123').respond(null); var CreditCard = $resource('/CreditCard/:id'); - var cc = CreditCard.get({id: 123}, + CreditCard.get({id: 123}, function(res) { throw new Error('should be caught'); }); $httpBackend.flush(); @@ -1996,7 +2117,7 @@ describe('handling rejections', function() { } }); - var cc = CreditCard.get({id: 123}, + CreditCard.get({id: 123}, function(res) { throw new Error('should be caught'); }, function() {}); @@ -2017,7 +2138,7 @@ describe('handling rejections', function() { } }); - var cc = CreditCard.get({id: 123}, + CreditCard.get({id: 123}, function(res) { throw new Error('should be caught'); }); $httpBackend.flush(); @@ -2026,6 +2147,41 @@ describe('handling rejections', function() { } ); + + it('should not propagate exceptions in success callback to the returned promise', function() { + var successCallbackSpy = jasmine.createSpy('successCallback').and.throwError('error'); + var promiseResolveSpy = jasmine.createSpy('promiseResolve'); + var promiseRejectSpy = jasmine.createSpy('promiseReject'); + + $httpBackend.expectGET('/CreditCard/123').respond(null); + var CreditCard = $resource('/CreditCard/:id'); + CreditCard.get({id: 123}, successCallbackSpy). + $promise.then(promiseResolveSpy, promiseRejectSpy); + + $httpBackend.flush(); + expect(successCallbackSpy).toHaveBeenCalled(); + expect(promiseResolveSpy).toHaveBeenCalledWith(jasmine.any(CreditCard)); + expect(promiseRejectSpy).not.toHaveBeenCalled(); + }); + + + it('should not be able to recover from inside the error callback', function() { + var errorCallbackSpy = jasmine.createSpy('errorCallback').and.returnValue({id: 123}); + var promiseResolveSpy = jasmine.createSpy('promiseResolve'); + var promiseRejectSpy = jasmine.createSpy('promiseReject'); + + $httpBackend.expectGET('/CreditCard/123').respond(404); + var CreditCard = $resource('/CreditCard/:id'); + CreditCard.get({id: 123}, noop, errorCallbackSpy). + $promise.then(promiseResolveSpy, promiseRejectSpy); + + $httpBackend.flush(); + expect(errorCallbackSpy).toHaveBeenCalled(); + expect(promiseResolveSpy).not.toHaveBeenCalled(); + expect(promiseRejectSpy).toHaveBeenCalledWith(jasmine.objectContaining({status: 404})); + }); + + describe('requestInterceptor', function() { var rejectReason = {'lol':'cat'}; var $q, $rootScope; From 33b251d55e48da867cb2998e6d87ef33c3fec416 Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Wed, 21 Feb 2018 08:33:28 +0000 Subject: [PATCH 398/745] docs(misc): add version-support-status page (#16460) Closes #16058 Closes #16458 --- README.md | 9 +++- docs/app/assets/css/docs.css | 8 +++ docs/content/api/index.ngdoc | 10 +++- .../content/misc/version-support-status.ngdoc | 54 +++++++++++++++++++ 4 files changed, 79 insertions(+), 2 deletions(-) create mode 100644 docs/content/misc/version-support-status.ngdoc diff --git a/README.md b/README.md index ae444e3ccdb8..c2d1a9db2981 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,14 @@ It also helps with server-side communication, taming async callbacks with promis and it makes client-side navigation and deep linking with hashbang urls or HTML5 pushState a piece of cake. Best of all? It makes development fun! +-------------------- + +##### AngularJS will be moving to Long Term Support (LTS) mode on July 1st 2018: [Find out more](misc/version-support-status) + +##### Looking for the new Angular? Go here: https://github.com/angular/angular + +-------------------- + * Web site: https://angularjs.org * Tutorial: https://docs.angularjs.org/tutorial * API Docs: https://docs.angularjs.org/api @@ -20,7 +28,6 @@ piece of cake. Best of all? It makes development fun! * Core Development: [DEVELOPERS.md](DEVELOPERS.md) * Dashboard: https://dashboard.angularjs.org -##### Looking for the new Angular? Go here: https://github.com/angular/angular Documentation -------------------- diff --git a/docs/app/assets/css/docs.css b/docs/app/assets/css/docs.css index 54d81ada753d..65abc5247f0c 100644 --- a/docs/app/assets/css/docs.css +++ b/docs/app/assets/css/docs.css @@ -934,6 +934,14 @@ toc-container > div > toc-tree > ul > li > toc-tree > ul > li toc-tree > ul li { font-size: 13px; } +.dev-status span { + padding: 2px 8px; + border-radius: 5px; +} +.security span { background-color: orange; } +.stable span { background-color: green; color: white; } +.current span { background-color: blue; color: white; } + @media handheld and (max-width:800px), screen and (max-device-width:800px), screen and (max-width:800px) { .navbar { min-height: auto; diff --git a/docs/content/api/index.ngdoc b/docs/content/api/index.ngdoc index 8b954a86bd05..d34ddfb64c1d 100644 --- a/docs/content/api/index.ngdoc +++ b/docs/content/api/index.ngdoc @@ -3,7 +3,15 @@ @description # AngularJS API Docs -Welcome to the AngularJS API docs page. These pages contain the AngularJS reference materials for version . + +
        +**AngularJS will be moving to Long Term Support (LTS) mode on July 1st 2018.**: [Find out more](misc/version-support-status). +
        + +## Welcome to the AngularJS API docs page. + +These pages contain the AngularJS reference materials for version . + The documentation is organized into **{@link guide/module modules}** which contain various components of an AngularJS application. These components are {@link guide/directive directives}, {@link guide/services services}, {@link guide/filter filters}, {@link guide/providers providers}, {@link guide/templates templates}, global APIs, and testing mocks. diff --git a/docs/content/misc/version-support-status.ngdoc b/docs/content/misc/version-support-status.ngdoc new file mode 100644 index 000000000000..aff4309393dd --- /dev/null +++ b/docs/content/misc/version-support-status.ngdoc @@ -0,0 +1,54 @@ +@ngdoc overview +@name Version Support Status +@description + +# Version Support Status + +This page describes the support status of the significant versions of AngularJS. + +
        + AngularJS is planning one more significant release, version 1.7, and on July 1, 2018 it will enter a 3 year Long Term Support period. +
        + +### Until July 1st 2018 + +Any version branch not shown in the following table (e.g. 1.5.x) is no longer being developed. + + + + + + + + + + +
        VersionStatusComments
        1.2.xSecurity patches onlyLast version to provide IE 8 support
        1.6.xPatch ReleasesMinor features, bug fixes, security patches - no breaking changes
        1.7.xActive Development1.7.0 (not yet released) will be the last release of AngularJS to contain breaking changes
        + +### After July 1st 2018 + +Any version branch not shown in the following table (e.g. 1.6.x) is no longer being developed. + + + + + + + + + +
        VersionStatusComments
        1.2.xLong Term SupportLast version to provide IE 8 support
        1.7.xLong Term SupportSee [Long Term Support](#long-term-support) section below.
        + +### Long Term Support + +On July 1st 2018, we will enter a Long Term Support period for AngularJS. + +At this time we will focus exclusively on providing fixes to bugs that satisfy at least one of the following criteria: + +* A security flaw is detected in the 1.7.x branch of the framework +* One of the major browsers releases a version that will cause current production applications using AngularJS 1.7.x to stop working +* The jQuery library releases a version that will cause current production applications using AngularJS 1.7.x to stop working. + +### Blog Post + +You can read more about these plans in our [blog post announcement](https://blog.angular.io/stable-angularjs-and-long-term-support-7e077635ee9c). \ No newline at end of file From c0adcc3a4b561260d0f1ff6b834ca940bf1971a9 Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Tue, 20 Feb 2018 18:23:07 +0200 Subject: [PATCH 399/745] refactor($compile): avoid catastrophic backtracking when parsing bindings This isn't expected to have any actual impact, since AngularJS is only intended to be used in the browser (not the server) and for this RegExp to be exploited by malicious user code the developer would have to have to give the user rights to execute arbitrary JavaScript code anyway. Fixing as a general good practice and to avoid encouraging use of a similar RegExp in other environments where it might actually matter. Closes #16464 --- src/ng/compile.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ng/compile.js b/src/ng/compile.js index 6ae2722a6fde..603d94ed9522 100644 --- a/src/ng/compile.js +++ b/src/ng/compile.js @@ -1014,11 +1014,13 @@ function $CompileProvider($provide, $$sanitizeUriProvider) { var bindingCache = createMap(); function parseIsolateBindings(scope, directiveName, isController) { - var LOCAL_REGEXP = /^\s*([@&<]|=(\*?))(\??)\s*([\w$]*)\s*$/; + var LOCAL_REGEXP = /^([@&<]|=(\*?))(\??)\s*([\w$]*)$/; var bindings = createMap(); forEach(scope, function(definition, scopeName) { + definition = definition.trim(); + if (definition in bindingCache) { bindings[scopeName] = bindingCache[definition]; return; From 719e66b38bd75a66b01df5b4cd90bbbac2bc069d Mon Sep 17 00:00:00 2001 From: Frederik Prijck Date: Mon, 26 Feb 2018 15:00:42 +0100 Subject: [PATCH 400/745] docs(README): fix incorrect version-support-status link (#16473) Closes #16472 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c2d1a9db2981..7ec7c6b466fd 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ piece of cake. Best of all? It makes development fun! -------------------- -##### AngularJS will be moving to Long Term Support (LTS) mode on July 1st 2018: [Find out more](misc/version-support-status) +##### AngularJS will be moving to Long Term Support (LTS) mode on July 1st 2018: [Find out more](https://docs.angularjs.org/misc/version-support-status) ##### Looking for the new Angular? Go here: https://github.com/angular/angular From 290a5f23395eeb669aff3f7957300833e46646d8 Mon Sep 17 00:00:00 2001 From: Martin Staffa Date: Tue, 27 Feb 2018 17:33:42 +0100 Subject: [PATCH 401/745] docs(tutorial): fix headlines --- docs/content/tutorial/step_00.ngdoc | 5 ++--- docs/content/tutorial/step_01.ngdoc | 5 ++--- docs/content/tutorial/step_02.ngdoc | 11 +++++------ docs/content/tutorial/step_03.ngdoc | 9 ++++----- docs/content/tutorial/step_04.ngdoc | 4 ++-- docs/content/tutorial/step_05.ngdoc | 8 ++++---- docs/content/tutorial/step_06.ngdoc | 6 +++--- docs/content/tutorial/step_07.ngdoc | 6 +++--- docs/content/tutorial/step_08.ngdoc | 6 +++--- docs/content/tutorial/step_09.ngdoc | 6 +++--- docs/content/tutorial/step_10.ngdoc | 6 +++--- docs/content/tutorial/step_11.ngdoc | 6 +++--- docs/content/tutorial/step_12.ngdoc | 6 +++--- docs/content/tutorial/step_13.ngdoc | 2 +- docs/content/tutorial/step_14.ngdoc | 4 ++-- 15 files changed, 43 insertions(+), 47 deletions(-) diff --git a/docs/content/tutorial/step_00.ngdoc b/docs/content/tutorial/step_00.ngdoc index 36afe8862cf6..4aca8850cfe6 100644 --- a/docs/content/tutorial/step_00.ngdoc +++ b/docs/content/tutorial/step_00.ngdoc @@ -5,7 +5,6 @@
          - In this step of the tutorial, you will become familiar with the most important source code files of the AngularJS Phonecat App. You will also learn how to start the development servers bundled with [angular-seed][angular-seed], and run the application in the browser. @@ -167,7 +166,7 @@ For the purposes of this tutorial, we modified the angular-seed with the followi * Added a dependency on [Bootstrap](http://getbootstrap.com) in the `bower.json` file. -# Experiments +## Experiments
          @@ -178,7 +177,7 @@ For the purposes of this tutorial, we modified the angular-seed with the followi ``` -# Summary +## Summary Now let's go to {@link step_01 step 1} and add some content to the web app. diff --git a/docs/content/tutorial/step_01.ngdoc b/docs/content/tutorial/step_01.ngdoc index e5f104701fac..b134e69f455d 100644 --- a/docs/content/tutorial/step_01.ngdoc +++ b/docs/content/tutorial/step_01.ngdoc @@ -5,7 +5,6 @@
            - In order to illustrate how AngularJS enhances standard HTML, you will create a purely *static* HTML page and then examine how we can turn this HTML code into a template that AngularJS will use to dynamically display the same result with any set of data. @@ -37,7 +36,7 @@ In this step you will add some basic information about two cell phones to an HTM ``` -# Experiments +## Experiments
            @@ -48,7 +47,7 @@ In this step you will add some basic information about two cell phones to an HTM ``` -# Summary +## Summary This addition to your app uses static HTML to display the list. Now, let's go to {@link step_02 step 2} to learn how to use AngularJS to dynamically generate the same list. diff --git a/docs/content/tutorial/step_02.ngdoc b/docs/content/tutorial/step_02.ngdoc index ba2edc0b9085..6b4a54388b3c 100644 --- a/docs/content/tutorial/step_02.ngdoc +++ b/docs/content/tutorial/step_02.ngdoc @@ -5,7 +5,6 @@
              - Now, it's time to make the web page dynamic — with AngularJS. We will also add a test that verifies the code for the controller we are going to add. @@ -148,9 +147,9 @@ To learn more about AngularJS scopes, see the {@link ng.$rootScope.Scope Angular -# Testing +## Testing -## Testing Controllers +### Testing Controllers The "AngularJS way" of separating the controller from the view makes it easy to test code as it is being developed. In the section "Model and Controller" we have registered our controller via a constructor @@ -206,7 +205,7 @@ describe('PhoneListController', function() { -## Writing and Running Tests +### Writing and Running Tests Many AngularJS developers prefer the syntax of [Jasmine's Behavior-Driven Development (BDD) framework][jasmine-home], when writing tests. Although @@ -253,7 +252,7 @@ To run the tests, and then watch the files for changes execute: `npm test` -# Experiments +## Experiments
              @@ -308,7 +307,7 @@ To run the tests, and then watch the files for changes execute: `npm test` `toBe(4)`. -# Summary +## Summary We now have a dynamic application which separates models, views, and controllers, and we are testing as we go. Let's go to {@link step_03 step 3} to learn how to improve our application's architecture, diff --git a/docs/content/tutorial/step_03.ngdoc b/docs/content/tutorial/step_03.ngdoc index 92b8d990f587..e7a16de54bd0 100644 --- a/docs/content/tutorial/step_03.ngdoc +++ b/docs/content/tutorial/step_03.ngdoc @@ -5,7 +5,6 @@
                - In the previous step, we saw how a controller and a template worked together to convert a static HTML page into a dynamic view. This is a very common pattern in Single-Page Applications in general (and AngularJS applications in particular): @@ -197,7 +196,7 @@ Voilà! The resulting output should look the same, but let's see what we have ga -# Testing +## Testing Although we have combined our controller with a template into a component, we still can (and should) unit test the controller separately, since this is where our application logic and data reside. @@ -240,12 +239,12 @@ verifies that the phones array property on it contains three records. Note that the controller instance itself, not on a `scope`. -## Running Tests +### Running Tests Same as before, execute `npm test` to run the tests and then watch the files for changes. -# Experiments +## Experiments
                @@ -267,7 +266,7 @@ Same as before, execute `npm test` to run the tests and then watch the files for throughout the application, is a big win. -# Summary +## Summary You have learned how to organize your application and presentation logic into isolated, reusable components. Let's go to {@link step_04 step 4} to learn how to organize our code in directories and diff --git a/docs/content/tutorial/step_04.ngdoc b/docs/content/tutorial/step_04.ngdoc index 2865ad765866..e7546f721fac 100644 --- a/docs/content/tutorial/step_04.ngdoc +++ b/docs/content/tutorial/step_04.ngdoc @@ -265,7 +265,7 @@ After all the refactorings that took place, this is how our application looks fr ``` -# Testing +## Testing Since this was just a refactoring step (no actual code addition/deletions), we shouldn't need to change much (if anything) as far as our specs are concerned. @@ -301,7 +301,7 @@ pass. -# Summary +## Summary Even if we didn't add any new and exciting functionality to our application, we have made a great step towards a well-architected and maintainable application. Time to spice things up. Let's go to diff --git a/docs/content/tutorial/step_05.ngdoc b/docs/content/tutorial/step_05.ngdoc index adba95906fbb..e7a5ea519c7e 100644 --- a/docs/content/tutorial/step_05.ngdoc +++ b/docs/content/tutorial/step_05.ngdoc @@ -78,7 +78,7 @@ following: by the `filter` filter. The process is completely transparent to the developer. -# Testing +## Testing In previous steps, we learned how to write and run unit tests. Unit tests are perfect for testing controllers and other parts of our application written in JavaScript, but they can't easily @@ -124,7 +124,7 @@ easy it is to write E2E tests in AngularJS. Although this example is for a simpl that easy to set up any functional, readable, E2E test. -## Running E2E Tests with Protractor +### Running E2E Tests with Protractor Even though the syntax of this test looks very much like our controller unit test written with Jasmine, the E2E test uses APIs of [Protractor][protractor]. Read about the Protractor APIs in the @@ -142,7 +142,7 @@ To rerun the test suite, execute `npm run protractor` again. -# Experiments +## Experiments
                @@ -155,7 +155,7 @@ To rerun the test suite, execute `npm run protractor` again. Component isolation at work! -# Summary +## Summary We have now added full-text search and included a test to verify that it works! Now let's go on to {@link step_06 step 6} to learn how to add sorting capabilities to the PhoneCat application. diff --git a/docs/content/tutorial/step_06.ngdoc b/docs/content/tutorial/step_06.ngdoc index 7a19d2600444..adc4b610fbb4 100644 --- a/docs/content/tutorial/step_06.ngdoc +++ b/docs/content/tutorial/step_06.ngdoc @@ -124,7 +124,7 @@ will be reordered. That is the data-binding doing its job in the opposite direct the model. -# Testing +## Testing The changes we made should be verified with both a unit test and an E2E test. Let's look at the unit test first. @@ -217,7 +217,7 @@ The E2E test verifies that the ordering mechanism of the select box is working c You can now rerun `npm run protractor` to see the tests run. -# Experiments +## Experiments
                @@ -232,7 +232,7 @@ You can now rerun `npm run protractor` to see the tests run. `` -# Summary +## Summary Now that you have added list sorting and tested the application, go to {@link step_07 step 7} to learn about AngularJS services and how AngularJS uses dependency injection. diff --git a/docs/content/tutorial/step_07.ngdoc b/docs/content/tutorial/step_07.ngdoc index 7e801ffa822d..4b0d0e64aaaa 100644 --- a/docs/content/tutorial/step_07.ngdoc +++ b/docs/content/tutorial/step_07.ngdoc @@ -180,7 +180,7 @@ let's add the annotations to our `PhoneListController`: ``` -# Testing +## Testing Because we started using dependency injection and our controller has dependencies, constructing the controller in our tests is a bit more complicated. We could use the `new` operator and provide the @@ -283,7 +283,7 @@ Chrome 49.0: Executed 2 of 2 SUCCESS (0.133 secs / 0.097 secs) ``` -# Experiments +## Experiments
                @@ -299,7 +299,7 @@ Chrome 49.0: Executed 2 of 2 SUCCESS (0.133 secs / 0.097 secs) ``` -# Summary +## Summary Now that you have learned how easy it is to use AngularJS services (thanks to AngularJS's dependency injection), go to {@link step_08 step 8}, where you will add some thumbnail images of phones and diff --git a/docs/content/tutorial/step_08.ngdoc b/docs/content/tutorial/step_08.ngdoc index a55461d0cc21..5707ea4d9902 100644 --- a/docs/content/tutorial/step_08.ngdoc +++ b/docs/content/tutorial/step_08.ngdoc @@ -70,7 +70,7 @@ which it would have done if we had only specified an attribute binding in a regu HTTP request to an invalid location. -# Testing +## Testing
                **`e2e-tests/scenarios.js`**: @@ -95,7 +95,7 @@ views, that we will implement in the upcoming steps. You can now rerun `npm run protractor` to see the tests run. -# Experiments +## Experiments
                @@ -108,7 +108,7 @@ You can now rerun `npm run protractor` to see the tests run. inject the valid address. -# Summary +## Summary Now that you have added phone images and links, go to {@link step_09 step 9} to learn about AngularJS layout templates and how AngularJS makes it easy to create applications that have multiple views. diff --git a/docs/content/tutorial/step_09.ngdoc b/docs/content/tutorial/step_09.ngdoc index 99683ccfeb44..da1e92a7dfc6 100644 --- a/docs/content/tutorial/step_09.ngdoc +++ b/docs/content/tutorial/step_09.ngdoc @@ -334,7 +334,7 @@ The takeaway here is: -# Testing +## Testing Since some of our modules depend on {@link ngRoute ngRoute} now, it is necessary to update the Karma configuration file with angular-route. Other than that, the unit tests should (still) pass without @@ -398,7 +398,7 @@ various URLs and verifying that the correct view was rendered. You can now rerun `npm run protractor` to see the tests run (and hopefully pass). -# Experiments +## Experiments
                @@ -415,7 +415,7 @@ You can now rerun `npm run protractor` to see the tests run (and hopefully pass) component isolation at work! -# Summary +## Summary With the routing set up and the phone list view implemented, we are ready to go to {@link step_10 step 10} and implement a proper phone details view. diff --git a/docs/content/tutorial/step_10.ngdoc b/docs/content/tutorial/step_10.ngdoc index 537f3ded49bf..65069b74ff58 100644 --- a/docs/content/tutorial/step_10.ngdoc +++ b/docs/content/tutorial/step_10.ngdoc @@ -122,7 +122,7 @@ including lists and bindings that comprise the phone details. Note how we use th -# Testing +## Testing We wrote a new unit test that is similar to the one we wrote for the `phoneList` component's controller in {@link step_07#testing step 7}. @@ -194,7 +194,7 @@ heading on the page is "Nexus S". You can run the tests with `npm run protractor`. -# Experiments +## Experiments
                @@ -202,7 +202,7 @@ You can run the tests with `npm run protractor`. images on the 'Nexus S' details page. -# Summary +## Summary Now that the phone details view is in place, proceed to {@link step_11 step 11} to learn how to write your own custom display filter. diff --git a/docs/content/tutorial/step_11.ngdoc b/docs/content/tutorial/step_11.ngdoc index d9ab2565d23e..6bc360cbb647 100644 --- a/docs/content/tutorial/step_11.ngdoc +++ b/docs/content/tutorial/step_11.ngdoc @@ -104,7 +104,7 @@ Let's employ the filter in the phone details template: ``` -# Testing +## Testing Filters, like any other code, should be tested. Luckily, these tests are very easy to write. @@ -146,7 +146,7 @@ Chrome 49.0: Executed 4 of 4 SUCCESS (0.091 secs / 0.075 secs) ``` -# Experiments +## Experiments
                @@ -167,7 +167,7 @@ Chrome 49.0: Executed 4 of 4 SUCCESS (0.091 secs / 0.075 secs) ``` -# Summary +## Summary Now that we have learned how to write and test a custom filter, let's go to {@link step_12 step 12} to learn how we can use AngularJS to enhance the phone details page further. diff --git a/docs/content/tutorial/step_12.ngdoc b/docs/content/tutorial/step_12.ngdoc index e16bdaa5bb2d..b9d4e0850c57 100644 --- a/docs/content/tutorial/step_12.ngdoc +++ b/docs/content/tutorial/step_12.ngdoc @@ -73,7 +73,7 @@ thumbnail image. -# Testing +## Testing To verify this new feature, we added two E2E tests. One verifies that `mainImageUrl` is set to the first phone image URL by default. The second test clicks on several thumbnail images and verifies @@ -151,7 +151,7 @@ property to the controller. As previously, we will use a mocked response. Our unit tests should now be passing again. -# Experiments +## Experiments
                @@ -176,7 +176,7 @@ Our unit tests should now be passing again. Now, whenever you double-click on a thumbnail, an alert pops-up. Pretty annoying! -# Summary +## Summary With the phone image swapper in place, we are ready for {@link step_13 step 13} to learn an even better way to fetch data. diff --git a/docs/content/tutorial/step_13.ngdoc b/docs/content/tutorial/step_13.ngdoc index f96ccd5c1913..2ad46e2c9459 100644 --- a/docs/content/tutorial/step_13.ngdoc +++ b/docs/content/tutorial/step_13.ngdoc @@ -310,7 +310,7 @@ Chrome 49.0: Executed 5 of 5 SUCCESS (0.123 secs / 0.104 secs) ``` -# Summary +## Summary Now that we have seen how to build a custom service as a RESTful client, we are ready for {@link step_14 step 14} to learn how to enhance the user experience with animations. diff --git a/docs/content/tutorial/step_14.ngdoc b/docs/content/tutorial/step_14.ngdoc index b1b5ff043f58..40667717ebee 100644 --- a/docs/content/tutorial/step_14.ngdoc +++ b/docs/content/tutorial/step_14.ngdoc @@ -503,7 +503,7 @@ element). A boolean parameter (`wasCanceled`) is passed to the function, letting if the animation was canceled or not. Use this function to do any necessary clean-up. -# Experiments +## Experiments
                @@ -544,7 +544,7 @@ if the animation was canceled or not. Use this function to do any necessary clea * Go crazy and come up with your own funky animations! -# Summary +## Summary Our application is now much more pleasant to use, thanks to the smooth transitions between pages and UI states. From 77917e34c93668e9936768bed681696d78028748 Mon Sep 17 00:00:00 2001 From: Martin Staffa Date: Sun, 18 Feb 2018 20:32:04 +0100 Subject: [PATCH 402/745] chore(docs.angularjs.org): allow crawling of examples, don't deploy e2e test files --- Gruntfile.js | 2 +- docs/app/assets/robots.txt | 13 ++----------- scripts/docs.angularjs.org-firebase/firebase.json | 9 ++++++++- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index ba5efa0d8f09..70fd9d8a8236 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -341,7 +341,7 @@ module.exports = function(grunt) { }, { cwd: 'build/docs', - src: '**', + src: ['**', '!ptore2e/**'], dest: 'deploy/docs/', expand: true }, diff --git a/docs/app/assets/robots.txt b/docs/app/assets/robots.txt index 36b7daeca859..898272b08202 100644 --- a/docs/app/assets/robots.txt +++ b/docs/app/assets/robots.txt @@ -1,13 +1,4 @@ User-agent: * -Disallow: /examples/ -Disallow: /ptore2e/ -Disallow: /Error404.html - -# The js / map files in the root are used by the embedded examples, not by the app itself -Disallow: /*.js$ -Disallow: /*.map$ - -# (Javascript) crawlers need to access JS files -Allow: /components/*.js -Allow: /js/*.js +# The map files are not required by the app +Disallow: /*.map$ \ No newline at end of file diff --git a/scripts/docs.angularjs.org-firebase/firebase.json b/scripts/docs.angularjs.org-firebase/firebase.json index 9e112f2ff9ee..a83409ed7155 100644 --- a/scripts/docs.angularjs.org-firebase/firebase.json +++ b/scripts/docs.angularjs.org-firebase/firebase.json @@ -29,7 +29,14 @@ ], "headers": [ { - "source": "/partials/**", + "source": "/Error404.html", + "headers" : [{ + "key" : "X-Robots-Tag", + "value" : "noindex" + }] + }, + { + "source": "/@(partials|examples)/**", "headers" : [{ "key" : "X-Robots-Tag", "value" : "noindex" From 02fb980de67fc9158920ec4ab0969d544ac96c1a Mon Sep 17 00:00:00 2001 From: Martin Staffa Date: Sun, 18 Feb 2018 20:35:55 +0100 Subject: [PATCH 403/745] chore(docs.angularjs.org): only deploy production index.html as entry file Previously, we rewrote index.html to index-production.html, but Firebase ignored this, probably because an exact file match always takes priority. This lead to the problem thatthe root - angularjs.org - didn't include the angular.js source files from the CDN --- Gruntfile.js | 12 +++++++----- scripts/docs.angularjs.org-firebase/firebase.json | 13 ------------- .../docs.angularjs.org-firebase/functions/index.js | 2 +- 3 files changed, 8 insertions(+), 19 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 70fd9d8a8236..bb3eb9508ee4 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -341,15 +341,17 @@ module.exports = function(grunt) { }, { cwd: 'build/docs', - src: ['**', '!ptore2e/**'], + src: ['**', '!ptore2e/**', '!index*.html'], dest: 'deploy/docs/', expand: true }, { - src: ['build/docs/index-production.html'], - dest: docsScriptFolder + '/functions/content', - expand: true, - flatten: true + src: 'build/docs/index-production.html', + dest: 'deploy/docs/index.html' + }, + { + src: 'build/docs/index-production.html', + dest: docsScriptFolder + '/functions/content/index.html' }, { cwd: 'build/docs', diff --git a/scripts/docs.angularjs.org-firebase/firebase.json b/scripts/docs.angularjs.org-firebase/firebase.json index a83409ed7155..0e018010b061 100644 --- a/scripts/docs.angularjs.org-firebase/firebase.json +++ b/scripts/docs.angularjs.org-firebase/firebase.json @@ -1,11 +1,6 @@ { "hosting": { "public": "../../deploy/docs", - "ignore": [ - "/index.html", - "/index-debug.html", - "/index-jquery.html" - ], "redirects": [ { "source": "/error/:namespace\\::error*", @@ -14,14 +9,6 @@ } ], "rewrites": [ - { - "source": "/", - "destination": "/index-production.html" - }, - { - "source": "/index.html", - "destination": "/index-production.html" - }, { "source": "**/*!(.@(jpg|jpeg|gif|png|html|js|map|json|css|svg|ttf|txt|woff|woff2|eot|xml))", "function": "sendFile" diff --git a/scripts/docs.angularjs.org-firebase/functions/index.js b/scripts/docs.angularjs.org-firebase/functions/index.js index b86eb32f642a..eace519a45ad 100644 --- a/scripts/docs.angularjs.org-firebase/functions/index.js +++ b/scripts/docs.angularjs.org-firebase/functions/index.js @@ -25,7 +25,7 @@ const buildSnapshot = data => ` function sendFile(request, response) { const snapshotRequested = typeof request.query._escaped_fragment_ !== 'undefined'; - const filePath = `content/${snapshotRequested ? `partials${request.path}` : 'index-production'}.html`; + const filePath = `content/${snapshotRequested ? `partials${request.path}` : 'index'}.html`; if (snapshotRequested) { fs.readFile(filePath, {encoding: 'utf8'}, (error, data) => { From a37f89f8646df3ea64aee32e63055b9722236753 Mon Sep 17 00:00:00 2001 From: Martin Staffa Date: Tue, 20 Feb 2018 17:59:45 +0100 Subject: [PATCH 404/745] chore(docs-app): add dynamic 404 behavior Adapted from https://github.com/angular/angular/commit/88045a50506adfe32c2f7a213c8e95f46d1e40e1, https://github.com/angular/angular/commit/c3fb820473d64036ef0dd3d4c004cc7fbc67be75, and https://github.com/angular/angular/commit/5a624fa1be530a1b3479a4cc7f96e5a20a3d64fb. --- docs/app/e2e/.eslintrc.json | 1 + docs/app/e2e/app.scenario.js | 63 +++++++++++++++++++ docs/app/src/docs.js | 16 +++-- docs/config/index.js | 5 +- docs/config/services/deployments/test.js | 40 ++++++++++++ .../templates/app/indexPage.template.html | 21 +++++-- 6 files changed, 136 insertions(+), 10 deletions(-) create mode 100644 docs/config/services/deployments/test.js diff --git a/docs/app/e2e/.eslintrc.json b/docs/app/e2e/.eslintrc.json index 6a949b92ffc9..60c814cc9339 100644 --- a/docs/app/e2e/.eslintrc.json +++ b/docs/app/e2e/.eslintrc.json @@ -9,6 +9,7 @@ }, "globals": { + "angular": false, /* testabilityPatch / matchers */ "inject": false, "module": false, diff --git a/docs/app/e2e/app.scenario.js b/docs/app/e2e/app.scenario.js index 1333870eff4d..a78667962ab9 100644 --- a/docs/app/e2e/app.scenario.js +++ b/docs/app/e2e/app.scenario.js @@ -21,6 +21,9 @@ describe('docs.angularjs.org', function() { console.log('browser console errors: ' + require('util').inspect(filteredLog)); } }); + + browser.ignoreSynchronization = false; + browser.clearMockModules(); }); @@ -102,6 +105,66 @@ describe('docs.angularjs.org', function() { expect(mainHeader.getText()).toEqual('Oops!'); }); + it('should set "noindex" if the page does not exist', function() { + browser.get('build/docs/index-production.html#!/api/does/not/exist'); + var robots = element(by.css('meta[name="robots"][content="noindex"]')); + var googleBot = element(by.css('meta[name="googlebot"][content="noindex"]')); + expect(robots.isPresent()).toBe(true); + expect(googleBot.isPresent()).toBe(true); + }); + + it('should remove "noindex" if the page exists', function() { + browser.get('build/docs/index-production.html#!/api'); + var robots = element(by.css('meta[name="robots"][content="noindex"]')); + var googleBot = element(by.css('meta[name="googlebot"][content="noindex"]')); + expect(robots.isPresent()).toBe(false); + expect(googleBot.isPresent()).toBe(false); + }); + + describe('template request error', function() { + beforeEach(function() { + browser.addMockModule('httpMocker', function() { + angular.module('httpMocker', ['ngMock']) + .run(['$httpBackend', function($httpBackend) { + $httpBackend.whenGET('localhost:8000/build/docs/partials/api.html').respond(500, ''); + }]); + }); + }); + + it('should set "noindex" for robots if the request fails', function() { + // index-test includes ngMock + browser.get('build/docs/index-test.html#!/api'); + var robots = element(by.css('meta[name="robots"][content="noindex"]')); + var googleBot = element(by.css('meta[name="googlebot"][content="noindex"]')); + expect(robots.isPresent()).toBe(true); + expect(googleBot.isPresent()).toBe(true); + }); + }); + + + describe('page bootstrap error', function() { + beforeEach(function() { + browser.addMockModule('httpMocker', function() { + // Require a module that does not exist to break the bootstrapping + angular.module('httpMocker', ['doesNotExist']); + }); + }); + + it('should have "noindex" for robots if bootstrapping fails', function() { + browser.get('build/docs/index.html#!/api').catch(function() { + // get() will fail on AngularJS bootstrap, but if we continue here, protractor + // will assume the app is ready + browser.ignoreSynchronization = true; + var robots = element(by.css('meta[name="robots"][content="noindex"]')); + var googleBot = element(by.css('meta[name="googlebot"][content="noindex"]')); + expect(robots.isPresent()).toBe(true); + expect(googleBot.isPresent()).toBe(true); + }); + }); + + + }); + }); }); diff --git a/docs/app/src/docs.js b/docs/app/src/docs.js index 33b1be384beb..b6e6e49a2aa8 100644 --- a/docs/app/src/docs.js +++ b/docs/app/src/docs.js @@ -8,6 +8,8 @@ angular.module('DocsController', ['currentVersionData']) function($scope, $rootScope, $location, $window, $cookies, NG_PAGES, NG_NAVIGATION, CURRENT_NG_VERSION) { + var errorPartialPath = 'Error404.html'; + $scope.navClass = function(navItem) { return { active: navItem.href && this.currentPage && this.currentPage.path, @@ -16,8 +18,6 @@ angular.module('DocsController', ['currentVersionData']) }; }; - - $scope.$on('$includeContentLoaded', function() { var pagePath = $scope.currentPage ? $scope.currentPage.path : $location.path(); $window._gaq.push(['_trackPageview', pagePath]); @@ -26,6 +26,7 @@ angular.module('DocsController', ['currentVersionData']) $scope.$on('$includeContentError', function() { $scope.loading = false; + $scope.loadingError = true; }); $scope.$watch(function docsPathWatch() {return $location.path(); }, function docsPathWatchAction(path) { @@ -35,6 +36,7 @@ angular.module('DocsController', ['currentVersionData']) var currentPage = $scope.currentPage = NG_PAGES[path]; $scope.loading = true; + $scope.loadingError = false; if (currentPage) { $scope.partialPath = 'partials/' + path + '.html'; @@ -50,18 +52,22 @@ angular.module('DocsController', ['currentVersionData']) } else { $scope.currentArea = NG_NAVIGATION['api']; $scope.breadcrumb = []; - $scope.partialPath = 'Error404.html'; + $scope.partialPath = errorPartialPath; } }); + $scope.hasError = function() { + return $scope.partialPath === errorPartialPath || $scope.loadingError; + }; + /********************************** Initialize ***********************************/ $scope.versionNumber = CURRENT_NG_VERSION.full; $scope.version = CURRENT_NG_VERSION.full + ' ' + CURRENT_NG_VERSION.codeName; - $scope.loading = 0; - + $scope.loading = false; + $scope.loadingError = false; var INDEX_PATH = /^(\/|\/index[^.]*.html)$/; if (!$location.path() || INDEX_PATH.test($location.path())) { diff --git a/docs/config/index.js b/docs/config/index.js index 4ddf7922c7bd..12777f6a8f5e 100644 --- a/docs/config/index.js +++ b/docs/config/index.js @@ -22,6 +22,7 @@ module.exports = new Package('angularjs', [ .factory(require('./services/deployments/debug')) .factory(require('./services/deployments/default')) .factory(require('./services/deployments/jquery')) +.factory(require('./services/deployments/test')) .factory(require('./services/deployments/production')) .factory(require('./inline-tag-defs/type')) @@ -157,12 +158,14 @@ module.exports = new Package('angularjs', [ generateProtractorTestsProcessor, generateExamplesProcessor, debugDeployment, defaultDeployment, - jqueryDeployment, productionDeployment) { + jqueryDeployment, testDeployment, + productionDeployment) { generateIndexPagesProcessor.deployments = [ debugDeployment, defaultDeployment, jqueryDeployment, + testDeployment, productionDeployment ]; diff --git a/docs/config/services/deployments/test.js b/docs/config/services/deployments/test.js new file mode 100644 index 000000000000..ba0805b5079a --- /dev/null +++ b/docs/config/services/deployments/test.js @@ -0,0 +1,40 @@ +'use strict'; + +module.exports = function testDeployment(getVersion) { + return { + name: 'test', + examples: { + commonFiles: { + scripts: ['../../../angular.js'] + }, + dependencyPath: '../../../' + }, + scripts: [ + '../angular.js', + '../angular-resource.js', + '../angular-route.js', + '../angular-cookies.js', + '../angular-mocks.js', + '../angular-sanitize.js', + '../angular-touch.js', + '../angular-animate.js', + 'components/marked-' + getVersion('marked') + '/lib/marked.js', + 'js/angular-bootstrap/dropdown-toggle.js', + 'components/lunr-' + getVersion('lunr') + '/lunr.js', + 'components/google-code-prettify-' + getVersion('google-code-prettify') + '/src/prettify.js', + 'components/google-code-prettify-' + getVersion('google-code-prettify') + '/src/lang-css.js', + 'js/current-version-data.js', + 'js/all-versions-data.js', + 'js/pages-data.js', + 'js/nav-data.js', + 'js/docs.js' + ], + stylesheets: [ + 'components/bootstrap-' + getVersion('bootstrap') + '/css/bootstrap.css', + 'css/prettify-theme.css', + 'css/angular-topnav.css', + 'css/docs.css', + 'css/animations.css' + ] + }; +}; diff --git a/docs/config/templates/app/indexPage.template.html b/docs/config/templates/app/indexPage.template.html index 44ef6ebd7b1a..eb5c6614a2bc 100644 --- a/docs/config/templates/app/indexPage.template.html +++ b/docs/config/templates/app/indexPage.template.html @@ -11,6 +11,18 @@ AngularJS + - * - *
                - *
                - *
                - * Current time is: - *
                - * Blood 1 : {{blood_1}} - * Blood 2 : {{blood_2}} - * - * - * - *
                - *
                - * - * - * - */ + /** + * @ngdoc service + * @name $interval + * + * @description + * AngularJS's wrapper for `window.setInterval`. The `fn` function is executed every `delay` + * milliseconds. + * + * The return value of registering an interval function is a promise. This promise will be + * notified upon each tick of the interval, and will be resolved after `count` iterations, or + * run indefinitely if `count` is not defined. The value of the notification will be the + * number of iterations that have run. + * To cancel an interval, call `$interval.cancel(promise)`. + * + * In tests you can use {@link ngMock.$interval#flush `$interval.flush(millis)`} to + * move forward by `millis` milliseconds and trigger any functions scheduled to run in that + * time. + * + *
                + * **Note**: Intervals created by this service must be explicitly destroyed when you are finished + * with them. In particular they are not automatically destroyed when a controller's scope or a + * directive's element are destroyed. + * You should take this into consideration and make sure to always cancel the interval at the + * appropriate moment. See the example below for more details on how and when to do this. + *
                + * + * @param {function()} fn A function that should be called repeatedly. If no additional arguments + * are passed (see below), the function is called with the current iteration count. + * @param {number} delay Number of milliseconds between each function call. + * @param {number=} [count=0] Number of times to repeat. If not set, or 0, will repeat + * indefinitely. + * @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise + * will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block. + * @param {...*=} Pass additional parameters to the executed function. + * @returns {promise} A promise which will be notified on each iteration. It will resolve once all iterations of the interval complete. + * + * @example + * + * + * + * + *
                + *
                + *
                + * Current time is: + *
                + * Blood 1 : {{blood_1}} + * Blood 2 : {{blood_2}} + * + * + * + *
                + *
                + * + *
                + *
                + */ function interval(fn, delay, count, invokeApply) { var hasParams = arguments.length > 4, args = hasParams ? sliceArgs(arguments, 4) : [], @@ -177,16 +177,16 @@ function $IntervalProvider() { } - /** - * @ngdoc method - * @name $interval#cancel - * - * @description - * Cancels a task associated with the `promise`. - * - * @param {Promise=} promise returned by the `$interval` function. - * @returns {boolean} Returns `true` if the task was successfully canceled. - */ + /** + * @ngdoc method + * @name $interval#cancel + * + * @description + * Cancels a task associated with the `promise`. + * + * @param {Promise=} promise returned by the `$interval` function. + * @returns {boolean} Returns `true` if the task was successfully canceled. + */ interval.cancel = function(promise) { if (promise && promise.$$intervalId in intervals) { // Interval cancels should not report as unhandled promise. From 3365256502344970f86355d3ace1cb4251ae9828 Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Tue, 13 Mar 2018 19:52:58 +0200 Subject: [PATCH 412/745] fix($timeout): throw when trying to cancel non-$timeout promise Previously, calling `$timeout.cancel()` with a promise that was not generated by a call to `$timeout()` would do nothing. This could, for example, happen when calling `.then()`/`.catch()` on the returned promise, which creates a new promise, and passing that to `$timeout.cancel()`. With this commit, `$timeout.cancel()` will throw an error if called with a non-$timeout promise, thus surfacing errors that would otherwise go unnoticed. Fixes #16424 BREAKING CHNAGE: `$timeout.cancel()` will throw an error if called with a promise that was not generated by `$timeout()`. Previously, it would silently do nothing. Before: ```js var promise = $timeout(doSomething, 1000).then(doSomethingElse); $timeout.cancel(promise); // No error; timeout NOT canceled. ``` After: ```js var promise = $timeout(doSomething, 1000).then(doSomethingElse); $timeout.cancel(promise); // Throws error. ``` Correct usage: ```js var promise = $timeout(doSomething, 1000); var newPromise = promise.then(doSomethingElse); $timeout.cancel(promise); // Timeout canceled. ``` --- docs/content/error/$timeout/badprom.ngdoc | 25 ++++++++++++++++++++++ src/ng/timeout.js | 26 +++++++++++++++++------ test/ng/timeoutSpec.js | 8 ++++++- 3 files changed, 51 insertions(+), 8 deletions(-) create mode 100644 docs/content/error/$timeout/badprom.ngdoc diff --git a/docs/content/error/$timeout/badprom.ngdoc b/docs/content/error/$timeout/badprom.ngdoc new file mode 100644 index 000000000000..c1b0d025ad8f --- /dev/null +++ b/docs/content/error/$timeout/badprom.ngdoc @@ -0,0 +1,25 @@ +@ngdoc error +@name $timeout:badprom +@fullName Non-$timeout promise +@description + +This error occurs when calling {@link ng.$timeout#cancel $timeout.cancel()} with a promise that +was not generated by the {@link ng.$timeout $timeout} service. This can, for example, happen when +calling {@link ng.$q#the-promise-api then()/catch()} on the returned promise, which creates a new +promise, and pass that new promise to {@link ng.$timeout#cancel $timeout.cancel()}. + +Example of incorrect usage that leads to this error: + +```js +var promise = $timeout(doSomething, 1000).then(doSomethingElse); +$timeout.cancel(promise); +``` + +To fix the example above, keep a reference to the promise returned by +{@link ng.$timeout $timeout()} and pass that to {@link ng.$timeout#cancel $timeout.cancel()}: + +```js +var promise = $timeout(doSomething, 1000); +var newPromise = promise.then(doSomethingElse); +$timeout.cancel(promise); +``` diff --git a/src/ng/timeout.js b/src/ng/timeout.js index 71c06ce39ab0..1e4eaad3349f 100644 --- a/src/ng/timeout.js +++ b/src/ng/timeout.js @@ -1,5 +1,7 @@ 'use strict'; +var $timeoutMinErr = minErr('$timeout'); + /** @this */ function $TimeoutProvider() { this.$get = ['$rootScope', '$browser', '$q', '$$q', '$exceptionHandler', @@ -83,14 +85,24 @@ function $TimeoutProvider() { * canceled. */ timeout.cancel = function(promise) { - if (promise && promise.$$timeoutId in deferreds) { - // Timeout cancels should not report an unhandled promise. - markQExceptionHandled(deferreds[promise.$$timeoutId].promise); - deferreds[promise.$$timeoutId].reject('canceled'); - delete deferreds[promise.$$timeoutId]; - return $browser.defer.cancel(promise.$$timeoutId); + if (!promise) return false; + + if (!promise.hasOwnProperty('$$timeoutId')) { + throw $timeoutMinErr('badprom', + '`$timeout.cancel()` called with a promise that was not generated by `$timeout()`.'); } - return false; + + if (!deferreds.hasOwnProperty(promise.$$timeoutId)) return false; + + var id = promise.$$timeoutId; + var deferred = deferreds[id]; + + // Timeout cancels should not report an unhandled promise. + markQExceptionHandled(deferred.promise); + deferred.reject('canceled'); + delete deferreds[id]; + + return $browser.defer.cancel(id); }; return timeout; diff --git a/test/ng/timeoutSpec.js b/test/ng/timeoutSpec.js index 648c39663c0d..bfd5d53285e7 100644 --- a/test/ng/timeoutSpec.js +++ b/test/ng/timeoutSpec.js @@ -280,11 +280,17 @@ describe('$timeout', function() { })); - it('should not throw a runtime exception when given an undefined promise', inject(function($timeout) { + it('should not throw an error when given an undefined promise', inject(function($timeout) { expect($timeout.cancel()).toBe(false); })); + it('should throw an error when given a non-$timeout promise', inject(function($timeout) { + var promise = $timeout(noop).then(noop); + expect(function() { $timeout.cancel(promise); }).toThrowMinErr('$timeout', 'badprom'); + })); + + it('should forget references to relevant deferred', inject(function($timeout, $browser) { // $browser.defer.cancel is only called on cancel if the deferred object is still referenced var cancelSpy = spyOn($browser.defer, 'cancel').and.callThrough(); From a8bef95127775d83d80daa4617c33227c4b443d4 Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Tue, 13 Mar 2018 19:53:56 +0200 Subject: [PATCH 413/745] fix($interval): throw when trying to cancel non-$interval promise Previously, calling `$interval.cancel()` with a promise that was not generated by a call to `$interval()` would do nothing. This could, for example, happen when calling `.then()`/`.catch()` on the returned promise, which creates a new promise, and passing that to `$interval.cancel()`. With this commit, `$interval.cancel()` will throw an error if called with a non-$interval promise, thus surfacing errors that would otherwise go unnoticed. Related to #16424. BREAKING CHNAGE: `$interval.cancel()` will throw an error if called with a promise that was not generated by `$interval()`. Previously, it would silently do nothing. Before: ```js var promise = $interval(doSomething, 1000, 5).then(doSomethingElse); $interval.cancel(promise); // No error; interval NOT canceled. ``` After: ```js var promise = $interval(doSomething, 1000, 5).then(doSomethingElse); $interval.cancel(promise); // Throws error. ``` Correct usage: ```js var promise = $interval(doSomething, 1000, 5); var newPromise = promise.then(doSomethingElse); $interval.cancel(promise); // Interval canceled. ``` Closes #16476 --- docs/content/error/$interval/badprom.ngdoc | 25 +++++++++++++++++++ src/ng/interval.js | 28 +++++++++++++++------- test/ng/intervalSpec.js | 9 +++++-- 3 files changed, 52 insertions(+), 10 deletions(-) create mode 100644 docs/content/error/$interval/badprom.ngdoc diff --git a/docs/content/error/$interval/badprom.ngdoc b/docs/content/error/$interval/badprom.ngdoc new file mode 100644 index 000000000000..2c9f8c5371a9 --- /dev/null +++ b/docs/content/error/$interval/badprom.ngdoc @@ -0,0 +1,25 @@ +@ngdoc error +@name $interval:badprom +@fullName Non-$interval promise +@description + +This error occurs when calling {@link ng.$interval#cancel $interval.cancel()} with a promise that +was not generated by the {@link ng.$interval $interval} service. This can, for example, happen when +calling {@link ng.$q#the-promise-api then()/catch()} on the returned promise, which creates a new +promise, and pass that new promise to {@link ng.$interval#cancel $interval.cancel()}. + +Example of incorrect usage that leads to this error: + +```js +var promise = $interval(doSomething, 1000, 5).then(doSomethingElse); +$interval.cancel(promise); +``` + +To fix the example above, keep a reference to the promise returned by +{@link ng.$interval $interval()} and pass that to {@link ng.$interval#cancel $interval.cancel()}: + +```js +var promise = $interval(doSomething, 1000, 5); +var newPromise = promise.then(doSomethingElse); +$interval.cancel(promise); +``` diff --git a/src/ng/interval.js b/src/ng/interval.js index a34682ed007d..750a6ba3df1c 100644 --- a/src/ng/interval.js +++ b/src/ng/interval.js @@ -1,5 +1,7 @@ 'use strict'; +var $intervalMinErr = minErr('$interval'); + /** @this */ function $IntervalProvider() { this.$get = ['$rootScope', '$window', '$q', '$$q', '$browser', @@ -188,15 +190,25 @@ function $IntervalProvider() { * @returns {boolean} Returns `true` if the task was successfully canceled. */ interval.cancel = function(promise) { - if (promise && promise.$$intervalId in intervals) { - // Interval cancels should not report as unhandled promise. - markQExceptionHandled(intervals[promise.$$intervalId].promise); - intervals[promise.$$intervalId].reject('canceled'); - $window.clearInterval(promise.$$intervalId); - delete intervals[promise.$$intervalId]; - return true; + if (!promise) return false; + + if (!promise.hasOwnProperty('$$intervalId')) { + throw $intervalMinErr('badprom', + '`$interval.cancel()` called with a promise that was not generated by `$interval()`.'); } - return false; + + if (!intervals.hasOwnProperty(promise.$$intervalId)) return false; + + var id = promise.$$intervalId; + var deferred = intervals[id]; + + // Interval cancels should not report an unhandled promise. + markQExceptionHandled(deferred.promise); + deferred.reject('canceled'); + $window.clearInterval(id); + delete intervals[id]; + + return true; }; return interval; diff --git a/test/ng/intervalSpec.js b/test/ng/intervalSpec.js index 47281429e0b2..3b23250d1f98 100644 --- a/test/ng/intervalSpec.js +++ b/test/ng/intervalSpec.js @@ -335,12 +335,17 @@ describe('$interval', function() { })); - it('should not throw a runtime exception when given an undefined promise', - inject(function($interval) { + it('should not throw an error when given an undefined promise', inject(function($interval) { expect($interval.cancel()).toBe(false); })); + it('should throw an error when given a non-$interval promise', inject(function($interval) { + var promise = $interval(noop).then(noop); + expect(function() { $interval.cancel(promise); }).toThrowMinErr('$interval', 'badprom'); + })); + + it('should not trigger digest when cancelled', inject(function($interval, $rootScope, $browser) { var watchSpy = jasmine.createSpy('watchSpy'); $rootScope.$watch(watchSpy); From 98e0e047b0f705005b256c70feb4e6368ff3a591 Mon Sep 17 00:00:00 2001 From: Martin Staffa Date: Wed, 14 Mar 2018 22:35:34 +0100 Subject: [PATCH 414/745] docs(ngShow/ngHide): add note about flicker when toggling elements Related to https://github.com/angular/angular.js/issues/14015 Closes #16489 --- src/ng/directive/ngShowHide.js | 38 ++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/src/ng/directive/ngShowHide.js b/src/ng/directive/ngShowHide.js index 74f02f923989..8e24b5ba081c 100644 --- a/src/ng/directive/ngShowHide.js +++ b/src/ng/directive/ngShowHide.js @@ -182,6 +182,25 @@ var NG_HIDE_IN_PROGRESS_CLASS = 'ng-hide-animate'; }); + * + * @knownIssue + * + * ### Flickering when using ngShow to toggle between elements + * + * When using {@link ngShow} and / or {@link ngHide} to toggle between elements, it can + * happen that both the element to show and the element to hide are visible for a very short time. + * + * This usually happens when the {@link ngAnimate ngAnimate module} is included, but no actual animations + * are defined for {@link ngShow} / {@link ngHide}. Internet Explorer is affected more often than + * other browsers. + * + * There are several way to mitigate this problem: + * + * - {@link guide/animations#how-to-selectively-enable-disable-and-skip-animations Disable animations on the affected elements}. + * - Use {@link ngIf} or {@link ngSwitch} instead of {@link ngShow} / {@link ngHide}. + * - Use the special CSS selector `ng-hide.ng-hide-animate` to set `{display: none}` or similar on the affected elements. + * - Use `ng-class="{'ng-hide': expression}` instead of instead of {@link ngShow} / {@link ngHide}. + * - Define an animation on the affected elements. */ var ngShowDirective = ['$animate', function($animate) { return { @@ -382,6 +401,25 @@ var ngShowDirective = ['$animate', function($animate) { }); + * + * @knownIssue + * + * ### Flickering when using ngHide to toggle between elements + * + * When using {@link ngShow} and / or {@link ngHide} to toggle between elements, it can + * happen that both the element to show and the element to hide are visible for a very short time. + * + * This usually happens when the {@link ngAnimate ngAnimate module} is included, but no actual animations + * are defined for {@link ngShow} / {@link ngHide}. Internet Explorer is affected more often than + * other browsers. + * + * There are several way to mitigate this problem: + * + * - {@link guide/animations#how-to-selectively-enable-disable-and-skip-animations Disable animations on the affected elements}. + * - Use {@link ngIf} or {@link ngSwitch} instead of {@link ngShow} / {@link ngHide}. + * - Use the special CSS selector `ng-hide.ng-hide-animate` to set `{display: none}` or similar on the affected elements. + * - Use `ng-class="{'ng-hide': expression}` instead of instead of {@link ngShow} / {@link ngHide}. + * - Define an animation on the affected elements. */ var ngHideDirective = ['$animate', function($animate) { return { From c0bc1df3f73d03455175ca7e2002c026a0b64b4c Mon Sep 17 00:00:00 2001 From: Martin Staffa Date: Fri, 16 Mar 2018 16:48:12 +0100 Subject: [PATCH 415/745] chore(travis): update iOs test browsers Closes #16493 --- karma-shared.conf.js | 28 +++++++++++++--------------- scripts/travis/build.sh | 2 +- test/ng/directive/ngOptionsSpec.js | 2 +- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/karma-shared.conf.js b/karma-shared.conf.js index e95a95fbc111..ec06ed40a369 100644 --- a/karma-shared.conf.js +++ b/karma-shared.conf.js @@ -104,11 +104,15 @@ module.exports = function(config, specificOptions) { platform: 'Windows 10', version: 'latest-1' }, - 'SL_iOS': { + 'SL_iOS_10': { base: 'SauceLabs', browserName: 'iphone', - platform: 'OS X 10.10', - version: '8.1' + version: '10.3' + }, + 'SL_iOS_11': { + base: 'SauceLabs', + browserName: 'iphone', + version: '11' }, 'BS_Chrome': { @@ -156,23 +160,17 @@ module.exports = function(config, specificOptions) { os: 'Windows', os_version: '10' }, - 'BS_iOS_8': { - base: 'BrowserStack', - device: 'iPhone 6', - os: 'ios', - os_version: '8.3' - }, - 'BS_iOS_9': { - base: 'BrowserStack', - device: 'iPhone 6S', - os: 'ios', - os_version: '9.3' - }, 'BS_iOS_10': { base: 'BrowserStack', device: 'iPhone 7', os: 'ios', os_version: '10.0' + }, + 'BS_iOS_11': { + base: 'BrowserStack', + device: 'iPhone 8', + os: 'ios', + os_version: '11.0' } } }); diff --git a/scripts/travis/build.sh b/scripts/travis/build.sh index 9338247915a3..39c62de0de65 100755 --- a/scripts/travis/build.sh +++ b/scripts/travis/build.sh @@ -14,7 +14,7 @@ SAUCE_ACCESS_KEY=$(echo "$SAUCE_ACCESS_KEY" | rev) BROWSERS="SL_Chrome,SL_Chrome-1,\ SL_Firefox,SL_Firefox-1,\ SL_Safari,SL_Safari-1,\ -SL_iOS,\ +SL_iOS_10,SL_iOS_11,\ SL_IE_9,SL_IE_10,SL_IE_11,\ SL_EDGE,SL_EDGE-1" diff --git a/test/ng/directive/ngOptionsSpec.js b/test/ng/directive/ngOptionsSpec.js index 2af26f489367..56b11d04f0d2 100644 --- a/test/ng/directive/ngOptionsSpec.js +++ b/test/ng/directive/ngOptionsSpec.js @@ -2928,7 +2928,7 @@ describe('ngOptions', function() { // getter/setter is not defined on the prototype (probably due to some bug). On Safari 9, the // getter/setter that is already defined on the `