From 1f79497635d63753686779238ba4df01bcad21fb Mon Sep 17 00:00:00 2001 From: Kiko Beats Date: Tue, 15 Dec 2015 12:36:20 +0100 Subject: [PATCH] use npm for lodash-es, rather than a git submodule --- .editorconfig | 3 +++ .gitmodules | 4 ---- Makefile | 4 +--- build/async-bundle.js | 19 +++++-------------- deps/lodash-es | 1 - gulpfile.js | 1 + package.json | 8 +++++--- support/build/plugin-lodash-import-rename.js | 2 +- 8 files changed, 16 insertions(+), 26 deletions(-) delete mode 100644 .gitmodules delete mode 160000 deps/lodash-es diff --git a/.editorconfig b/.editorconfig index 7f502d449..239100f94 100644 --- a/.editorconfig +++ b/.editorconfig @@ -8,3 +8,6 @@ trim_trailing_whitespace = true insert_final_newline = true indent_style = space indent_size = 4 + +[package.json] +indent_size = 2 diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index c5976ce18..000000000 --- a/.gitmodules +++ /dev/null @@ -1,4 +0,0 @@ -[submodule "deps/lodash-es"] - path = deps/lodash-es - url = https://github.com/lodash/lodash - branch = es diff --git a/Makefile b/Makefile index a2c501a40..61c2ae831 100644 --- a/Makefile +++ b/Makefile @@ -24,10 +24,8 @@ lint: jshint $(SRC) test/*.js mocha_test/* perf/*.js jscs $(SRC) test/*.js mocha_test/* perf/*.js -submodule-clone: - git submodule update --init --recursive -build-bundle: submodule-clone +build-bundle: $(NODE) $(SCRIPTS)/build/modules-cjs.js $(NODE) $(SCRIPTS)/build/aggregate-bundle.js $(NODE) $(SCRIPTS)/build/aggregate-cjs.js diff --git a/build/async-bundle.js b/build/async-bundle.js index d19ad20d0..d6b8c79f8 100644 --- a/build/async-bundle.js +++ b/build/async-bundle.js @@ -1246,30 +1246,21 @@ var mapSeries = doSeries(_asyncMap); + /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeCeil = Math.ceil; var nativeMax$2 = Math.max; /** - * The base implementation of `_.range` and `_.rangeRight`. + * The base implementation of `_.range` and `_.rangeRight` without support + * for non-number arguments. * * @private - * @param {number} [start=0] The start of the range. + * @param {number} start The start of the range. * @param {number} end The end of the range. - * @param {number} [step=1] The value to increment or decrement by. + * @param {number} step The value to increment or decrement by. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Array} Returns the new array of numbers. */ function baseRange(start, end, step, fromRight) { - start = toNumber(start); - start = start === start ? start : 0; - - if (end === undefined) { - end = start; - start = 0; - } else { - end = toNumber(end) || 0; - } - step = step === undefined ? (start < end ? 1 : -1) : (toNumber(step) || 0); - var index = -1, length = nativeMax$2(nativeCeil((end - start) / (step || 1)), 0), result = Array(length); diff --git a/deps/lodash-es b/deps/lodash-es deleted file mode 160000 index b94d9760e..000000000 --- a/deps/lodash-es +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b94d9760e88c33a8ab0abb36933d5c4bd5730181 diff --git a/gulpfile.js b/gulpfile.js index 2655edff1..fbc58a101 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,4 +1,5 @@ 'use strict'; +// This is used to generate individual packages for each async method var gulp = require('gulp'); var path = require('path'); diff --git a/package.json b/package.json index 8197cff69..1fd6c5e9d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "async", "description": "Higher-order functions and common patterns for asynchronous code", - "version": "0.5.2", + "version": "2.0.0-alpha", "main": "lib/async.js", "author": "Caolan McMahon", "repository": { @@ -17,7 +17,10 @@ "module", "utility" ], - "dependencies": {}, + "dependencies": { + "lodash": "lodash/lodash#npm", + "lodash-es": "lodash/lodash#es" + }, "devDependencies": { "babel-cli": "^6.3.17", "babel-core": "^6.3.26", @@ -38,7 +41,6 @@ "karma-firefox-launcher": "^0.1.6", "karma-mocha": "^0.2.0", "karma-mocha-reporter": "^1.0.2", - "lodash": "lodash/lodash#npm", "mocha": "^2.2.5", "native-promise-only": "^0.8.0-a", "nodeunit": ">0.0.0", diff --git a/support/build/plugin-lodash-import-rename.js b/support/build/plugin-lodash-import-rename.js index cb765faeb..d3c2c70e9 100644 --- a/support/build/plugin-lodash-import-rename.js +++ b/support/build/plugin-lodash-import-rename.js @@ -14,7 +14,7 @@ export default function() { let dir = dirname(f).split(sep); let relative = _.repeat('../', dir.length + 1); - node.source.value = value.replace(/\blodash\b/, relative + 'deps/lodash-es'); + node.source.value = value.replace(/\blodash\b/, relative + 'node_modules/lodash-es'); } } }