Merge branch 'master' into 12009-export-image-disclaimer

pull/12024/head
nobuti 8 years ago
commit 925183b22f

@ -1,6 +1,6 @@
language: node_js
node_js:
- "0.10"
- "6.9.2"
before_install:
- git submodule update --init --recursive
@ -9,7 +9,7 @@ install:
- npm install
before_script:
- npm install -g npm@2.14
- npm install -g npm@3.10.9
- npm install -g grunt-cli
script:

@ -123,8 +123,6 @@ After building the whole suite for the first time, a webpage will show up with a
Then, the process will watch changes in the codebase and will regenerate the specs as needed. Just refresh the Jasmine page to pass again the tests.
:warning: Node v6+ is required to run `grunt affected_specs`
If you prefer to generate all specs anyway, you can pass a flag to the grunt task:
```bash
@ -137,15 +135,13 @@ This will generate the whole Builder suite, not only the specs affected by the c
If you want to run simultaneously the application and the specs generation follow these steps:
1. Open a terminal with Node v0.10.48 (use nvm) and run `grunt && grunt dev`. This will build the application assets and will watch for changes.
2. Open a second terminal and use nvm to set the Node version to 6+.
1. Open a terminal with Node v6.9.2 (use nvm) and run `grunt && grunt dev`. This will build the application assets and will watch for changes.
3. In this second terminal run `grunt affected_specs`.
2. Open a second terminal and run `grunt affected_specs`.
4. You will see in the first terminal that a lot of changes build the bundle again. That's normal. The first step of the point 3 is to copy all needed files, so the `watch` of `grunt dev` triggers. Don't worry about it.
3. You will see in the first terminal that a lot of changes build the bundle again. That's normal. The first step of the point 3 is to copy all needed files, so the `watch` of `grunt dev` triggers. Don't worry about it.
5. That's it. When you change any Builder Javascript file `grunt dev` will build the application bundle and `grunt affected_specs` will build the specs.
4. That's it. When you change any Builder Javascript file `grunt dev` will build the application bundle and `grunt affected_specs` will build the specs.
#### Running a particular spec
@ -155,7 +151,7 @@ If you only want to run a subset of tests the easiest and fastest way is to use
We use [Grunt](http://gruntjs.com/) to automate build tasks related to both CSS and JS.
We use v0.10.x of [node](http://nodejs.org/) (we recommend to use [NVM](https://github.com/creationix/nvm)).
We use v6.9.2 of [node](http://nodejs.org/) (we recommend to use [NVM](https://github.com/creationix/nvm)).
Install dependencies using a normal npm install as such:
```bash

@ -3,13 +3,11 @@ var timer = require("grunt-timer");
var colors = require('colors');
var semver = require('semver');
var jasmineCfg = require('./lib/build/tasks/jasmine.js');
var duplicatedDependencies = require('./lib/build/tasks/shrinkwrap-duplicated-dependencies.js');
var shrinkwrapDependencies = require('./lib/build/tasks/shrinkwrap-dependencies.js');
var webpackTask = null;
var NODE_VERSION = '0.10.26 - 0.12';
var NPM_VERSION = '2.14 - 2.15';
var WEBPACK_NODE_VERSION = '6 - 7';
var WEBPACK_NPM_VERSION = '2.14 - 3';
var REQUIRED_NODE_VERSION = '6.9.2';
var REQUIRED_NPM_VERSION = '3.10.9';
var DEVELOPMENT = 'development';
@ -88,15 +86,26 @@ module.exports = function(grunt) {
checkVersion('npm -v', requiredNpmVersion, 'npm', logFn);
}
if (grunt.cli.tasks.indexOf('affected_specs') > - 1) {
// Webpack needs a higher version of Node than the rest of the tasks.
preFlight(WEBPACK_NODE_VERSION, WEBPACK_NPM_VERSION, logVersionsError);
} else {
preFlight(NODE_VERSION, NPM_VERSION, logVersionsError);
var mustCheckNodeVersion = grunt.option('no-node-checker');
if (!mustCheckNodeVersion) {
preFlight(REQUIRED_NODE_VERSION, REQUIRED_NPM_VERSION, logVersionsError);
grunt.log.writeln('');
}
var dependenciesWithDifferentVersion = shrinkwrapDependencies.checkDependenciesVersion(
require('./npm-shrinkwrap-010.json'),
require('./npm-shrinkwrap-69.json'),
SHRINKWRAP_MODULES_TO_VALIDATE
);
if (dependenciesWithDifferentVersion.length > 0) {
grunt.log.fail("############### /!\\ CAUTION /!\\ #################");
grunt.log.fail("Dependencies with different version in shrinkwraps for node 0.10 and node 6.9.2 found.");
grunt.log.fail(JSON.stringify(dependenciesWithDifferentVersion, null, 4));
grunt.log.fail("#################################################");
process.exit(1);
}
grunt.log.writeln('');
var duplicatedModules = duplicatedDependencies(require('./npm-shrinkwrap.json'), SHRINKWRAP_MODULES_TO_VALIDATE);
var duplicatedModules = shrinkwrapDependencies.checkDuplicatedDependencies(require('./npm-shrinkwrap.json'), SHRINKWRAP_MODULES_TO_VALIDATE);
if (duplicatedModules.length > 0) {
grunt.log.fail("############### /!\\ CAUTION /!\\ #################");
grunt.log.fail("Duplicated dependencies found in npm-shrinkwrap.json file.");

@ -4,6 +4,7 @@ Development
* An attacker could execute commands in the server running the queues by importing a file with a carefully crafted filename. Fixed in #11782
### Features
* Using Node v6.9.2 and npm v3.10.9 (#11935).
* Exposed some cartodb.js methods through map definition model (#11846)
* Dataservices configuration rake tasks (#11917)
* `cartodb:services:set_user_quota[username,service,quota]` updated to support the `mapzen_routing` provider

@ -123,7 +123,7 @@ describe('deep-insights-integrations/legend-manager', function () {
cartocss: 'wadus'
});
expect(LegendFactory.createLegend).toHaveBeenCalledTimes(2);
expect(LegendFactory.createLegend.calls.count()).toBe(2);
expect(LegendFactory.createLegend).toHaveBeenCalledWith(this.layerDefinitionModel, 'bubble', {title: 'number', fillColor: '#ffc6c4'});
expect(LegendFactory.createLegend).toHaveBeenCalledWith(this.layerDefinitionModel, 'choropleth', {title: 'number'});
});
@ -146,7 +146,7 @@ describe('deep-insights-integrations/legend-manager', function () {
cartocss: 'wadus'
});
expect(LegendFactory.createLegend).toHaveBeenCalledTimes(1);
expect(LegendFactory.createLegend.calls.count()).toBe(1);
expect(LegendFactory.createLegend).toHaveBeenCalledWith(this.layerDefinitionModel, 'category', {title: 'number'});
});
});
@ -222,7 +222,7 @@ describe('deep-insights-integrations/legend-manager', function () {
});
expect(LegendFactory.removeLegend).toHaveBeenCalledWith(this.layerDefinitionModel, 'custom_choropleth', jasmine.any(Function));
expect(LegendFactory.createLegend).toHaveBeenCalledTimes(2);
expect(LegendFactory.createLegend.calls.count()).toBe(2);
expect(LegendFactory.createLegend).toHaveBeenCalledWith(this.layerDefinitionModel, 'bubble', {title: 'number', fillColor: '#ffc6c4'});
expect(LegendFactory.createLegend).toHaveBeenCalledWith(this.layerDefinitionModel, 'choropleth', {title: 'number'});
});
@ -247,7 +247,7 @@ describe('deep-insights-integrations/legend-manager', function () {
cartocss: 'wadus'
});
expect(LegendFactory.createLegend).toHaveBeenCalledTimes(0);
expect(LegendFactory.createLegend.calls.count()).toBe(0);
expect(LegendFactory.removeLegend).toHaveBeenCalledWith(this.layerDefinitionModel, 'category');
this.layerDefinitionModel.set({
@ -255,7 +255,7 @@ describe('deep-insights-integrations/legend-manager', function () {
cartocss: 'sudaw'
});
expect(LegendFactory.createLegend).toHaveBeenCalledTimes(1);
expect(LegendFactory.createLegend.calls.count()).toBe(1);
expect(LegendFactory.createLegend).toHaveBeenCalledWith(this.layerDefinitionModel, 'category', {title: 'number'});
});
});
@ -318,7 +318,7 @@ describe('deep-insights-integrations/legend-manager', function () {
cartocss: 'wadus'
});
expect(LegendFactory.createLegend).toHaveBeenCalledTimes(2);
expect(LegendFactory.createLegend.calls.count()).toBe(2);
expect(LegendFactory.createLegend).toHaveBeenCalledWith(this.layerDefinitionModel, 'bubble', {title: 'number', fillColor: '#ffc6c4'});
expect(LegendFactory.createLegend).toHaveBeenCalledWith(this.layerDefinitionModel, 'choropleth', {title: 'number'});
});
@ -341,7 +341,7 @@ describe('deep-insights-integrations/legend-manager', function () {
cartocss: 'wadus'
});
expect(LegendFactory.createLegend).toHaveBeenCalledTimes(1);
expect(LegendFactory.createLegend.calls.count()).toBe(1);
expect(LegendFactory.createLegend).toHaveBeenCalledWith(this.layerDefinitionModel, 'category', {title: 'number'});
});
});
@ -415,7 +415,7 @@ describe('deep-insights-integrations/legend-manager', function () {
});
expect(LegendFactory.removeLegend).toHaveBeenCalledWith(this.layerDefinitionModel, 'custom_choropleth', jasmine.any(Function));
expect(LegendFactory.createLegend).toHaveBeenCalledTimes(2);
expect(LegendFactory.createLegend.calls.count()).toBe(2);
expect(LegendFactory.createLegend).toHaveBeenCalledWith(this.layerDefinitionModel, 'bubble', {title: 'number', fillColor: '#ffc6c4'});
expect(LegendFactory.createLegend).toHaveBeenCalledWith(this.layerDefinitionModel, 'choropleth', {title: 'number'});
});
@ -440,7 +440,7 @@ describe('deep-insights-integrations/legend-manager', function () {
cartocss: 'wadus'
});
expect(LegendFactory.createLegend).toHaveBeenCalledTimes(0);
expect(LegendFactory.createLegend.calls.count()).toBe(0);
expect(LegendFactory.removeLegend).toHaveBeenCalledWith(this.layerDefinitionModel, 'category');
this.layerDefinitionModel.set({
@ -448,7 +448,7 @@ describe('deep-insights-integrations/legend-manager', function () {
cartocss: 'sudaw'
});
expect(LegendFactory.createLegend).toHaveBeenCalledTimes(1);
expect(LegendFactory.createLegend.calls.count()).toBe(1);
expect(LegendFactory.createLegend).toHaveBeenCalledWith(this.layerDefinitionModel, 'category', {title: 'number'});
});
});
@ -485,7 +485,7 @@ describe('deep-insights-integrations/legend-manager', function () {
cartocss: 'wadus'
});
expect(LegendFactory.createLegend).toHaveBeenCalledTimes(1);
expect(LegendFactory.createLegend.calls.count()).toBe(1);
expect(LegendFactory.createLegend).toHaveBeenCalledWith(this.layerDefinitionModel, 'choropleth', {title: 'number'});
});
@ -504,7 +504,7 @@ describe('deep-insights-integrations/legend-manager', function () {
cartocss: 'wadus'
});
expect(LegendFactory.createLegend).toHaveBeenCalledTimes(1);
expect(LegendFactory.createLegend.calls.count()).toBe(1);
expect(LegendFactory.createLegend).toHaveBeenCalledWith(this.layerDefinitionModel, 'category', {title: 'number'});
});
});
@ -533,7 +533,7 @@ describe('deep-insights-integrations/legend-manager', function () {
cartocss: 'wadus'
});
expect(LegendFactory.createLegend).toHaveBeenCalledTimes(0);
expect(LegendFactory.createLegend.calls.count()).toBe(0);
expect(LegendFactory.removeLegend).toHaveBeenCalledWith(this.layerDefinitionModel, 'choropleth');
LegendFactory.createLegend.calls.reset();
@ -563,7 +563,7 @@ describe('deep-insights-integrations/legend-manager', function () {
cartocss: 'wadus'
});
expect(LegendFactory.createLegend).toHaveBeenCalledTimes(0);
expect(LegendFactory.createLegend.calls.count()).toBe(0);
expect(LegendFactory.removeLegend).toHaveBeenCalledWith(this.layerDefinitionModel, 'category');
LegendFactory.createLegend.calls.reset();
@ -573,7 +573,7 @@ describe('deep-insights-integrations/legend-manager', function () {
cartocss: 'sudaw'
});
expect(LegendFactory.createLegend).toHaveBeenCalledTimes(1);
expect(LegendFactory.createLegend.calls.count()).toBe(1);
expect(LegendFactory.createLegend).toHaveBeenCalledWith(this.layerDefinitionModel, 'category', {title: 'number'});
});
});
@ -601,7 +601,7 @@ describe('deep-insights-integrations/legend-manager', function () {
cartocss: 'wadus'
});
expect(LegendFactory.createLegend).toHaveBeenCalledTimes(1);
expect(LegendFactory.createLegend.calls.count()).toBe(1);
expect(LegendFactory.createLegend).toHaveBeenCalledWith(this.layerDefinitionModel, 'category', {title: 'number'});
});
});
@ -649,7 +649,7 @@ describe('deep-insights-integrations/legend-manager', function () {
// legend. In this test the style is changing its color and size attributes, so createLegend should be called
// only once to create a bubble legend, but no choropleth legend
expect(LegendFactory.createLegend).toHaveBeenCalledTimes(1);
expect(LegendFactory.createLegend.calls.count()).toBe(1);
expect(LegendFactory.createLegend).toHaveBeenCalledWith(this.layerDefinitionModel, 'bubble', {title: 'number', fillColor: '#ffc6c4'});
expect(LegendFactory.createLegend).not.toHaveBeenCalledWith(this.layerDefinitionModel, 'choropleth', {title: 'number'});
});

@ -26,7 +26,7 @@ function alldeps (mod, deps, name, parentVersion) {
* For instance if there are a couple of dependencies using a different version
* of backbone it will return backbone with its parent dependencies.
*/
function duplicated (shrinkwrap, modulesToValidate) {
function duplicatedDependencies (shrinkwrap, modulesToValidate) {
shrinkwrap = shrinkwrap || require('./npm-shrinkwrap.json');
var all = alldeps(shrinkwrap);
@ -46,4 +46,29 @@ function duplicated (shrinkwrap, modulesToValidate) {
}, []);
}
module.exports = duplicated;
/**
* Checks if the version of a shrinkwrap file matches with the version of another shrinkwrap file.
* It is necessary to pass the modules to validate.
*
* It will return the modules where the version differs.
*/
function dependenciesVersion (shrinkwrapOne, shrinkwrapTwo, modulesToValidate) {
var allDependenciesOne = alldeps(shrinkwrapOne);
var allDependenciesTwo = alldeps(shrinkwrapTwo);
return modulesToValidate.reduce(function (depWithDiffVer, mod) {
var verDepFromOne = Object.keys(allDependenciesOne[mod])[0];
var verDepFromTwo = Object.keys(allDependenciesTwo[mod])[0];
if (verDepFromOne !== verDepFromTwo) {
depWithDiffVer.push(mod);
}
return depWithDiffVer;
}, []);
}
module.exports = {
checkDuplicatedDependencies: duplicatedDependencies,
checkDependenciesVersion: dependenciesVersion
};

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

4151
npm-shrinkwrap.json generated

File diff suppressed because it is too large Load Diff

@ -1,6 +1,6 @@
{
"name": "cartodb-ui",
"version": "4.6.75-ded03",
"version": "4.6.76",
"description": "CARTO UI frontend",
"repository": {
"type": "git",
@ -16,9 +16,10 @@
"dependencies": {
"backbone": "1.2.3",
"backbone-forms": "0.14.0",
"backbone-model-file-upload": "CartoDB/backbone-model-file-upload#1.0.0",
"backbone-model-file-upload": "CartoDB/backbone-model-file-upload#1.0.1",
"backbone-undo": "cartodb/Backbone.Undo.js#c10e997",
"bootstrap-colorpicker": "2.5.0",
"browserify": "13.0.0",
"browserify-shim": "3.8.12",
"camshaft-reference": "<2.0",
"carto": "cartodb/carto#master",
@ -42,7 +43,6 @@
"aws-sdk": "2.0.0-rc11",
"bluebird": "3.5.0",
"brfs": "^1.4.3",
"browserify": "13.0.0",
"browserify-resolutions": "1.1.0",
"cartoassets": "cartodb/CartoAssets#master",
"colors": "1.1.2",
@ -62,7 +62,7 @@
"grunt-contrib-concat": "0.5.1",
"grunt-contrib-connect": "0.11.2",
"grunt-contrib-copy": "0.8.1",
"grunt-contrib-jasmine": "0.9.1",
"grunt-contrib-jasmine": "1.1.0",
"grunt-contrib-jst": "git://github.com/javisantana/grunt-contrib-jst.git#master",
"grunt-contrib-sass": "0.9.2",
"grunt-contrib-uglify": "2.0.x",
@ -73,6 +73,7 @@
"jasmine": "2.5.2",
"jasmine-ajax": "git://github.com/nobuti/jasmine-ajax.git#master",
"jstify": "0.13.0",
"lodash": "4.17.4",
"load-grunt-tasks": "3.2.0",
"lodash": "^4.17.4",
"minimist": "1.2.0",
@ -169,10 +170,13 @@
"config": {
"npmJsDir": "lib/assets"
},
"engine": {
"node": "6.9.2"
},
"scripts": {
"test": "echo \"Run 'grunt test' to run specs through command line.\"",
"preupdate-internal-deps": "echo 'DEPRECATED TASK, use `npm run-script update-internal-deps` instead'",
"update-internal-deps": "rm -rf node_modules && npm install --no-shrinkwrap && npm shrinkwrap",
"update-internal-deps": "rm -rf node_modules && npm install --production --no-shrinkwrap && npm dedupe && npm prune && npm shrinkwrap && npm install",
"branch-files": "node lib/build/branchFiles/branchFiles.js",
"affected_specs": "node lib/build/branchFiles/branchFiles.js | xargs node lib/build/affectedFiles/affectedFiles.js"
}

Loading…
Cancel
Save