From 247d0da188e70949a48739fc42dbf5da4d7b8b40 Mon Sep 17 00:00:00 2001 From: Igor Zinkovsky Date: Wed, 11 Jan 2012 19:34:56 -0800 Subject: [PATCH 1/6] update libuv to 855764406e fixes #2521 --- deps/uv/src/win/fs.c | 72 +++++++++++++++++++++++++++----------- deps/uv/src/win/internal.h | 4 +-- deps/uv/src/win/util.c | 23 ++++++++++++ 3 files changed, 76 insertions(+), 23 deletions(-) diff --git a/deps/uv/src/win/fs.c b/deps/uv/src/win/fs.c index 78ccffab6..d7087b1f5 100644 --- a/deps/uv/src/win/fs.c +++ b/deps/uv/src/win/fs.c @@ -490,38 +490,69 @@ void fs__readdir(uv_fs_t* req, const wchar_t* path, int flags) { void fs__stat(uv_fs_t* req, const wchar_t* path) { + HANDLE file; + WIN32_FIND_DATAW ent; int result; - unsigned short mode; - fs__open(req, path, _O_RDONLY, 0); - if (req->result == -1) { + req->ptr = NULL; + + file = FindFirstFileExW(path, FindExInfoStandard, &ent, + FindExSearchNameMatch, NULL, 0); + + if (file == INVALID_HANDLE_VALUE) { + SET_REQ_RESULT_WIN32_ERROR(req, GetLastError()); return; } - result = _fstati64(req->result, &req->stat); - if (result == -1) { - req->ptr = NULL; - } else { + FindClose(file); - /* - * VC CRT doesn't properly set S_IFDIR in _fstati64, - * so we set it here if path is a directory. - */ - if (GetFileAttributesW(path) & FILE_ATTRIBUTE_DIRECTORY) { - mode = req->stat.st_mode; - mode &= ~_S_IFMT; - mode |= _S_IFDIR; + if (ent.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT && + ent.dwReserved0 == IO_REPARSE_TAG_SYMLINK) { + fs__open(req, path, _O_RDONLY, 0); + if (req->result != -1) { + result = _fstati64(req->result, &req->stat); + _close(req->result); - req->stat.st_mode = mode; - assert((req->stat.st_mode & _S_IFMT) == _S_IFDIR); + if (result != -1) { + req->ptr = &req->stat; + } + + SET_REQ_RESULT(req, result); } - req->ptr = &req->stat; + return; } - _close(req->result); + req->stat.st_ino = 0; + req->stat.st_uid = 0; + req->stat.st_gid = 0; + req->stat.st_mode = 0; + req->stat.st_rdev = 0; + req->stat.st_dev = 0; + req->stat.st_nlink = 1; - SET_REQ_RESULT(req, result); + if (ent.dwFileAttributes & FILE_ATTRIBUTE_READONLY ) { + req->stat.st_mode |= (_S_IREAD + (_S_IREAD >> 3) + (_S_IREAD >> 6)); + } else { + req->stat.st_mode |= ((_S_IREAD|_S_IWRITE) + ((_S_IREAD|_S_IWRITE) >> 3) + + ((_S_IREAD|_S_IWRITE) >> 6)); + } + + if (ent.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { + req->stat.st_mode |= _S_IFDIR; + } else { + req->stat.st_mode |= _S_IFREG; + } + + uv_filetime_to_time_t(&ent.ftLastWriteTime, &(req->stat.st_mtime)); + uv_filetime_to_time_t(&ent.ftLastAccessTime, &(req->stat.st_atime)); + uv_filetime_to_time_t(&ent.ftCreationTime, &(req->stat.st_ctime)); + + req->stat.st_size = ((int64_t)ent.nFileSizeHigh << 32) + + (int64_t)ent.nFileSizeLow; + + req->ptr = &req->stat; + req->result = 0; } @@ -1543,3 +1574,4 @@ void uv_fs_req_cleanup(uv_fs_t* req) { req->flags |= UV_FS_CLEANEDUP; } + diff --git a/deps/uv/src/win/internal.h b/deps/uv/src/win/internal.h index deb8972c5..336349b1f 100644 --- a/deps/uv/src/win/internal.h +++ b/deps/uv/src/win/internal.h @@ -284,10 +284,8 @@ void uv_fs_event_endgame(uv_loop_t* loop, uv_fs_event_t* handle); /* Utils */ int uv_parent_pid(); - - +void uv_filetime_to_time_t(FILETIME* file_time, time_t* stat_time); void uv_fatal_error(const int errorno, const char* syscall); - uv_err_code uv_translate_sys_error(int sys_errno); #define SET_REQ_STATUS(req, status) \ diff --git a/deps/uv/src/win/util.c b/deps/uv/src/win/util.c index fcdeafc72..0fcfb9c3d 100644 --- a/deps/uv/src/win/util.c +++ b/deps/uv/src/win/util.c @@ -23,6 +23,7 @@ #include #include #include +#include #include "uv.h" #include "internal.h" @@ -236,3 +237,25 @@ int uv_parent_pid() { CloseHandle(handle); return parent_pid; } + + +void uv_filetime_to_time_t(FILETIME* file_time, time_t* stat_time) { + FILETIME local_time; + SYSTEMTIME system_time; + struct tm time; + + if ((file_time->dwLowDateTime || file_time->dwHighDateTime) && + FileTimeToLocalFileTime(file_time, &local_time) && + FileTimeToSystemTime(&local_time, &system_time)) { + time.tm_year = system_time.wYear - 1900; + time.tm_mon = system_time.wMonth - 1; + time.tm_mday = system_time.wDay; + time.tm_hour = system_time.wHour; + time.tm_min = system_time.wMinute; + time.tm_sec = system_time.wSecond; + + *stat_time = mktime(&time); + } else { + *stat_time = 0; + } +} From 465e22e62f8eb927464bb6210ec786ab289813f9 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Thu, 12 Jan 2012 14:41:04 +0100 Subject: [PATCH 2/6] docs: clarify filename argument of vm.* functions --- doc/api/vm.markdown | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/doc/api/vm.markdown b/doc/api/vm.markdown index d3e3606ef..3d3c16845 100644 --- a/doc/api/vm.markdown +++ b/doc/api/vm.markdown @@ -9,8 +9,9 @@ JavaScript code can be compiled and run immediately or compiled, saved, and run ### vm.runInThisContext(code, [filename]) -`vm.runInThisContext()` compiles `code` as if it were loaded from `filename`, -runs it and returns the result. Running code does not have access to local scope. `filename` is optional. +`vm.runInThisContext()` compiles `code`, runs it and returns the result. Running +code does not have access to local scope. `filename` is optional, it's used only +in stack traces. Example of using `vm.runInThisContext` and `eval` to run the same code: @@ -38,10 +39,10 @@ and throws an exception. ### vm.runInNewContext(code, [sandbox], [filename]) -`vm.runInNewContext` compiles `code` to run in `sandbox` as if it were loaded from `filename`, -then runs it and returns the result. Running code does not have access to local scope and -the object `sandbox` will be used as the global object for `code`. -`sandbox` and `filename` are optional. +`vm.runInNewContext` compiles `code`, then runs it in `sandbox` and returns the +result. Running code does not have access to local scope. The object `sandbox` +will be used as the global object for `code`. +`sandbox` and `filename` are optional, `filename` is only used in stack traces. Example: compile and execute code that increments a global variable and sets a new one. These globals are contained in the sandbox. @@ -67,11 +68,12 @@ and throws an exception. ### vm.runInContext(code, context, [filename]) -`vm.runInContext` compiles `code` to run in context `context` as if it were loaded from `filename`, -then runs it and returns the result. A (V8) context comprises a global object, together with a -set of built-in objects and functions. Running code does not have access to local scope and -the global object held within `context` will be used as the global object for `code`. -`filename` is optional. +`vm.runInContext` compiles `code`, then runs it in `context` and returns the +result. A (V8) context comprises a global object, together with a set of +built-in objects and functions. Running code does not have access to local scope +and the global object held within `context` will be used as the global object +for `code`. +`filename` is optional, it's used only in stack traces. Example: compile and execute code in a existing context. @@ -107,11 +109,11 @@ to seed the initial contents of the global object used by the context. ### vm.createScript(code, [filename]) -`createScript` compiles `code` as if it were loaded from `filename`, -but does not run it. Instead, it returns a `vm.Script` object representing this compiled code. -This script can be run later many times using methods below. -The returned script is not bound to any global object. -It is bound before each run, just for that run. `filename` is optional. +`createScript` compiles `code` but does not run it. Instead, it returns a +`vm.Script` object representing this compiled code. This script can be run +later many times using methods below. The returned script is not bound to any +global object. It is bound before each run, just for that run. `filename` is +optional, it's only used in stack traces. In case of syntax error in `code`, `createScript` prints the syntax error to stderr and throws an exception. From bd9fa2e8419dda3ecff55ca7d801af3db4aeb5b2 Mon Sep 17 00:00:00 2001 From: mrb Date: Wed, 11 Jan 2012 23:42:24 -0500 Subject: [PATCH 3/6] dgram: use slab memory allocator Change udp memory allocation scheme from uv_buf_init to slab allocation. Takes slab allocation scheme from stream_wrap. --- src/udp_wrap.cc | 68 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 59 insertions(+), 9 deletions(-) diff --git a/src/udp_wrap.cc b/src/udp_wrap.cc index 741e4ed46..aa5160ceb 100644 --- a/src/udp_wrap.cc +++ b/src/udp_wrap.cc @@ -59,10 +59,14 @@ namespace node { return scope.Close(Integer::New(-1)); \ } +#define SLAB_SIZE (1024 * 1024) +#define MIN(a, b) ((a) < (b) ? (a) : (b)) + // TODO share with tcp_wrap.cc Persistent address_symbol; Persistent port_symbol; Persistent buffer_sym; +static Persistent udp_slab_sym; void AddressToJS(Handle info, const sockaddr* addr, @@ -70,6 +74,12 @@ void AddressToJS(Handle info, typedef ReqWrap SendWrap; + +static size_t slab_used; +size_t slab_offset_; +static uv_handle_t* handle_that_last_alloced; + + class UDPWrap: public HandleWrap { public: static void Initialize(Handle target); @@ -83,6 +93,8 @@ public: static Handle GetSockName(const Arguments& args); private: + static inline char* NewSlab(v8::Handle global, v8::Handle wrap_obj); + UDPWrap(Handle object); virtual ~UDPWrap(); @@ -118,6 +130,7 @@ void UDPWrap::Initialize(Handle target) { HandleScope scope; + udp_slab_sym = Persistent::New(String::NewSymbol("udpslab")); buffer_sym = NODE_PSYMBOL("buffer"); port_symbol = NODE_PSYMBOL("port"); address_symbol = NODE_PSYMBOL("address"); @@ -149,7 +162,6 @@ Handle UDPWrap::New(const Arguments& args) { return scope.Close(args.This()); } - Handle UDPWrap::DoBind(const Arguments& args, int family) { HandleScope scope; int r; @@ -332,13 +344,44 @@ void UDPWrap::OnSend(uv_udp_send_t* req, int status) { uv_buf_t UDPWrap::OnAlloc(uv_handle_t* handle, size_t suggested_size) { - // FIXME switch to slab allocation, share with stream_wrap.cc - return uv_buf_init(new char[suggested_size], suggested_size); -} + HandleScope scope; + UDPWrap* wrap = static_cast(handle->data); + + char* slab = NULL; + + Handle global = Context::GetCurrent()->Global(); + Local slab_v = global->GetHiddenValue(udp_slab_sym); + + if (slab_v.IsEmpty()) { + // No slab currently. Create a new one. + slab = NewSlab(global, wrap->object_); + } else { + // Use existing slab. + Local slab_obj = slab_v->ToObject(); + slab = Buffer::Data(slab_obj); + assert(Buffer::Length(slab_obj) == SLAB_SIZE); + assert(SLAB_SIZE >= slab_used); + + // If less than 64kb is remaining on the slab allocate a new one. + if (SLAB_SIZE - slab_used < 64 * 1024) { + slab = NewSlab(global, wrap->object_); + } else { + wrap->object_->SetHiddenValue(udp_slab_sym, slab_obj); + } + } + + uv_buf_t buf; + buf.base = slab + slab_used; + buf.len = MIN(SLAB_SIZE - slab_used, suggested_size); + + slab_offset_ = slab_used; + slab_used += buf.len; + + handle_that_last_alloced = reinterpret_cast(handle); + + return buf; -static void ReleaseMemory(char* data, void* arg) { - delete[] data; // data == buf.base } @@ -348,7 +391,6 @@ void UDPWrap::OnRecv(uv_udp_t* handle, struct sockaddr* addr, unsigned flags) { if (nread == 0) { - ReleaseMemory(buf.base, NULL); return; } @@ -365,18 +407,26 @@ void UDPWrap::OnRecv(uv_udp_t* handle, if (nread == -1) { SetErrno(uv_last_error(uv_default_loop())); - ReleaseMemory(buf.base, NULL); } else { Local rinfo = Object::New(); AddressToJS(rinfo, addr, sizeof *addr); - argv[2] = Buffer::New(buf.base, nread, ReleaseMemory, NULL)->handle_; + argv[2] = Buffer::New(buf.base, nread, NULL, NULL)->handle_; argv[3] = rinfo; } MakeCallback(wrap->object_, "onmessage", ARRAY_SIZE(argv), argv); } +inline char* UDPWrap::NewSlab(Handle global, + Handle wrap_obj) { + Buffer* b = Buffer::New(SLAB_SIZE); + global->SetHiddenValue(udp_slab_sym, b->handle_); + assert(Buffer::Length(b) == SLAB_SIZE); + slab_used = 0; + wrap_obj->SetHiddenValue(udp_slab_sym, b->handle_); + return Buffer::Data(b); +} void AddressToJS(Handle info, const sockaddr* addr, From 766f609838734f7ddf2ee9503e8205647ecb5dbf Mon Sep 17 00:00:00 2001 From: Guillermo Rauch Date: Thu, 12 Jan 2012 14:08:08 -0800 Subject: [PATCH 4/6] website: Add "Api Docs" button next to "Download" * Added Docs button and `button` class. * Refactored download button style into `.button` * Applied color overrides for download/docs buttons. * Pointed docs link to latest available docs. --- doc/index.html | 3 ++- doc/pipe.css | 38 ++++++++++++++++++++++++++------------ 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/doc/index.html b/doc/index.html index 151273b2c..61f10893d 100644 --- a/doc/index.html +++ b/doc/index.html @@ -29,7 +29,8 @@ lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.

- Download + Download + Docs

Node.js in the Industry

diff --git a/doc/pipe.css b/doc/pipe.css index b1ed7584a..3da6d120a 100644 --- a/doc/pipe.css +++ b/doc/pipe.css @@ -62,22 +62,36 @@ h1 a, h2 a, h3 a, h4 a font-size: 14px; } -#intro #downloadbutton { - background-color: #8BC84B; - color: #46483e; - font-weight: bold; - font-size: 14px; - text-transform: uppercase; - padding: 7px 10px; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; +#intro .button { + font-weight: bold; + font-size: 14px; + text-transform: uppercase; + padding: 7px 10px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + margin: 0 5px; + color: #46483e; } +#intro .button:hover { + text-decoration: none; +} + +#intro #downloadbutton { + background-color: #8BC84B; +} #intro #downloadbutton:hover { - text-decoration: none; - background-color: #73a53e; + background-color: #73a53e; +} + +#intro #docsbutton { + background-color: #d2d8ba; +} + +#intro #docsbutton:hover { + background-color: #aab293; } #quotes { From f0c1376e07e6d5a4deb3d088bd3153d7f6af1298 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Sat, 14 Jan 2012 02:13:22 +0100 Subject: [PATCH 5/6] net: make .write() throw on bad input Passing a non-buffer or non-string argument to Socket.prototype.write triggered an assert: Assertion failed: (Buffer::HasInstance(args[0])), function Write, file ../src/stream_wrap.cc, line 289. Fixes #2532. --- lib/net.js | 4 +++- test/simple/test-net-connect-buffer.js | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/lib/net.js b/lib/net.js index 072896b4c..85479412b 100644 --- a/lib/net.js +++ b/lib/net.js @@ -424,8 +424,10 @@ Socket.prototype.write = function(data, arg1, arg2) { } // Change strings to buffers. SLOW - if (typeof data == 'string') { + if (typeof data === 'string') { data = new Buffer(data, encoding); + } else if (!Buffer.isBuffer(data)) { + throw new TypeError("First argument must be a buffer or a string."); } this.bytesWritten += data.length; diff --git a/test/simple/test-net-connect-buffer.js b/test/simple/test-net-connect-buffer.js index 9fbf18c83..75486af97 100644 --- a/test/simple/test-net-connect-buffer.js +++ b/test/simple/test-net-connect-buffer.js @@ -63,6 +63,25 @@ tcp.listen(common.PORT, function() { assert.equal('opening', socket.readyState); + // Make sure that anything besides a buffer or a string throws. + [ null, + true, + false, + undefined, + 1, + 1.0, + 1 / 0, + +Infinity + -Infinity, + [], + {} + ].forEach(function(v) { + function f() { + socket.write(v); + } + assert.throws(f, TypeError); + }); + // Write a string that contains a multi-byte character sequence to test that // `bytesWritten` is incremented with the # of bytes, not # of characters. var a = "L'État, c'est "; From 25410096b4c38eb9b17501ea06349872ab33e1ea Mon Sep 17 00:00:00 2001 From: isaacs Date: Mon, 16 Jan 2012 15:06:16 -0800 Subject: [PATCH 6/6] Update npm to 1.1.0-2 --- deps/npm/.gitmodules | 60 - deps/npm/.npmignore | 1 + deps/npm/AUTHORS | 3 + deps/npm/Makefile | 20 +- deps/npm/bin/npm | 6 + deps/npm/bin/npm-g.cmd | 6 - deps/npm/bin/npm_g.cmd | 6 - deps/npm/doc/cli/config.md | 10 + deps/npm/html/api/bin.html | 2 +- deps/npm/html/api/bugs.html | 2 +- deps/npm/html/api/commands.html | 2 +- deps/npm/html/api/config.html | 2 +- deps/npm/html/api/deprecate.html | 2 +- deps/npm/html/api/docs.html | 2 +- deps/npm/html/api/edit.html | 2 +- deps/npm/html/api/explore.html | 2 +- deps/npm/html/api/help-search.html | 2 +- deps/npm/html/api/init.html | 2 +- deps/npm/html/api/install.html | 2 +- deps/npm/html/api/link.html | 2 +- deps/npm/html/api/load.html | 2 +- deps/npm/html/api/ls.html | 2 +- deps/npm/html/api/npm.html | 4 +- deps/npm/html/api/outdated.html | 2 +- deps/npm/html/api/owner.html | 2 +- deps/npm/html/api/pack.html | 2 +- deps/npm/html/api/prefix.html | 2 +- deps/npm/html/api/prune.html | 2 +- deps/npm/html/api/publish.html | 2 +- deps/npm/html/api/rebuild.html | 2 +- deps/npm/html/api/restart.html | 2 +- deps/npm/html/api/root.html | 2 +- deps/npm/html/api/run-script.html | 2 +- deps/npm/html/api/search.html | 2 +- deps/npm/html/api/start.html | 2 +- deps/npm/html/api/stop.html | 2 +- deps/npm/html/api/submodule.html | 2 +- deps/npm/html/api/tag.html | 2 +- deps/npm/html/api/test.html | 2 +- deps/npm/html/api/uninstall.html | 2 +- deps/npm/html/api/unpublish.html | 2 +- deps/npm/html/api/update.html | 2 +- deps/npm/html/api/version.html | 2 +- deps/npm/html/api/view.html | 2 +- deps/npm/html/api/whoami.html | 2 +- deps/npm/html/doc/README.html | 2 +- deps/npm/html/doc/adduser.html | 2 +- deps/npm/html/doc/bin.html | 2 +- deps/npm/html/doc/bugs.html | 2 +- deps/npm/html/doc/build.html | 2 +- deps/npm/html/doc/bundle.html | 2 +- deps/npm/html/doc/cache.html | 2 +- deps/npm/html/doc/changelog.html | 2 +- deps/npm/html/doc/coding-style.html | 2 +- deps/npm/html/doc/completion.html | 2 +- deps/npm/html/doc/config.html | 12 +- deps/npm/html/doc/deprecate.html | 2 +- deps/npm/html/doc/developers.html | 2 +- deps/npm/html/doc/disputes.html | 2 +- deps/npm/html/doc/docs.html | 2 +- deps/npm/html/doc/edit.html | 2 +- deps/npm/html/doc/explore.html | 2 +- deps/npm/html/doc/faq.html | 2 +- deps/npm/html/doc/folders.html | 2 +- deps/npm/html/doc/help-search.html | 2 +- deps/npm/html/doc/help.html | 2 +- deps/npm/html/doc/index.html | 2 +- deps/npm/html/doc/init.html | 2 +- deps/npm/html/doc/install.html | 2 +- deps/npm/html/doc/json.html | 2 +- deps/npm/html/doc/link.html | 2 +- deps/npm/html/doc/list.html | 2 +- deps/npm/html/doc/npm.html | 4 +- deps/npm/html/doc/outdated.html | 2 +- deps/npm/html/doc/owner.html | 2 +- deps/npm/html/doc/pack.html | 2 +- deps/npm/html/doc/prefix.html | 2 +- deps/npm/html/doc/prune.html | 2 +- deps/npm/html/doc/publish.html | 2 +- deps/npm/html/doc/rebuild.html | 2 +- deps/npm/html/doc/registry.html | 2 +- deps/npm/html/doc/removing-npm.html | 2 +- deps/npm/html/doc/restart.html | 2 +- deps/npm/html/doc/root.html | 2 +- deps/npm/html/doc/run-script.html | 2 +- deps/npm/html/doc/scripts.html | 2 +- deps/npm/html/doc/search.html | 2 +- deps/npm/html/doc/semver.html | 2 +- deps/npm/html/doc/star.html | 2 +- deps/npm/html/doc/start.html | 2 +- deps/npm/html/doc/stop.html | 2 +- deps/npm/html/doc/submodule.html | 2 +- deps/npm/html/doc/tag.html | 2 +- deps/npm/html/doc/test.html | 2 +- deps/npm/html/doc/uninstall.html | 2 +- deps/npm/html/doc/unpublish.html | 2 +- deps/npm/html/doc/update.html | 2 +- deps/npm/html/doc/version.html | 2 +- deps/npm/html/doc/view.html | 2 +- deps/npm/html/doc/whoami.html | 2 +- deps/npm/lib/cache.js | 4 +- deps/npm/lib/init.js | 4 +- deps/npm/lib/install.js | 57 +- deps/npm/lib/submodule.js | 6 +- deps/npm/lib/utils/cmd-shim.js | 46 +- deps/npm/lib/utils/config-defs.js | 6 + deps/npm/lib/utils/error-handler.js | 31 +- deps/npm/lib/utils/ini.js | 2 +- deps/npm/lib/utils/lifecycle.js | 2 +- deps/npm/lib/utils/read-installed.js | 11 + deps/npm/lib/utils/read-json.js | 18 +- deps/npm/lib/version.js | 12 +- deps/npm/man/man1/config.1 | 18 + deps/npm/man/man1/npm.1 | 2 +- deps/npm/man/man3/npm.3 | 2 +- deps/npm/node_modules/fast-list/README.md | 5 + deps/npm/node_modules/fast-list/fast-list.js | 58 +- deps/npm/node_modules/fast-list/package.json | 4 +- deps/npm/node_modules/ini/README.md | 2 +- deps/npm/node_modules/ini/ini.js | 7 +- deps/npm/node_modules/ini/package.json | 2 +- deps/npm/node_modules/minimatch/README.md | 158 ++- deps/npm/node_modules/minimatch/minimatch.js | 1143 +++++++++++++---- deps/npm/node_modules/minimatch/package.json | 6 +- deps/npm/node_modules/node-uuid/README.md | 30 +- deps/npm/node_modules/node-uuid/package.json | 4 +- deps/npm/node_modules/node-uuid/uuid.js | 212 ++- deps/npm/node_modules/request/README.md | 5 +- deps/npm/node_modules/request/forever.js | 84 ++ deps/npm/node_modules/request/main.js | 126 +- deps/npm/node_modules/request/oauth.js | 15 +- deps/npm/node_modules/request/package.json | 2 +- .../request/vendor/cookie/index.js | 15 +- deps/npm/node_modules/rimraf/package.json | 2 +- deps/npm/node_modules/rimraf/rimraf.js | 15 +- deps/npm/node_modules/semver/package.json | 2 +- deps/npm/node_modules/semver/semver.js | 4 +- deps/npm/node_modules/tar/lib/parse.js | 11 + deps/npm/node_modules/tar/package.json | 4 +- deps/npm/package.json | 179 +-- deps/npm/scripts/doc-build.sh | 8 +- .../npm-test-optional-deps/package.json | 10 + 142 files changed, 1835 insertions(+), 809 deletions(-) delete mode 100644 deps/npm/.gitmodules create mode 100755 deps/npm/bin/npm delete mode 100644 deps/npm/bin/npm-g.cmd delete mode 100644 deps/npm/bin/npm_g.cmd create mode 100644 deps/npm/node_modules/request/forever.js create mode 100644 deps/npm/test/packages/npm-test-optional-deps/package.json diff --git a/deps/npm/.gitmodules b/deps/npm/.gitmodules deleted file mode 100644 index 169c87505..000000000 --- a/deps/npm/.gitmodules +++ /dev/null @@ -1,60 +0,0 @@ -[submodule "node_modules/semver"] - path = node_modules/semver - url = https://github.com/isaacs/node-semver.git -[submodule "node_modules/abbrev"] - path = node_modules/abbrev - url = https://github.com/isaacs/abbrev-js.git -[submodule "node_modules/nopt"] - path = node_modules/nopt - url = https://github.com/isaacs/nopt.git -[submodule "node_modules/node-uuid"] - path = node_modules/node-uuid - url = https://github.com/broofa/node-uuid -[submodule "node_modules/minimatch"] - path = node_modules/minimatch - url = https://github.com/isaacs/minimatch.git -[submodule "node_modules/graceful-fs"] - path = node_modules/graceful-fs - url = https://github.com/isaacs/node-graceful-fs.git -[submodule "node_modules/slide"] - path = node_modules/slide - url = https://github.com/isaacs/slide-flow-control.git -[submodule "node_modules/rimraf"] - path = node_modules/rimraf - url = https://github.com/isaacs/rimraf.git -[submodule "node_modules/proto-list"] - path = node_modules/proto-list - url = https://github.com/isaacs/proto-list.git -[submodule "node_modules/ini"] - path = node_modules/ini - url = https://github.com/isaacs/ini.git -[submodule "node_modules/which"] - path = node_modules/which - url = https://github.com/isaacs/node-which.git -[submodule "node_modules/request"] - path = node_modules/request - url = https://github.com/mikeal/request.git -[submodule "node_modules/tar"] - path = node_modules/tar - url = https://github.com/isaacs/node-tar.git -[submodule "node_modules/fstream"] - path = node_modules/fstream - url = https://github.com/isaacs/fstream.git -[submodule "node_modules/inherits"] - path = node_modules/inherits - url = https://github.com/isaacs/inherits.git -[submodule "node_modules/block-stream"] - path = node_modules/block-stream - url = https://github.com/isaacs/block-stream.git -[submodule "node_modules/mkdirp"] - path = node_modules/mkdirp - url = https://github.com/isaacs/node-mkdirp.git -[submodule "node_modules/fast-list"] - path = node_modules/fast-list - url = https://github.com/isaacs/fast-list.git -[submodule "node_modules/read"] - path = node_modules/read - url = https://github.com/isaacs/read.git -[submodule "node_modules/lru-cache"] - path = node_modules/lru-cache - url = https://github.com/isaacs/node-lru-cache.git diff --git a/deps/npm/.npmignore b/deps/npm/.npmignore index 7ba078e51..6ab186883 100644 --- a/deps/npm/.npmignore +++ b/deps/npm/.npmignore @@ -10,3 +10,4 @@ node_modules/.bin npm-debug.log ./npmrc .gitignore +release/ diff --git a/deps/npm/AUTHORS b/deps/npm/AUTHORS index 59d7257e8..c977af8c4 100644 --- a/deps/npm/AUTHORS +++ b/deps/npm/AUTHORS @@ -48,3 +48,6 @@ Jameson Little cspotcode Maciej Małecki Stephen Sugden +Gautham Pai +David Trejo +Paul Vorbach diff --git a/deps/npm/Makefile b/deps/npm/Makefile index 7d3e10653..415a1b3d6 100644 --- a/deps/npm/Makefile +++ b/deps/npm/Makefile @@ -27,12 +27,9 @@ mandocs = $(api_mandocs) $(cli_mandocs) htmldocs = $(api_htmldocs) $(cli_htmldocs) -all: submodules doc +all: doc -submodules: - ! [ -d .git ] || git submodule update --init --recursive - -latest: submodules +latest: @echo "Installing latest published npm" @echo "Use 'make install' or 'make link' to install the code" @echo "in this folder that you're looking at right now." @@ -51,7 +48,7 @@ clean: doc-clean uninstall rm npmrc node cli.js cache clean -uninstall: submodules +uninstall: node cli.js rm npm -g -f doc: $(mandocs) $(htmldocs) @@ -94,14 +91,14 @@ html/api/%.html: doc/api/%.md html/dochead.html html/docfoot.html scripts/doc-bu doc/cli/index.md: $(markdowns) scripts/index-build.js scripts/doc-build.sh package.json node scripts/index-build.js > $@ -node_modules/ronn: +node_modules/.bin/ronn: node cli.js install https://github.com/isaacs/ronnjs/tarball/master doc: man man: $(cli_docs) $(api_docs) -test: submodules +test: node cli.js test version: link @@ -109,9 +106,10 @@ version: link git ci -m v$(shell npm -v) publish: link doc - git tag -d v$(shell npm -v) || true - git push origin :v$(shell npm -v) || true - npm unpublish npm@$(shell npm -v) || true + @git tag -d v$(shell npm -v) || true + @git push origin :v$(shell npm -v) || true + @npm unpublish npm@$(shell npm -v) || true + git clean -fd git tag -s -m v$(shell npm -v) v$(shell npm -v) &&\ git push origin --tags &&\ npm publish &&\ diff --git a/deps/npm/bin/npm b/deps/npm/bin/npm new file mode 100755 index 000000000..5fbcd3b03 --- /dev/null +++ b/deps/npm/bin/npm @@ -0,0 +1,6 @@ +#!/bin/sh +if [ -x "`dirname "$0"`/node.exe" ]; then + "`dirname "$0"`/node.exe" "`dirname "$0"`/node_modules/npm/bin/npm-cli.js" "$@" +else + node "`dirname "$0"`/node_modules/npm/bin/npm-cli.js" "$@" +fi diff --git a/deps/npm/bin/npm-g.cmd b/deps/npm/bin/npm-g.cmd deleted file mode 100644 index bac9e5f1c..000000000 --- a/deps/npm/bin/npm-g.cmd +++ /dev/null @@ -1,6 +0,0 @@ -:: Created by npm, please don't edit manually. -@IF EXIST "%~dp0"\"node.exe" ( - "%~dp0"\"node.exe" "%~dp0\.\node_modules\npm\bin\npm-cli.js" %* -) ELSE ( - node "%~dp0\.\node_modules\npm\bin\npm-cli.js" %* -) \ No newline at end of file diff --git a/deps/npm/bin/npm_g.cmd b/deps/npm/bin/npm_g.cmd deleted file mode 100644 index bac9e5f1c..000000000 --- a/deps/npm/bin/npm_g.cmd +++ /dev/null @@ -1,6 +0,0 @@ -:: Created by npm, please don't edit manually. -@IF EXIST "%~dp0"\"node.exe" ( - "%~dp0"\"node.exe" "%~dp0\.\node_modules\npm\bin\npm-cli.js" %* -) ELSE ( - node "%~dp0\.\node_modules\npm\bin\npm-cli.js" %* -) \ No newline at end of file diff --git a/deps/npm/doc/cli/config.md b/deps/npm/doc/cli/config.md index e70acc258..2c6ca26c0 100644 --- a/deps/npm/doc/cli/config.md +++ b/deps/npm/doc/cli/config.md @@ -101,6 +101,7 @@ The following shorthands are parsed on the command-line: * `-v`: `--version` * `-h`, `-?`, `--help`, `-H`: `--usage` * `-s`, `--silent`: `--loglevel silent` +* `-q`, `--quiet`: `--loglevel warn` * `-d`: `--loglevel info` * `-dd`, `--verbose`: `--loglevel verbose` * `-ddd`: `--loglevel silly` @@ -278,6 +279,15 @@ Makes various commands more forceful. * skips cache when requesting from the registry. * prevents checks against clobbering non-npm files. +### git + +* Default: `"git"` +* Type: String + +The command to use for git commands. If git is installed on the +computer, but is not in the `PATH`, then set this to the full path to +the git binary. + ### global * Default: false diff --git a/deps/npm/html/api/bin.html b/deps/npm/html/api/bin.html index a5bd3325c..c4392671d 100644 --- a/deps/npm/html/api/bin.html +++ b/deps/npm/html/api/bin.html @@ -19,7 +19,7 @@

This function should not be used programmatically. Instead, just refer to the npm.bin member.

- +