├── .DS_Store ├── .babelrc ├── .gitignore ├── LICENSE ├── README.md ├── bsdiff-4.3 ├── .DS_Store ├── Makefile ├── bsdiff ├── bsdiff.1 ├── bsdiff.c ├── bspatch ├── bspatch.1 ├── bspatch.c ├── c.patch ├── test_a.txt ├── test_b.txt └── test_c.txt ├── index.js ├── index_old.js ├── package-lock.json ├── package.json ├── public ├── .DS_Store ├── .gitignore ├── dist │ └── business │ │ └── tag1_v_100_min.bundle.patch └── original │ ├── business │ └── tag1_v_100_min.bundle │ └── common_min.bundle ├── src ├── entity │ ├── BusinessInfo.js │ └── PatchVersionInfo.js ├── service │ ├── BusinessManager.js │ └── PatchManager.js └── utils │ └── Log.js └── test.js /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarcusMa/simple-react-native-hot-code-push-server/ec66fb3b56a713cb990f5b7319b3b2dd341858c3/.DS_Store -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["latest"] 3 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | 6 | # Runtime data 7 | pids 8 | *.pid 9 | *.seed 10 | 11 | # Directory for instrumented libs generated by jscoverage/JSCover 12 | lib-cov 13 | 14 | # Coverage directory used by tools like istanbul 15 | coverage 16 | 17 | # nyc test coverage 18 | .nyc_output 19 | 20 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 21 | .grunt 22 | 23 | # node-waf configuration 24 | .lock-wscript 25 | 26 | # Compiled binary addons (http://nodejs.org/api/addons.html) 27 | build/Release 28 | 29 | # Dependency directories 30 | node_modules 31 | jspm_packages 32 | 33 | # Optional npm cache directory 34 | .npm 35 | 36 | # Optional REPL history 37 | .node_repl_history 38 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Marcus Ma 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # simple-react-native-hot-code-push-server 2 | 3 | ## 摘要 (Abstract) 4 | 5 | 配合simple-react-native-hot-code-push的服务器端代码,使用Node.js和Express框架构建。 6 | 7 | > 注意:由于本项目使用了bsdiff进行分包操作,而bsdiff的命令行目前只支持了Mac和Linux,故不能在Window系统中运行。 8 | 9 | This project builded for providing ths management service of react native. Node.js and Express.js was used in this project. 10 | 11 | > NOTICE: As for using bsdiff algrithm in the this project, the cmd of bsdiff only be supported with MAC and Linux system, **NOT** with Window system. 12 | 13 | ## 业务与功能 (Functions) 14 | 15 | 服务器将完整的jsbundle包拆分为一个**公共包**和一个**业务包**,拆分使用的是bsDiff算法,(可以自行替换成为google-diff-match-patch,两个算法的比较见[compare-file-diff-tools](https://github.com/MarcusMa/compare-file-diff-tools),客户端检查更新时,服务器端会根据客户端包的信息发送对应的升级包下载地址和哈希值。 16 | 17 | The sever can diff your jsbundle to a small patch file named "**business package**" with a common jsbundle file named "**common package**". I compare two different algrithm: *google-diff-match-patch* and *bsdiff*, and I choose the *bsdiff* finally, as the performance is good in the client side (more deials about the compatition, please see [compare-file-diff-tools](https://github.com/MarcusMa/compare-file-diff-tools)). When the client requests to the server for checking, the server would response the update information (include download url and hashcode of the file). 18 | 19 | ## 使用方法 (Usage) 20 | 21 | 1. 环境要求 Mac 或者 Linux 系统 22 | 1. 安装 *node.js*,操作可百度或谷歌; 23 | 1. 进入到本项目根目录,执行`npm install`(若`npm`不能使用,可切换成`cnpm`); 24 | 1. 在根目录下执行`node index`, 完成服务器启动; 25 | 1. 若有要测试新的更新包,请将文件防止在`public/original/business`目录下,同时命名方式参照该目录下已有的文件格式,之后重启服务即可完成新包的发布。 26 | 27 | > 注意: 如果你使用了不同版本的RN,你也新生成一个common包,并将它放置到`public/original/`下, 但需要诸多配置(服务器端和客户端都需要做相应修改),在未完全理解该文件的使用方法的情况下建议无需更改。 28 | 29 | 1. Supported system environment: Mac or Linux. 30 | 1. Install *node.js*. 31 | 1. Entry the root dir of project, and execute `npm install` in the terminal. 32 | 1. Start the server by execute `node index` in the terminal. 33 | 1. Put your rewrited jsbundle file in the dir `public/original/business`, please notice the formate of your filename, and restart the server. 34 | 35 | > NOTICE: It is **NOT** Nececessary to update the *common_min.bundle* file, event if you used differnt version of the React Native. 36 | 37 | ## 接口说明 (API) 38 | 39 | ### /checkForUpdate 40 | 41 | * 接口请求示例 (Example for Request in the client) 42 | 43 | ``` 44 | { 45 | businessList:[ 46 | { 47 | id:"AAF047B7-E816-2AE0-949A-D5FB4CE40245" 48 | hashcode:"01824139386045ca6739dd52b3bfb74a76b9b99fefb336f4e1a147a182cad6ba" 49 | } 50 | ] 51 | } 52 | ``` 53 | 54 | * 接口返回示例 (Example for Response in the server) 55 | 56 | ``` 57 | { 58 | success: 1, 59 | msg: "成功" 60 | data: [{ 61 | id: "AAF047B7-E816-2AE0-949A-D5FB4CE40245", 62 | verifyHashCode: "01824139386045ca6739dd52b3bfb74a76b9b99fefb336f4e1a147a182cad6ba", 63 | latestPatch: { 64 | hashCode: "c1bbdc02200b5e5a72cf97bbdc3339165e71182c61f", 65 | downloadUrl: "http://download.marcusma.com/rn/marcusma.patch", 66 | } 67 | } 68 | ] 69 | } 70 | ``` 71 | -------------------------------------------------------------------------------- /bsdiff-4.3/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarcusMa/simple-react-native-hot-code-push-server/ec66fb3b56a713cb990f5b7319b3b2dd341858c3/bsdiff-4.3/.DS_Store -------------------------------------------------------------------------------- /bsdiff-4.3/Makefile: -------------------------------------------------------------------------------- 1 | CFLAGS += -O3 -lbz2 2 | 3 | PREFIX ?= /usr/local 4 | INSTALL_PROGRAM ?= ${INSTALL} -c -s -m 555 5 | INSTALL_MAN ?= ${INSTALL} -c -m 444 6 | 7 | all: bsdiff bspatch 8 | bsdiff: bsdiff.c 9 | bspatch: bspatch.c 10 | 11 | install: 12 | ${INSTALL_PROGRAM} bsdiff bspatch ${PREFIX}/bin 13 | .ifndef WITHOUT_MAN 14 | ${INSTALL_MAN} bsdiff.1 bspatch.1 ${PREFIX}/man/man1 15 | .endif 16 | -------------------------------------------------------------------------------- /bsdiff-4.3/bsdiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarcusMa/simple-react-native-hot-code-push-server/ec66fb3b56a713cb990f5b7319b3b2dd341858c3/bsdiff-4.3/bsdiff -------------------------------------------------------------------------------- /bsdiff-4.3/bsdiff.1: -------------------------------------------------------------------------------- 1 | .\"- 2 | .\" Copyright 2003-2005 Colin Percival 3 | .\" All rights reserved 4 | .\" 5 | .\" Redistribution and use in source and binary forms, with or without 6 | .\" modification, are permitted providing that the following conditions 7 | .\" are met: 8 | .\" 1. Redistributions of source code must retain the above copyright 9 | .\" notice, this list of conditions and the following disclaimer. 10 | .\" 2. Redistributions in binary form must reproduce the above copyright 11 | .\" notice, this list of conditions and the following disclaimer in the 12 | .\" documentation and/or other materials provided with the distribution. 13 | .\" 14 | .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 15 | .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 18 | .\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 22 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 23 | .\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | .\" POSSIBILITY OF SUCH DAMAGE. 25 | .\" 26 | .\" $FreeBSD: src/usr.bin/bsdiff/bsdiff/bsdiff.1,v 1.1 2005/08/06 01:59:05 cperciva Exp $ 27 | .\" 28 | .Dd May 18, 2003 29 | .Dt BSDIFF 1 30 | .Os FreeBSD 31 | .Sh NAME 32 | .Nm bsdiff 33 | .Nd generate a patch between two binary files 34 | .Sh SYNOPSIS 35 | .Nm 36 | .Ao Ar oldfile Ac Ao Ar newfile Ac Ao Ar patchfile Ac 37 | .Sh DESCRIPTION 38 | .Nm 39 | compares 40 | .Ao Ar oldfile Ac 41 | to 42 | .Ao Ar newfile Ac 43 | and writes to 44 | .Ao Ar patchfile Ac 45 | a binary patch suitable for use by bspatch(1). 46 | When 47 | .Ao Ar oldfile Ac 48 | and 49 | .Ao Ar newfile Ac 50 | are two versions of an executable program, the 51 | patches produced are on average a factor of five smaller 52 | than those produced by any other binary patch tool known 53 | to the author. 54 | .Pp 55 | .Nm 56 | uses memory equal to 17 times the size of 57 | .Ao Ar oldfile Ac , 58 | and requires 59 | an absolute minimum working set size of 8 times the size of oldfile. 60 | .Sh SEE ALSO 61 | .Xr bspatch 1 62 | .Sh AUTHORS 63 | .An Colin Percival Aq cperciva@freebsd.org 64 | -------------------------------------------------------------------------------- /bsdiff-4.3/bsdiff.c: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright 2003-2005 Colin Percival 3 | * All rights reserved 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted providing that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 15 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 18 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 22 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 23 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #if 0 28 | __FBSDID("$FreeBSD: src/usr.bin/bsdiff/bsdiff/bsdiff.c,v 1.1 2005/08/06 01:59:05 cperciva Exp $"); 29 | #endif 30 | 31 | #include 32 | 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | #define MIN(x,y) (((x)<(y)) ? (x) : (y)) 42 | 43 | static void split(off_t *I,off_t *V,off_t start,off_t len,off_t h) 44 | { 45 | off_t i,j,k,x,tmp,jj,kk; 46 | 47 | if(len<16) { 48 | for(k=start;kstart) split(I,V,start,jj-start,h); 97 | 98 | for(i=0;ikk) split(I,V,kk,start+len-kk,h); 102 | } 103 | 104 | static void qsufsort(off_t *I,off_t *V,u_char *old,off_t oldsize) 105 | { 106 | off_t buckets[256]; 107 | off_t i,h,len; 108 | 109 | for(i=0;i<256;i++) buckets[i]=0; 110 | for(i=0;i0;i--) buckets[i]=buckets[i-1]; 113 | buckets[0]=0; 114 | 115 | for(i=0;iy) { 162 | *pos=I[st]; 163 | return x; 164 | } else { 165 | *pos=I[en]; 166 | return y; 167 | } 168 | }; 169 | 170 | x=st+(en-st)/2; 171 | if(memcmp(old+I[x],new,MIN(oldsize-I[x],newsize))<0) { 172 | return search(I,old,oldsize,new,newsize,x,en,pos); 173 | } else { 174 | return search(I,old,oldsize,new,newsize,st,x,pos); 175 | }; 176 | } 177 | 178 | static void offtout(off_t x,u_char *buf) 179 | { 180 | off_t y; 181 | 182 | if(x<0) y=-x; else y=x; 183 | 184 | buf[0]=y%256;y-=buf[0]; 185 | y=y/256;buf[1]=y%256;y-=buf[1]; 186 | y=y/256;buf[2]=y%256;y-=buf[2]; 187 | y=y/256;buf[3]=y%256;y-=buf[3]; 188 | y=y/256;buf[4]=y%256;y-=buf[4]; 189 | y=y/256;buf[5]=y%256;y-=buf[5]; 190 | y=y/256;buf[6]=y%256;y-=buf[6]; 191 | y=y/256;buf[7]=y%256; 192 | 193 | if(x<0) buf[7]|=0x80; 194 | } 195 | 196 | int main(int argc,char *argv[]) 197 | { 198 | int fd; 199 | u_char *old,*new; 200 | off_t oldsize,newsize; 201 | off_t *I,*V; 202 | off_t scan,pos,len; 203 | off_t lastscan,lastpos,lastoffset; 204 | off_t oldscore,scsc; 205 | off_t s,Sf,lenf,Sb,lenb; 206 | off_t overlap,Ss,lens; 207 | off_t i; 208 | off_t dblen,eblen; 209 | u_char *db,*eb; 210 | u_char buf[8]; 211 | u_char header[32]; 212 | FILE * pf; 213 | BZFILE * pfbz2; 214 | int bz2err; 215 | 216 | if(argc!=4) errx(1,"usage: %s oldfile newfile patchfile\n",argv[0]); 217 | 218 | /* Allocate oldsize+1 bytes instead of oldsize bytes to ensure 219 | that we never try to malloc(0) and get a NULL pointer */ 220 | if(((fd=open(argv[1],O_RDONLY,0))<0) || 221 | ((oldsize=lseek(fd,0,SEEK_END))==-1) || 222 | ((old=malloc(oldsize+1))==NULL) || 223 | (lseek(fd,0,SEEK_SET)!=0) || 224 | (read(fd,old,oldsize)!=oldsize) || 225 | (close(fd)==-1)) err(1,"%s",argv[1]); 226 | 227 | if(((I=malloc((oldsize+1)*sizeof(off_t)))==NULL) || 228 | ((V=malloc((oldsize+1)*sizeof(off_t)))==NULL)) err(1,NULL); 229 | 230 | qsufsort(I,V,old,oldsize); 231 | 232 | free(V); 233 | 234 | /* Allocate newsize+1 bytes instead of newsize bytes to ensure 235 | that we never try to malloc(0) and get a NULL pointer */ 236 | if(((fd=open(argv[2],O_RDONLY,0))<0) || 237 | ((newsize=lseek(fd,0,SEEK_END))==-1) || 238 | ((new=malloc(newsize+1))==NULL) || 239 | (lseek(fd,0,SEEK_SET)!=0) || 240 | (read(fd,new,newsize)!=newsize) || 241 | (close(fd)==-1)) err(1,"%s",argv[2]); 242 | 243 | if(((db=malloc(newsize+1))==NULL) || 244 | ((eb=malloc(newsize+1))==NULL)) err(1,NULL); 245 | dblen=0; 246 | eblen=0; 247 | 248 | /* Create the patch file */ 249 | if ((pf = fopen(argv[3], "w")) == NULL) 250 | err(1, "%s", argv[3]); 251 | 252 | /* Header is 253 | 0 8 "BSDIFF40" 254 | 8 8 length of bzip2ed ctrl block 255 | 16 8 length of bzip2ed diff block 256 | 24 8 length of new file */ 257 | /* File is 258 | 0 32 Header 259 | 32 ?? Bzip2ed ctrl block 260 | ?? ?? Bzip2ed diff block 261 | ?? ?? Bzip2ed extra block */ 262 | memcpy(header,"BSDIFF40",8); 263 | offtout(0, header + 8); 264 | offtout(0, header + 16); 265 | offtout(newsize, header + 24); 266 | if (fwrite(header, 32, 1, pf) != 1) 267 | err(1, "fwrite(%s)", argv[3]); 268 | 269 | /* Compute the differences, writing ctrl as we go */ 270 | if ((pfbz2 = BZ2_bzWriteOpen(&bz2err, pf, 9, 0, 0)) == NULL) 271 | errx(1, "BZ2_bzWriteOpen, bz2err = %d", bz2err); 272 | scan=0;len=0; 273 | lastscan=0;lastpos=0;lastoffset=0; 274 | while(scanoldscore+8)) break; 288 | 289 | if((scan+lastoffsetSf*2-lenf) { Sf=s; lenf=i; }; 300 | }; 301 | 302 | lenb=0; 303 | if(scan=lastscan+i)&&(pos>=i);i++) { 306 | if(old[pos-i]==new[scan-i]) s++; 307 | if(s*2-i>Sb*2-lenb) { Sb=s; lenb=i; }; 308 | }; 309 | }; 310 | 311 | if(lastscan+lenf>scan-lenb) { 312 | overlap=(lastscan+lenf)-(scan-lenb); 313 | s=0;Ss=0;lens=0; 314 | for(i=0;iSs) { Ss=s; lens=i+1; }; 320 | }; 321 | 322 | lenf+=lens-overlap; 323 | lenb-=lens; 324 | }; 325 | 326 | for(i=0;i 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | static off_t offtin(u_char *buf) 41 | { 42 | off_t y; 43 | 44 | y=buf[7]&0x7F; 45 | y=y*256;y+=buf[6]; 46 | y=y*256;y+=buf[5]; 47 | y=y*256;y+=buf[4]; 48 | y=y*256;y+=buf[3]; 49 | y=y*256;y+=buf[2]; 50 | y=y*256;y+=buf[1]; 51 | y=y*256;y+=buf[0]; 52 | 53 | if(buf[7]&0x80) y=-y; 54 | 55 | return y; 56 | } 57 | 58 | int main(int argc,char * argv[]) 59 | { 60 | FILE * f, * cpf, * dpf, * epf; 61 | BZFILE * cpfbz2, * dpfbz2, * epfbz2; 62 | int cbz2err, dbz2err, ebz2err; 63 | int fd; 64 | ssize_t oldsize,newsize; 65 | ssize_t bzctrllen,bzdatalen; 66 | u_char header[32],buf[8]; 67 | u_char *old, *new; 68 | off_t oldpos,newpos; 69 | off_t ctrl[3]; 70 | off_t lenread; 71 | off_t i; 72 | 73 | if(argc!=4) errx(1,"usage: %s oldfile newfile patchfile\n",argv[0]); 74 | 75 | /* Open patch file */ 76 | if ((f = fopen(argv[3], "r")) == NULL) 77 | err(1, "fopen(%s)", argv[3]); 78 | 79 | /* 80 | File format: 81 | 0 8 "BSDIFF40" 82 | 8 8 X 83 | 16 8 Y 84 | 24 8 sizeof(newfile) 85 | 32 X bzip2(control block) 86 | 32+X Y bzip2(diff block) 87 | 32+X+Y ??? bzip2(extra block) 88 | with control block a set of triples (x,y,z) meaning "add x bytes 89 | from oldfile to x bytes from the diff block; copy y bytes from the 90 | extra block; seek forwards in oldfile by z bytes". 91 | */ 92 | 93 | /* Read header */ 94 | if (fread(header, 1, 32, f) < 32) { 95 | if (feof(f)) 96 | errx(1, "Corrupt patch\n"); 97 | err(1, "fread(%s)", argv[3]); 98 | } 99 | 100 | /* Check for appropriate magic */ 101 | if (memcmp(header, "BSDIFF40", 8) != 0) 102 | errx(1, "Corrupt patch\n"); 103 | 104 | /* Read lengths from header */ 105 | bzctrllen=offtin(header+8); 106 | bzdatalen=offtin(header+16); 107 | newsize=offtin(header+24); 108 | if((bzctrllen<0) || (bzdatalen<0) || (newsize<0)) 109 | errx(1,"Corrupt patch\n"); 110 | 111 | /* Close patch file and re-open it via libbzip2 at the right places */ 112 | if (fclose(f)) 113 | err(1, "fclose(%s)", argv[3]); 114 | if ((cpf = fopen(argv[3], "r")) == NULL) 115 | err(1, "fopen(%s)", argv[3]); 116 | if (fseeko(cpf, 32, SEEK_SET)) 117 | err(1, "fseeko(%s, %lld)", argv[3], 118 | (long long)32); 119 | if ((cpfbz2 = BZ2_bzReadOpen(&cbz2err, cpf, 0, 0, NULL, 0)) == NULL) 120 | errx(1, "BZ2_bzReadOpen, bz2err = %d", cbz2err); 121 | if ((dpf = fopen(argv[3], "r")) == NULL) 122 | err(1, "fopen(%s)", argv[3]); 123 | if (fseeko(dpf, 32 + bzctrllen, SEEK_SET)) 124 | err(1, "fseeko(%s, %lld)", argv[3], 125 | (long long)(32 + bzctrllen)); 126 | if ((dpfbz2 = BZ2_bzReadOpen(&dbz2err, dpf, 0, 0, NULL, 0)) == NULL) 127 | errx(1, "BZ2_bzReadOpen, bz2err = %d", dbz2err); 128 | if ((epf = fopen(argv[3], "r")) == NULL) 129 | err(1, "fopen(%s)", argv[3]); 130 | if (fseeko(epf, 32 + bzctrllen + bzdatalen, SEEK_SET)) 131 | err(1, "fseeko(%s, %lld)", argv[3], 132 | (long long)(32 + bzctrllen + bzdatalen)); 133 | if ((epfbz2 = BZ2_bzReadOpen(&ebz2err, epf, 0, 0, NULL, 0)) == NULL) 134 | errx(1, "BZ2_bzReadOpen, bz2err = %d", ebz2err); 135 | 136 | if(((fd=open(argv[1],O_RDONLY,0))<0) || 137 | ((oldsize=lseek(fd,0,SEEK_END))==-1) || 138 | ((old=malloc(oldsize+1))==NULL) || 139 | (lseek(fd,0,SEEK_SET)!=0) || 140 | (read(fd,old,oldsize)!=oldsize) || 141 | (close(fd)==-1)) err(1,"%s",argv[1]); 142 | if((new=malloc(newsize+1))==NULL) err(1,NULL); 143 | 144 | oldpos=0;newpos=0; 145 | while(newposnewsize) 157 | errx(1,"Corrupt patch\n"); 158 | 159 | /* Read diff string */ 160 | lenread = BZ2_bzRead(&dbz2err, dpfbz2, new + newpos, ctrl[0]); 161 | if ((lenread < ctrl[0]) || 162 | ((dbz2err != BZ_OK) && (dbz2err != BZ_STREAM_END))) 163 | errx(1, "Corrupt patch\n"); 164 | 165 | /* Add old data to diff string */ 166 | for(i=0;i=0) && (oldpos+inewsize) 176 | errx(1,"Corrupt patch\n"); 177 | 178 | /* Read extra string */ 179 | lenread = BZ2_bzRead(&ebz2err, epfbz2, new + newpos, ctrl[1]); 180 | if ((lenread < ctrl[1]) || 181 | ((ebz2err != BZ_OK) && (ebz2err != BZ_STREAM_END))) 182 | errx(1, "Corrupt patch\n"); 183 | 184 | /* Adjust pointers */ 185 | newpos+=ctrl[1]; 186 | oldpos+=ctrl[2]; 187 | }; 188 | 189 | /* Clean up the bzip2 reads */ 190 | BZ2_bzReadClose(&cbz2err, cpfbz2); 191 | BZ2_bzReadClose(&dbz2err, dpfbz2); 192 | BZ2_bzReadClose(&ebz2err, epfbz2); 193 | if (fclose(cpf) || fclose(dpf) || fclose(epf)) 194 | err(1, "fclose(%s)", argv[3]); 195 | 196 | /* Write the new file */ 197 | if(((fd=open(argv[2],O_CREAT|O_TRUNC|O_WRONLY,0666))<0) || 198 | (write(fd,new,newsize)!=newsize) || (close(fd)==-1)) 199 | err(1,"%s",argv[2]); 200 | 201 | free(new); 202 | free(old); 203 | 204 | return 0; 205 | } 206 | -------------------------------------------------------------------------------- /bsdiff-4.3/c.patch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarcusMa/simple-react-native-hot-code-push-server/ec66fb3b56a713cb990f5b7319b3b2dd341858c3/bsdiff-4.3/c.patch -------------------------------------------------------------------------------- /bsdiff-4.3/test_a.txt: -------------------------------------------------------------------------------- 1 | AAAAAAAAAAAA 2 | -------------------------------------------------------------------------------- /bsdiff-4.3/test_b.txt: -------------------------------------------------------------------------------- 1 | AAAAAAAAAAAA 2 | BBBBBBBBBBBB -------------------------------------------------------------------------------- /bsdiff-4.3/test_c.txt: -------------------------------------------------------------------------------- 1 | AAAAAAAAAAAA 2 | BBBBBBBBBBBB -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Main 3 | * Copyright(c) 2009-2017 Marcus Ma 4 | * E-mail:maji1991@sina.com 5 | * GitHub : https://github.com/MarcusMa 6 | * MIT Licensed 7 | */ 8 | 'use strict'; 9 | 10 | /** 11 | * Module dependencies. 12 | */ 13 | const express = require('express'); 14 | const bodyParser = require('body-parser'); 15 | /** 16 | * Custom module dependencies. 17 | */ 18 | const Log = require('./src/utils/Log'); 19 | const path = require('path'); 20 | const BusinessManager = require('./src/service/BusinessManager'); 21 | const PatchManager = require('./src/service/PatchManager'); 22 | const BusinessInfo = require('./src/entity/BusinessInfo'); 23 | const PatchVersionInfo = require('./src/entity/PatchVersionInfo'); 24 | 25 | /** 26 | * Constants 27 | */ 28 | const TAG = "RN_CODE_PUSH_SERVER"; 29 | const SERVER_PORT = 8888; 30 | 31 | /** 32 | * Services 33 | */ 34 | var businessManager = null; 35 | var patchManger = null; 36 | 37 | const responseJson = { 38 | "success": 1, 39 | "data": null, 40 | "msg": null 41 | }; 42 | 43 | /** Server Settings */ 44 | const app = express(); 45 | app.use(express.static(path.join(__dirname, 'public'))); 46 | app.use(bodyParser.json({ 47 | limit: '1mb' 48 | })); 49 | 50 | app.use(bodyParser.urlencoded({ 51 | extended: true 52 | })); 53 | 54 | /** 55 | * For test the server is running successfully. 56 | */ 57 | app.get('/test', function (req, res) { 58 | Log.i(TAG, "/test with params" + req.query); 59 | res.send("Access successful"); 60 | }); 61 | 62 | /** 63 | * For check there is a new patch can be used. 64 | */ 65 | app.post('/checkForUpdate', function (req, res) { 66 | Log.i(TAG, "Call /checkForUpdate"); 67 | // Log.i(TAG,JSON.stringify(req.params)); 68 | Log.i(TAG, "Request body:"); 69 | Log.i(TAG, JSON.stringify(req.body)); 70 | var reqBody = req.body; 71 | var clientInfoList = []; 72 | clientInfoList = reqBody.localBusinessList; 73 | var remoteBuinessList = []; 74 | if (clientInfoList instanceof Array) { 75 | clientInfoList.forEach(function (tmp) { 76 | let businessInfo = businessManager.getBusinessInfoById(tmp.id); 77 | if (null != businessInfo) { 78 | let respData = { 79 | id: tmp.id, 80 | verifyHashCode: "" 81 | }; 82 | // check the hashcode. 83 | if (businessInfo.isPatchVersionExist(tmp.localPackageHashCode)) { 84 | Log.i(TAG, "exitVersion : " + tmp.localPackageHashCode); 85 | respData.verifyHashCode = tmp.localPackageHashCode; 86 | } else { 87 | Log.i(TAG, "No Such Version " + tmp.localPackageHashCode); 88 | respData.verifyHashCode = ""; 89 | } 90 | // check the new versions 91 | let latestPatchInfo = businessInfo.getLatestPatchInfo(); 92 | if (latestPatchInfo.hashCode == tmp.localPackageHashCode) { 93 | // no versions 94 | } else { 95 | respData.latestPatch = { 96 | hashCode: latestPatchInfo.hashCode, 97 | downloadUrl: latestPatchInfo.getDownloadUrl() 98 | }; 99 | } 100 | // add to the response 101 | remoteBuinessList.push(respData); 102 | } 103 | }); 104 | } 105 | 106 | // 处理未传入的businessId 107 | businessManager.businessMap.forEach(function (tmp) { 108 | let isExist = false; 109 | if (clientInfoList instanceof Array) { 110 | for (let j = 0; j < clientInfoList.length; j++) { 111 | if (clientInfoList[j].businessId == tmp.businessId) { 112 | isExist = true; 113 | break; 114 | } 115 | } 116 | } 117 | if (!isExist) { 118 | let respData = { 119 | id: tmp.businessId, 120 | verifyHashCode: "" 121 | }; 122 | let latestPatchInfo = tmp.getLatestPatchInfo(); 123 | respData.latestPatch = { 124 | hashCode: latestPatchInfo.hashCode, 125 | downloadUrl: latestPatchInfo.getDownloadUrl() 126 | }; 127 | remoteBuinessList.push(respData); 128 | } 129 | }); 130 | var respJson = responseJson; 131 | respJson.data = remoteBuinessList; 132 | respJson.msg = " Success "; 133 | Log.i(TAG,"Response: " + JSON.stringify(respJson)); 134 | res.send(respJson); 135 | }); 136 | 137 | /** 138 | * Start the server 139 | */ 140 | app.listen(SERVER_PORT, () => { 141 | onLogProjectInfo(); 142 | Log.i(TAG, 'Server Listening at port :' + SERVER_PORT); 143 | onInit(); 144 | }); 145 | 146 | function onInit() { 147 | Log.i(TAG, ".... Initilization ...."); 148 | businessManager = new BusinessManager; 149 | patchManger = new PatchManager(); 150 | patchManger.init(businessManager); 151 | /** 152 | * NOTICE: Add your self BusinessInfo Object Like this: 153 | * var bus = new BusinessInfo({businessId},{businessName},{businessTag}) 154 | */ 155 | var mybuss = new BusinessInfo("AAF047B7-E816-2AE0-949A-D5FB4CE40245", "myBusiness", "tag1"); 156 | 157 | businessManager.add(mybuss); 158 | /** 159 | * NOTICE: PatchManager startPatch method must be called after your all BusinessInfos has been added to the BusinessManger Object. 160 | */ 161 | 162 | patchManger.startPatch(); 163 | } 164 | 165 | function onLogProjectInfo() { 166 | Log.i(TAG, "##################################################################################"); 167 | Log.i(TAG, '# Author : Marcus Ma'); 168 | Log.i(TAG, '# E-mail : maji1991@sina.com'); 169 | Log.i(TAG, "# GitHub : https://github.com/MarcusMa") 170 | Log.i(TAG, "##################################################################################"); 171 | Log.i(TAG, "# Demo Server for React Native Hot Code Push"); 172 | Log.i(TAG, "# See: https://github.com/MarcusMa/simple-react-native-hot-code-push-server"); 173 | Log.i(TAG, "# For Client Demo, please"); 174 | Log.i(TAG, "# See: https://github.com/MarcusMa/simple-react-native-hot-code-push"); 175 | Log.i(TAG, "##################################################################################"); 176 | } -------------------------------------------------------------------------------- /index_old.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Main 3 | * Copyright(c) 2009-2017 Marcus Ma 4 | * E-mail:maji1991@sina.com 5 | * GitHub : https://github.com/MarcusMa 6 | * MIT Licensed 7 | */ 8 | 'use strict'; 9 | 10 | /** 11 | * Module dependencies. 12 | */ 13 | const express = require('express'); 14 | const exec = require('child_process').exec; 15 | const bodyParser = require('body-parser'); 16 | const crypto = require('crypto'); 17 | const path = require('path'); 18 | const fs = require('fs'); 19 | 20 | const EventEmitter = require('events'); 21 | class MyEmitter extends EventEmitter {} 22 | const myEmitter = new MyEmitter(); 23 | 24 | /** 25 | * Custom module dependencies. 26 | */ 27 | const Log = require('./src/utils/Log'); 28 | const TAG = "RN_CODE_PUSH_SERVER"; 29 | /** event constants */ 30 | const EVENT_START_BSDIFF_FILES = "event_start_bsdiff_files"; 31 | const EVENT_SINGLE_FILE_BSDIFF_SUCCESS = "event_single_file_bsdiff_success"; 32 | const EVENT_SINGLE_FILE_BSDIFF_FAILED = "event_single_file_bsdiff_failed"; 33 | const EVENT_START_COMPUTE_HASHCODE = "event_start_compute_hashcode"; 34 | 35 | const app = express(); 36 | const responseJson = { 37 | "success": 1, 38 | "data": null, 39 | "msg": null 40 | }; 41 | 42 | const DIST_PATH = "./public/dist"; 43 | const ORIGINSL_SOURCE_PATH = "./public/original"; 44 | const BSDIFF_ROOT_PATH = "./bsdiff-4.3"; 45 | const BSDIFF_CMD = BSDIFF_ROOT_PATH + "/bsdiff"; 46 | const ServicePort = 8888; 47 | var patchSum = 0; 48 | 49 | const dataManager = new BusinessManager(); 50 | 51 | /** Server Settings */ 52 | app.use(express.static(path.join(__dirname, 'public'))); 53 | app.use(bodyParser.json({ 54 | limit: '1mb' 55 | })); 56 | 57 | app.use(bodyParser.urlencoded({ 58 | extended: true 59 | })); 60 | 61 | app.get('/testGet', function (req, res) { 62 | Log.i(TAG,req.query); 63 | Log.i(TAG,"call testGet"); 64 | res.send("testGet success"); 65 | }); 66 | 67 | app.post('/checkForUpdate', function (req, res) { 68 | Log.i(TAG,"** checkForUpdate ***"); 69 | Log.i(TAG,"request body:"); 70 | Log.i(TAG,JSON.stringify(req.body)); 71 | var reqBody = req.body; 72 | var list = []; 73 | list = reqBody.localBusinessList; 74 | var remoteBuinessList = []; 75 | // 处理传入的参数 76 | if (list instanceof Array) { 77 | list.forEach(function (tmp) { 78 | if (dataManager.getBusinessInfoById(tmp.id)) { 79 | let businessInfo = dataManager.getBusinessInfoById(tmp.id); 80 | let tempData = { 81 | id: tmp.id, 82 | verifyHashCode: "" 83 | }; 84 | if (businessInfo && businessInfo.existVersion(tmp.localPackageHashCode)) { 85 | Log.i(TAG,"exitVersion : " + tmp.localPackageHashCode); 86 | tempData.verifyHashCode = tmp.localPackageHashCode; 87 | } else { 88 | Log.i(TAG,"No Such Version " + tmp.localPackageHashCode); 89 | tempData.verifyHashCode = ""; 90 | } 91 | // 判断是否有新版本 92 | let latestPatchInfo = businessInfo.getLatestPatchInfo(); 93 | if (latestPatchInfo.hashCode == tmp.localPackageHashCode) { 94 | // 无新版本 95 | } else { 96 | tempData.latestPatch = { 97 | hashCode: latestPatchInfo.hashCode, 98 | downloadUrl: latestPatchInfo.getDownloadUrl() 99 | }; 100 | } 101 | // 加入返回报文 102 | remoteBuinessList.push(tempData); 103 | } 104 | }); 105 | } 106 | 107 | // 处理未传入的businessId 108 | dataManager.businessMap.forEach(function (tmp) { 109 | let isExist = false; 110 | if (list instanceof Array) { 111 | for (let j = 0; j < list.length; j++) { 112 | if (list[j].businessId == tmp.id) { 113 | isExist = true; 114 | break; 115 | } 116 | } 117 | } 118 | if (!isExist) { 119 | let tempData = { 120 | id: tmp.id, 121 | verifyHashCode: "" 122 | }; 123 | let latestPatchInfo = tmp.getLatestPatchInfo(); 124 | tempData.latestPatch = { 125 | hashCode: latestPatchInfo.hashCode, 126 | downloadUrl: latestPatchInfo.getDownloadUrl() 127 | }; 128 | remoteBuinessList.push(tempData); 129 | } 130 | }); 131 | var resjson = responseJson; 132 | resjson.data = remoteBuinessList; 133 | resjson.msg = " Success "; 134 | res.send(resjson); 135 | }); 136 | 137 | app.listen(ServicePort, () => { 138 | LogProjectInfo(); 139 | Log.i(TAG,'Server Listening at port :' + ServicePort); 140 | 141 | Log.i(TAG,".... Data Initilization ...."); 142 | var localBusiness = new BusinessInfo("AAF047B7-E816-2AE0-949A-D5FB4CE40245", "myBusiness", "tag1"); 143 | dataManager.add(localBusiness); 144 | 145 | Log.i(TAG,">>> clear ./dist folder"); 146 | var clearDistCmd = "rm -rf " + DIST_PATH; 147 | exec(clearDistCmd, (error, stdout, stderr) => { 148 | if (error) { 149 | Log.i(TAG,`exec error: ${error}`); 150 | return; 151 | } 152 | fs.mkdir(DIST_PATH); 153 | myEmitter.emit(EVENT_START_BSDIFF_FILES); 154 | }); 155 | }); 156 | 157 | /** bsDiff */ 158 | myEmitter.on(EVENT_START_BSDIFF_FILES, function () { 159 | Log.i(TAG,">>> start bsdiff patch files"); 160 | bsdiffFilesProc( 161 | function () { 162 | myEmitter.emit(EVENT_SINGLE_FILE_BSDIFF_SUCCESS); 163 | }, 164 | function () { 165 | myEmitter.emit(EVENT_SINGLE_FILE_BSDIFF_FAILED); 166 | } 167 | ); 168 | }); 169 | 170 | myEmitter.on(EVENT_SINGLE_FILE_BSDIFF_FAILED, function () { 171 | Log.i(TAG,"error happened in bsdiff progress"); 172 | }); 173 | 174 | myEmitter.on(EVENT_SINGLE_FILE_BSDIFF_SUCCESS, function () { 175 | patchSum = patchSum - 1; 176 | if (patchSum <= 0) { 177 | Log.i(TAG,"patch progress complete"); 178 | myEmitter.emit(EVENT_START_COMPUTE_HASHCODE); 179 | } 180 | }); 181 | 182 | /** HashCode */ 183 | myEmitter.on(EVENT_START_COMPUTE_HASHCODE, function () { 184 | Log.i(TAG,">>> start compute patch hashcode (sha-256)"); 185 | var successCallback = function (filePatch, hashcode) { 186 | let array = filePatch.split('/'); 187 | let fileName = array[array.length - 1]; 188 | let infos = fileName.split('_'); 189 | let busTag = infos[0]; 190 | let version = infos[2]; 191 | let business = dataManager.getBusinessInfoByTag(busTag); 192 | Log.i(TAG,"businessInfo:" + JSON.stringify(business)); 193 | setTimeout(function () { 194 | business.addNewVersion(version, hashcode, filePatch); 195 | Log.i(TAG,"" + JSON.stringify(dataManager)); 196 | }, 0); 197 | }; 198 | var errorCallback = function () { 199 | Log.i(TAG,`>>>> error in compute hashcode `); 200 | }; 201 | var dirs = fs.readdirSync(DIST_PATH); 202 | dirs.forEach(function (tmpDir) { 203 | var distBuinessDir = DIST_PATH + "/" + tmpDir; 204 | if (fs.statSync(distBuinessDir).isDirectory()) { 205 | Log.i(TAG,">>>> Deal Dir: " + distBuinessDir); 206 | var files = fs.readdirSync(distBuinessDir); 207 | files.forEach(function (patchName) { 208 | if (patchName == '.DS_Store' || patchName.substr(patchName.length - 6, 6) != '.patch') { 209 | return; 210 | } 211 | patchSum++; 212 | // start compute hashcode of file 213 | computeFilesHashProc( 214 | distBuinessDir + "/" + patchName, 215 | successCallback, 216 | errorCallback 217 | ); 218 | }); 219 | } 220 | }); 221 | }); 222 | 223 | /* Main Progress */ 224 | function computeFilesHashProc(_filePath, _successCallback, _errorCallback) { 225 | Log.i(TAG,">>>> Compute File: " + _filePath); 226 | let rs = fs.createReadStream(_filePath); 227 | let hash = crypto.createHash('sha256'); 228 | rs.on('data', hash.update.bind(hash)); 229 | rs.on('end', function () { 230 | let hashcode = hash.digest('hex'); 231 | if (hashcode.length <= 0 && typeof _errorCallback === 'function') { 232 | _errorCallback(); 233 | } else { 234 | _successCallback(_filePath, hashcode); 235 | } 236 | }); 237 | } 238 | 239 | function bsdiffFilesProc(_successCallback, _errorCallback) { 240 | var commonPackageFilePath = ORIGINSL_SOURCE_PATH + "/common_min.bundle"; 241 | var dirs = fs.readdirSync(ORIGINSL_SOURCE_PATH); 242 | dirs.forEach(function (tmpDir) { 243 | var distBuinessDir = DIST_PATH + "/" + tmpDir; 244 | var originalBuinessDir = ORIGINSL_SOURCE_PATH + "/" + tmpDir; 245 | if (fs.statSync(originalBuinessDir).isDirectory()) { 246 | Log.i(TAG,">>>> Diff With: " + originalBuinessDir); 247 | fs.mkdirSync(distBuinessDir); // make /dist/xxxx dir 248 | var files = fs.readdirSync(originalBuinessDir); 249 | 250 | files.forEach(function (completeBundleFile) { 251 | if (completeBundleFile == '.DS_Store') { 252 | return; 253 | } 254 | (function () { 255 | var option = commonPackageFilePath + " " + 256 | originalBuinessDir + "/" + completeBundleFile + " " + 257 | distBuinessDir + "/" + completeBundleFile + ".patch"; 258 | var execCmd = BSDIFF_CMD + " " + option; 259 | Log.i(TAG,">>>> " + execCmd); 260 | patchSum++; 261 | exec(execCmd, (error, stdout, stderr) => { 262 | if (error) { 263 | Log.i(TAG,`exec error: ${error}`); 264 | if (typeof _errorCallback === "function") { 265 | _errorCallback(); 266 | } 267 | return; 268 | } 269 | Log.i(TAG,">>>> bsdiff success"); 270 | if (typeof _successCallback === "function") { 271 | _successCallback(); 272 | } 273 | }); 274 | })(); 275 | }); 276 | } 277 | }); 278 | } 279 | 280 | /** 281 | * Manager & Service 282 | **/ 283 | function BusinessManager() { 284 | this.businessMap = []; 285 | } 286 | 287 | BusinessManager.prototype.add = function (business) { 288 | if (business instanceof BusinessInfo) { 289 | let isExist = false; 290 | this.businessMap.forEach(function (tmp) { 291 | if (tmp.id === business.id) { 292 | isExist = true; 293 | } 294 | }); 295 | if (!isExist) { 296 | Log.i(TAG,">>>> add new Business Id : " + business.id); 297 | this.businessMap.push(business); 298 | } 299 | } 300 | }; 301 | 302 | BusinessManager.prototype.getBusinessInfoById = function (businessId) { 303 | let ret = null; 304 | if (this.businessMap instanceof Array) { 305 | this.businessMap.forEach(function (tmp) { 306 | Log.i(TAG,"local id" + tmp.id + " search id " + businessId); 307 | if (tmp.id === businessId) { 308 | ret = tmp; 309 | } 310 | }); 311 | } 312 | return ret; 313 | }; 314 | 315 | BusinessManager.prototype.getBusinessInfoByTag = function (businessTag) { 316 | let ret = null; 317 | if (this.businessMap instanceof Array) { 318 | this.businessMap.forEach(function (tmp) { 319 | if (tmp.tag == businessTag) { 320 | ret = tmp; 321 | } 322 | }); 323 | } 324 | return ret; 325 | }; 326 | 327 | /** 328 | * Entity 329 | **/ 330 | function BusinessInfo(businessId, businessName, businessTag) { 331 | this.id = businessId; 332 | this.name = businessName; 333 | this.tag = businessTag; 334 | this.versions = []; 335 | } 336 | 337 | function PatchVersionInfo(id, patchVersion, patchHashCode, patchFilePath) { 338 | this.businessId = id; 339 | this.version = patchVersion; 340 | this.hashCode = patchHashCode; 341 | this.filePath = patchFilePath; 342 | } 343 | PatchVersionInfo.prototype.getDownloadUrl = function () { 344 | let ret = null; 345 | if (this.filePath) { 346 | ret = this.filePath.substr(9); 347 | } 348 | return ret; 349 | }; 350 | 351 | BusinessInfo.prototype.existVersion = function (patchHashCode) { 352 | let ret = false; 353 | this.versions.forEach(function (tmp) { 354 | if (tmp.hashCode === patchHashCode) { 355 | ret = true; 356 | } 357 | }); 358 | return ret; 359 | }; 360 | BusinessInfo.prototype.getLatestPatchInfo = function () { 361 | let ret = null; 362 | let lastVersionIndex = 0; 363 | for (let i = 0; i < this.versions.length; i++) { 364 | if (i > 0) { 365 | if (this.versions[i].version > this.versions[lastVersionIndex].version) { 366 | lastVersionIndex = i; 367 | } 368 | } 369 | } 370 | ret = this.versions[lastVersionIndex]; 371 | return ret; 372 | }; 373 | 374 | BusinessInfo.prototype.addNewVersion = function (patchVersion, patchHashCode, patchFilePath) { 375 | // check the patch version 376 | let isExit = false; 377 | this.versions.forEach(function (tmp) { 378 | if (tmp.version && tmp.version === patchVersion) { 379 | isExit = true; 380 | } 381 | }); 382 | if (!isExit) { 383 | Log.i(TAG,">>>> add new business version : " + patchFilePath); 384 | let newPatchVersionInfo = new PatchVersionInfo(this.businessId, patchVersion, patchHashCode, patchFilePath); 385 | this.versions.push(newPatchVersionInfo); 386 | } 387 | }; 388 | 389 | function LogProjectInfo() { 390 | Log.i(TAG,"##################################################################################"); 391 | Log.i(TAG,'# Author : Marcus Ma'); 392 | Log.i(TAG,'# E-mail : maji1991@sina.com'); 393 | Log.i(TAG,"# GitHub : https://github.com/MarcusMa") 394 | Log.i(TAG,"##################################################################################"); 395 | Log.i(TAG,"# Demo Server for React Native Hot Code Push"); 396 | Log.i(TAG,"# See: https://github.com/MarcusMa/simple-react-native-hot-code-push-server"); 397 | Log.i(TAG,"# For Client Demo, please"); 398 | Log.i(TAG,"# See: https://github.com/MarcusMa/simple-react-native-hot-code-push"); 399 | Log.i(TAG,"##################################################################################"); 400 | } -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "myserver", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "accepts": { 8 | "version": "https://registry.npm.taobao.org/accepts/download/accepts-1.3.3.tgz", 9 | "integrity": "sha1-w8p0NJOGSMPg2cHjKN1otiLChMo=", 10 | "requires": { 11 | "mime-types": "https://registry.npm.taobao.org/mime-types/download/mime-types-2.1.15.tgz", 12 | "negotiator": "https://registry.npm.taobao.org/negotiator/download/negotiator-0.6.1.tgz" 13 | } 14 | }, 15 | "ansi-regex": { 16 | "version": "2.1.1", 17 | "resolved": "http://registry.npm.taobao.org/ansi-regex/download/ansi-regex-2.1.1.tgz", 18 | "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", 19 | "dev": true 20 | }, 21 | "ansi-styles": { 22 | "version": "2.2.1", 23 | "resolved": "http://registry.npm.taobao.org/ansi-styles/download/ansi-styles-2.2.1.tgz", 24 | "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", 25 | "dev": true 26 | }, 27 | "anymatch": { 28 | "version": "1.3.2", 29 | "resolved": "http://registry.npm.taobao.org/anymatch/download/anymatch-1.3.2.tgz", 30 | "integrity": "sha1-VT3Lj5HjyImEXf26NMd3IbkLnXo=", 31 | "dev": true, 32 | "optional": true, 33 | "requires": { 34 | "micromatch": "2.3.11", 35 | "normalize-path": "2.1.1" 36 | } 37 | }, 38 | "arr-diff": { 39 | "version": "2.0.0", 40 | "resolved": "http://registry.npm.taobao.org/arr-diff/download/arr-diff-2.0.0.tgz", 41 | "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", 42 | "dev": true, 43 | "optional": true, 44 | "requires": { 45 | "arr-flatten": "1.1.0" 46 | } 47 | }, 48 | "arr-flatten": { 49 | "version": "1.1.0", 50 | "resolved": "http://registry.npm.taobao.org/arr-flatten/download/arr-flatten-1.1.0.tgz", 51 | "integrity": "sha1-NgSLv/TntH4TZkQxbJlmnqWukfE=", 52 | "dev": true, 53 | "optional": true 54 | }, 55 | "array-flatten": { 56 | "version": "https://registry.npm.taobao.org/array-flatten/download/array-flatten-1.1.1.tgz", 57 | "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" 58 | }, 59 | "array-unique": { 60 | "version": "0.2.1", 61 | "resolved": "http://registry.npm.taobao.org/array-unique/download/array-unique-0.2.1.tgz", 62 | "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", 63 | "dev": true, 64 | "optional": true 65 | }, 66 | "async-each": { 67 | "version": "1.0.1", 68 | "resolved": "http://registry.npm.taobao.org/async-each/download/async-each-1.0.1.tgz", 69 | "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=", 70 | "dev": true, 71 | "optional": true 72 | }, 73 | "babel-cli": { 74 | "version": "6.26.0", 75 | "resolved": "http://registry.npm.taobao.org/babel-cli/download/babel-cli-6.26.0.tgz", 76 | "integrity": "sha1-UCq1SHTX24itALiHoGODzgPQAvE=", 77 | "dev": true, 78 | "requires": { 79 | "babel-core": "6.26.0", 80 | "babel-polyfill": "6.26.0", 81 | "babel-register": "6.26.0", 82 | "babel-runtime": "6.26.0", 83 | "chokidar": "1.7.0", 84 | "commander": "2.11.0", 85 | "convert-source-map": "1.5.0", 86 | "fs-readdir-recursive": "1.0.0", 87 | "glob": "7.1.2", 88 | "lodash": "4.17.4", 89 | "output-file-sync": "1.1.2", 90 | "path-is-absolute": "1.0.1", 91 | "slash": "1.0.0", 92 | "source-map": "0.5.7", 93 | "v8flags": "2.1.1" 94 | } 95 | }, 96 | "babel-code-frame": { 97 | "version": "6.26.0", 98 | "resolved": "http://registry.npm.taobao.org/babel-code-frame/download/babel-code-frame-6.26.0.tgz", 99 | "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", 100 | "dev": true, 101 | "requires": { 102 | "chalk": "1.1.3", 103 | "esutils": "2.0.2", 104 | "js-tokens": "3.0.2" 105 | } 106 | }, 107 | "babel-core": { 108 | "version": "6.26.0", 109 | "resolved": "http://registry.npm.taobao.org/babel-core/download/babel-core-6.26.0.tgz", 110 | "integrity": "sha1-rzL3izGm/O8RnIew/Y2XU/A6C7g=", 111 | "dev": true, 112 | "requires": { 113 | "babel-code-frame": "6.26.0", 114 | "babel-generator": "6.26.0", 115 | "babel-helpers": "6.24.1", 116 | "babel-messages": "6.23.0", 117 | "babel-register": "6.26.0", 118 | "babel-runtime": "6.26.0", 119 | "babel-template": "6.26.0", 120 | "babel-traverse": "6.26.0", 121 | "babel-types": "6.26.0", 122 | "babylon": "6.18.0", 123 | "convert-source-map": "1.5.0", 124 | "debug": "2.6.8", 125 | "json5": "0.5.1", 126 | "lodash": "4.17.4", 127 | "minimatch": "3.0.4", 128 | "path-is-absolute": "1.0.1", 129 | "private": "0.1.7", 130 | "slash": "1.0.0", 131 | "source-map": "0.5.7" 132 | }, 133 | "dependencies": { 134 | "debug": { 135 | "version": "2.6.8", 136 | "resolved": "http://registry.npm.taobao.org/debug/download/debug-2.6.8.tgz", 137 | "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", 138 | "dev": true, 139 | "requires": { 140 | "ms": "2.0.0" 141 | } 142 | }, 143 | "ms": { 144 | "version": "2.0.0", 145 | "resolved": "http://registry.npm.taobao.org/ms/download/ms-2.0.0.tgz", 146 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", 147 | "dev": true 148 | } 149 | } 150 | }, 151 | "babel-generator": { 152 | "version": "6.26.0", 153 | "resolved": "http://registry.npm.taobao.org/babel-generator/download/babel-generator-6.26.0.tgz", 154 | "integrity": "sha1-rBriAHC3n248odMmlhMFN3TyDcU=", 155 | "dev": true, 156 | "requires": { 157 | "babel-messages": "6.23.0", 158 | "babel-runtime": "6.26.0", 159 | "babel-types": "6.26.0", 160 | "detect-indent": "4.0.0", 161 | "jsesc": "1.3.0", 162 | "lodash": "4.17.4", 163 | "source-map": "0.5.7", 164 | "trim-right": "1.0.1" 165 | } 166 | }, 167 | "babel-helper-builder-binary-assignment-operator-visitor": { 168 | "version": "6.24.1", 169 | "resolved": "http://registry.npm.taobao.org/babel-helper-builder-binary-assignment-operator-visitor/download/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz", 170 | "integrity": "sha1-zORReto1b0IgvK6KAsKzRvmlZmQ=", 171 | "dev": true, 172 | "requires": { 173 | "babel-helper-explode-assignable-expression": "6.24.1", 174 | "babel-runtime": "6.26.0", 175 | "babel-types": "6.26.0" 176 | } 177 | }, 178 | "babel-helper-call-delegate": { 179 | "version": "6.24.1", 180 | "resolved": "http://registry.npm.taobao.org/babel-helper-call-delegate/download/babel-helper-call-delegate-6.24.1.tgz", 181 | "integrity": "sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340=", 182 | "dev": true, 183 | "requires": { 184 | "babel-helper-hoist-variables": "6.24.1", 185 | "babel-runtime": "6.26.0", 186 | "babel-traverse": "6.26.0", 187 | "babel-types": "6.26.0" 188 | } 189 | }, 190 | "babel-helper-define-map": { 191 | "version": "6.26.0", 192 | "resolved": "http://registry.npm.taobao.org/babel-helper-define-map/download/babel-helper-define-map-6.26.0.tgz", 193 | "integrity": "sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8=", 194 | "dev": true, 195 | "requires": { 196 | "babel-helper-function-name": "6.24.1", 197 | "babel-runtime": "6.26.0", 198 | "babel-types": "6.26.0", 199 | "lodash": "4.17.4" 200 | } 201 | }, 202 | "babel-helper-explode-assignable-expression": { 203 | "version": "6.24.1", 204 | "resolved": "http://registry.npm.taobao.org/babel-helper-explode-assignable-expression/download/babel-helper-explode-assignable-expression-6.24.1.tgz", 205 | "integrity": "sha1-8luCz33BBDPFX3BZLVdGQArCLKo=", 206 | "dev": true, 207 | "requires": { 208 | "babel-runtime": "6.26.0", 209 | "babel-traverse": "6.26.0", 210 | "babel-types": "6.26.0" 211 | } 212 | }, 213 | "babel-helper-function-name": { 214 | "version": "6.24.1", 215 | "resolved": "http://registry.npm.taobao.org/babel-helper-function-name/download/babel-helper-function-name-6.24.1.tgz", 216 | "integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=", 217 | "dev": true, 218 | "requires": { 219 | "babel-helper-get-function-arity": "6.24.1", 220 | "babel-runtime": "6.26.0", 221 | "babel-template": "6.26.0", 222 | "babel-traverse": "6.26.0", 223 | "babel-types": "6.26.0" 224 | } 225 | }, 226 | "babel-helper-get-function-arity": { 227 | "version": "6.24.1", 228 | "resolved": "http://registry.npm.taobao.org/babel-helper-get-function-arity/download/babel-helper-get-function-arity-6.24.1.tgz", 229 | "integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=", 230 | "dev": true, 231 | "requires": { 232 | "babel-runtime": "6.26.0", 233 | "babel-types": "6.26.0" 234 | } 235 | }, 236 | "babel-helper-hoist-variables": { 237 | "version": "6.24.1", 238 | "resolved": "http://registry.npm.taobao.org/babel-helper-hoist-variables/download/babel-helper-hoist-variables-6.24.1.tgz", 239 | "integrity": "sha1-HssnaJydJVE+rbyZFKc/VAi+enY=", 240 | "dev": true, 241 | "requires": { 242 | "babel-runtime": "6.26.0", 243 | "babel-types": "6.26.0" 244 | } 245 | }, 246 | "babel-helper-optimise-call-expression": { 247 | "version": "6.24.1", 248 | "resolved": "http://registry.npm.taobao.org/babel-helper-optimise-call-expression/download/babel-helper-optimise-call-expression-6.24.1.tgz", 249 | "integrity": "sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc=", 250 | "dev": true, 251 | "requires": { 252 | "babel-runtime": "6.26.0", 253 | "babel-types": "6.26.0" 254 | } 255 | }, 256 | "babel-helper-regex": { 257 | "version": "6.26.0", 258 | "resolved": "http://registry.npm.taobao.org/babel-helper-regex/download/babel-helper-regex-6.26.0.tgz", 259 | "integrity": "sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI=", 260 | "dev": true, 261 | "requires": { 262 | "babel-runtime": "6.26.0", 263 | "babel-types": "6.26.0", 264 | "lodash": "4.17.4" 265 | } 266 | }, 267 | "babel-helper-remap-async-to-generator": { 268 | "version": "6.24.1", 269 | "resolved": "http://registry.npm.taobao.org/babel-helper-remap-async-to-generator/download/babel-helper-remap-async-to-generator-6.24.1.tgz", 270 | "integrity": "sha1-XsWBgnrXI/7N04HxySg5BnbkVRs=", 271 | "dev": true, 272 | "requires": { 273 | "babel-helper-function-name": "6.24.1", 274 | "babel-runtime": "6.26.0", 275 | "babel-template": "6.26.0", 276 | "babel-traverse": "6.26.0", 277 | "babel-types": "6.26.0" 278 | } 279 | }, 280 | "babel-helper-replace-supers": { 281 | "version": "6.24.1", 282 | "resolved": "http://registry.npm.taobao.org/babel-helper-replace-supers/download/babel-helper-replace-supers-6.24.1.tgz", 283 | "integrity": "sha1-v22/5Dk40XNpohPKiov3S2qQqxo=", 284 | "dev": true, 285 | "requires": { 286 | "babel-helper-optimise-call-expression": "6.24.1", 287 | "babel-messages": "6.23.0", 288 | "babel-runtime": "6.26.0", 289 | "babel-template": "6.26.0", 290 | "babel-traverse": "6.26.0", 291 | "babel-types": "6.26.0" 292 | } 293 | }, 294 | "babel-helpers": { 295 | "version": "6.24.1", 296 | "resolved": "http://registry.npm.taobao.org/babel-helpers/download/babel-helpers-6.24.1.tgz", 297 | "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", 298 | "dev": true, 299 | "requires": { 300 | "babel-runtime": "6.26.0", 301 | "babel-template": "6.26.0" 302 | } 303 | }, 304 | "babel-messages": { 305 | "version": "6.23.0", 306 | "resolved": "http://registry.npm.taobao.org/babel-messages/download/babel-messages-6.23.0.tgz", 307 | "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", 308 | "dev": true, 309 | "requires": { 310 | "babel-runtime": "6.26.0" 311 | } 312 | }, 313 | "babel-plugin-check-es2015-constants": { 314 | "version": "6.22.0", 315 | "resolved": "http://registry.npm.taobao.org/babel-plugin-check-es2015-constants/download/babel-plugin-check-es2015-constants-6.22.0.tgz", 316 | "integrity": "sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o=", 317 | "dev": true, 318 | "requires": { 319 | "babel-runtime": "6.26.0" 320 | } 321 | }, 322 | "babel-plugin-syntax-async-functions": { 323 | "version": "6.13.0", 324 | "resolved": "http://registry.npm.taobao.org/babel-plugin-syntax-async-functions/download/babel-plugin-syntax-async-functions-6.13.0.tgz", 325 | "integrity": "sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU=", 326 | "dev": true 327 | }, 328 | "babel-plugin-syntax-exponentiation-operator": { 329 | "version": "6.13.0", 330 | "resolved": "http://registry.npm.taobao.org/babel-plugin-syntax-exponentiation-operator/download/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz", 331 | "integrity": "sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4=", 332 | "dev": true 333 | }, 334 | "babel-plugin-syntax-trailing-function-commas": { 335 | "version": "6.22.0", 336 | "resolved": "http://registry.npm.taobao.org/babel-plugin-syntax-trailing-function-commas/download/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz", 337 | "integrity": "sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM=", 338 | "dev": true 339 | }, 340 | "babel-plugin-transform-async-to-generator": { 341 | "version": "6.24.1", 342 | "resolved": "http://registry.npm.taobao.org/babel-plugin-transform-async-to-generator/download/babel-plugin-transform-async-to-generator-6.24.1.tgz", 343 | "integrity": "sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E=", 344 | "dev": true, 345 | "requires": { 346 | "babel-helper-remap-async-to-generator": "6.24.1", 347 | "babel-plugin-syntax-async-functions": "6.13.0", 348 | "babel-runtime": "6.26.0" 349 | } 350 | }, 351 | "babel-plugin-transform-es2015-arrow-functions": { 352 | "version": "6.22.0", 353 | "resolved": "http://registry.npm.taobao.org/babel-plugin-transform-es2015-arrow-functions/download/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz", 354 | "integrity": "sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE=", 355 | "dev": true, 356 | "requires": { 357 | "babel-runtime": "6.26.0" 358 | } 359 | }, 360 | "babel-plugin-transform-es2015-block-scoped-functions": { 361 | "version": "6.22.0", 362 | "resolved": "http://registry.npm.taobao.org/babel-plugin-transform-es2015-block-scoped-functions/download/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz", 363 | "integrity": "sha1-u8UbSflk1wy42OC5ToICRs46YUE=", 364 | "dev": true, 365 | "requires": { 366 | "babel-runtime": "6.26.0" 367 | } 368 | }, 369 | "babel-plugin-transform-es2015-block-scoping": { 370 | "version": "6.26.0", 371 | "resolved": "http://registry.npm.taobao.org/babel-plugin-transform-es2015-block-scoping/download/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz", 372 | "integrity": "sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8=", 373 | "dev": true, 374 | "requires": { 375 | "babel-runtime": "6.26.0", 376 | "babel-template": "6.26.0", 377 | "babel-traverse": "6.26.0", 378 | "babel-types": "6.26.0", 379 | "lodash": "4.17.4" 380 | } 381 | }, 382 | "babel-plugin-transform-es2015-classes": { 383 | "version": "6.24.1", 384 | "resolved": "http://registry.npm.taobao.org/babel-plugin-transform-es2015-classes/download/babel-plugin-transform-es2015-classes-6.24.1.tgz", 385 | "integrity": "sha1-WkxYpQyclGHlZLSyo7+ryXolhNs=", 386 | "dev": true, 387 | "requires": { 388 | "babel-helper-define-map": "6.26.0", 389 | "babel-helper-function-name": "6.24.1", 390 | "babel-helper-optimise-call-expression": "6.24.1", 391 | "babel-helper-replace-supers": "6.24.1", 392 | "babel-messages": "6.23.0", 393 | "babel-runtime": "6.26.0", 394 | "babel-template": "6.26.0", 395 | "babel-traverse": "6.26.0", 396 | "babel-types": "6.26.0" 397 | } 398 | }, 399 | "babel-plugin-transform-es2015-computed-properties": { 400 | "version": "6.24.1", 401 | "resolved": "http://registry.npm.taobao.org/babel-plugin-transform-es2015-computed-properties/download/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz", 402 | "integrity": "sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM=", 403 | "dev": true, 404 | "requires": { 405 | "babel-runtime": "6.26.0", 406 | "babel-template": "6.26.0" 407 | } 408 | }, 409 | "babel-plugin-transform-es2015-destructuring": { 410 | "version": "6.23.0", 411 | "resolved": "http://registry.npm.taobao.org/babel-plugin-transform-es2015-destructuring/download/babel-plugin-transform-es2015-destructuring-6.23.0.tgz", 412 | "integrity": "sha1-mXux8auWf2gtKwh2/jWNYOdlxW0=", 413 | "dev": true, 414 | "requires": { 415 | "babel-runtime": "6.26.0" 416 | } 417 | }, 418 | "babel-plugin-transform-es2015-duplicate-keys": { 419 | "version": "6.24.1", 420 | "resolved": "http://registry.npm.taobao.org/babel-plugin-transform-es2015-duplicate-keys/download/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz", 421 | "integrity": "sha1-c+s9MQypaePvnskcU3QabxV2Qj4=", 422 | "dev": true, 423 | "requires": { 424 | "babel-runtime": "6.26.0", 425 | "babel-types": "6.26.0" 426 | } 427 | }, 428 | "babel-plugin-transform-es2015-for-of": { 429 | "version": "6.23.0", 430 | "resolved": "http://registry.npm.taobao.org/babel-plugin-transform-es2015-for-of/download/babel-plugin-transform-es2015-for-of-6.23.0.tgz", 431 | "integrity": "sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE=", 432 | "dev": true, 433 | "requires": { 434 | "babel-runtime": "6.26.0" 435 | } 436 | }, 437 | "babel-plugin-transform-es2015-function-name": { 438 | "version": "6.24.1", 439 | "resolved": "http://registry.npm.taobao.org/babel-plugin-transform-es2015-function-name/download/babel-plugin-transform-es2015-function-name-6.24.1.tgz", 440 | "integrity": "sha1-g0yJhTvDaxrw86TF26qU/Y6sqos=", 441 | "dev": true, 442 | "requires": { 443 | "babel-helper-function-name": "6.24.1", 444 | "babel-runtime": "6.26.0", 445 | "babel-types": "6.26.0" 446 | } 447 | }, 448 | "babel-plugin-transform-es2015-literals": { 449 | "version": "6.22.0", 450 | "resolved": "http://registry.npm.taobao.org/babel-plugin-transform-es2015-literals/download/babel-plugin-transform-es2015-literals-6.22.0.tgz", 451 | "integrity": "sha1-T1SgLWzWbPkVKAAZox0xklN3yi4=", 452 | "dev": true, 453 | "requires": { 454 | "babel-runtime": "6.26.0" 455 | } 456 | }, 457 | "babel-plugin-transform-es2015-modules-amd": { 458 | "version": "6.24.1", 459 | "resolved": "http://registry.npm.taobao.org/babel-plugin-transform-es2015-modules-amd/download/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz", 460 | "integrity": "sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ=", 461 | "dev": true, 462 | "requires": { 463 | "babel-plugin-transform-es2015-modules-commonjs": "6.26.0", 464 | "babel-runtime": "6.26.0", 465 | "babel-template": "6.26.0" 466 | } 467 | }, 468 | "babel-plugin-transform-es2015-modules-commonjs": { 469 | "version": "6.26.0", 470 | "resolved": "http://registry.npm.taobao.org/babel-plugin-transform-es2015-modules-commonjs/download/babel-plugin-transform-es2015-modules-commonjs-6.26.0.tgz", 471 | "integrity": "sha1-DYOUApt9xqvhqX7xgeAHWN0uXYo=", 472 | "dev": true, 473 | "requires": { 474 | "babel-plugin-transform-strict-mode": "6.24.1", 475 | "babel-runtime": "6.26.0", 476 | "babel-template": "6.26.0", 477 | "babel-types": "6.26.0" 478 | } 479 | }, 480 | "babel-plugin-transform-es2015-modules-systemjs": { 481 | "version": "6.24.1", 482 | "resolved": "http://registry.npm.taobao.org/babel-plugin-transform-es2015-modules-systemjs/download/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz", 483 | "integrity": "sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM=", 484 | "dev": true, 485 | "requires": { 486 | "babel-helper-hoist-variables": "6.24.1", 487 | "babel-runtime": "6.26.0", 488 | "babel-template": "6.26.0" 489 | } 490 | }, 491 | "babel-plugin-transform-es2015-modules-umd": { 492 | "version": "6.24.1", 493 | "resolved": "http://registry.npm.taobao.org/babel-plugin-transform-es2015-modules-umd/download/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz", 494 | "integrity": "sha1-rJl+YoXNGO1hdq22B9YCNErThGg=", 495 | "dev": true, 496 | "requires": { 497 | "babel-plugin-transform-es2015-modules-amd": "6.24.1", 498 | "babel-runtime": "6.26.0", 499 | "babel-template": "6.26.0" 500 | } 501 | }, 502 | "babel-plugin-transform-es2015-object-super": { 503 | "version": "6.24.1", 504 | "resolved": "http://registry.npm.taobao.org/babel-plugin-transform-es2015-object-super/download/babel-plugin-transform-es2015-object-super-6.24.1.tgz", 505 | "integrity": "sha1-JM72muIcuDp/hgPa0CH1cusnj40=", 506 | "dev": true, 507 | "requires": { 508 | "babel-helper-replace-supers": "6.24.1", 509 | "babel-runtime": "6.26.0" 510 | } 511 | }, 512 | "babel-plugin-transform-es2015-parameters": { 513 | "version": "6.24.1", 514 | "resolved": "http://registry.npm.taobao.org/babel-plugin-transform-es2015-parameters/download/babel-plugin-transform-es2015-parameters-6.24.1.tgz", 515 | "integrity": "sha1-V6w1GrScrxSpfNE7CfZv3wpiXys=", 516 | "dev": true, 517 | "requires": { 518 | "babel-helper-call-delegate": "6.24.1", 519 | "babel-helper-get-function-arity": "6.24.1", 520 | "babel-runtime": "6.26.0", 521 | "babel-template": "6.26.0", 522 | "babel-traverse": "6.26.0", 523 | "babel-types": "6.26.0" 524 | } 525 | }, 526 | "babel-plugin-transform-es2015-shorthand-properties": { 527 | "version": "6.24.1", 528 | "resolved": "http://registry.npm.taobao.org/babel-plugin-transform-es2015-shorthand-properties/download/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz", 529 | "integrity": "sha1-JPh11nIch2YbvZmkYi5R8U3jiqA=", 530 | "dev": true, 531 | "requires": { 532 | "babel-runtime": "6.26.0", 533 | "babel-types": "6.26.0" 534 | } 535 | }, 536 | "babel-plugin-transform-es2015-spread": { 537 | "version": "6.22.0", 538 | "resolved": "http://registry.npm.taobao.org/babel-plugin-transform-es2015-spread/download/babel-plugin-transform-es2015-spread-6.22.0.tgz", 539 | "integrity": "sha1-1taKmfia7cRTbIGlQujdnxdG+NE=", 540 | "dev": true, 541 | "requires": { 542 | "babel-runtime": "6.26.0" 543 | } 544 | }, 545 | "babel-plugin-transform-es2015-sticky-regex": { 546 | "version": "6.24.1", 547 | "resolved": "http://registry.npm.taobao.org/babel-plugin-transform-es2015-sticky-regex/download/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz", 548 | "integrity": "sha1-AMHNsaynERLN8M9hJsLta0V8zbw=", 549 | "dev": true, 550 | "requires": { 551 | "babel-helper-regex": "6.26.0", 552 | "babel-runtime": "6.26.0", 553 | "babel-types": "6.26.0" 554 | } 555 | }, 556 | "babel-plugin-transform-es2015-template-literals": { 557 | "version": "6.22.0", 558 | "resolved": "http://registry.npm.taobao.org/babel-plugin-transform-es2015-template-literals/download/babel-plugin-transform-es2015-template-literals-6.22.0.tgz", 559 | "integrity": "sha1-qEs0UPfp+PH2g51taH2oS7EjbY0=", 560 | "dev": true, 561 | "requires": { 562 | "babel-runtime": "6.26.0" 563 | } 564 | }, 565 | "babel-plugin-transform-es2015-typeof-symbol": { 566 | "version": "6.23.0", 567 | "resolved": "http://registry.npm.taobao.org/babel-plugin-transform-es2015-typeof-symbol/download/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz", 568 | "integrity": "sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I=", 569 | "dev": true, 570 | "requires": { 571 | "babel-runtime": "6.26.0" 572 | } 573 | }, 574 | "babel-plugin-transform-es2015-unicode-regex": { 575 | "version": "6.24.1", 576 | "resolved": "http://registry.npm.taobao.org/babel-plugin-transform-es2015-unicode-regex/download/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz", 577 | "integrity": "sha1-04sS9C6nMj9yk4fxinxa4frrNek=", 578 | "dev": true, 579 | "requires": { 580 | "babel-helper-regex": "6.26.0", 581 | "babel-runtime": "6.26.0", 582 | "regexpu-core": "2.0.0" 583 | } 584 | }, 585 | "babel-plugin-transform-exponentiation-operator": { 586 | "version": "6.24.1", 587 | "resolved": "http://registry.npm.taobao.org/babel-plugin-transform-exponentiation-operator/download/babel-plugin-transform-exponentiation-operator-6.24.1.tgz", 588 | "integrity": "sha1-KrDJx/MJj6SJB3cruBP+QejeOg4=", 589 | "dev": true, 590 | "requires": { 591 | "babel-helper-builder-binary-assignment-operator-visitor": "6.24.1", 592 | "babel-plugin-syntax-exponentiation-operator": "6.13.0", 593 | "babel-runtime": "6.26.0" 594 | } 595 | }, 596 | "babel-plugin-transform-regenerator": { 597 | "version": "6.26.0", 598 | "resolved": "http://registry.npm.taobao.org/babel-plugin-transform-regenerator/download/babel-plugin-transform-regenerator-6.26.0.tgz", 599 | "integrity": "sha1-4HA2lvveJ/Cj78rPi03KL3s6jy8=", 600 | "dev": true, 601 | "requires": { 602 | "regenerator-transform": "0.10.1" 603 | } 604 | }, 605 | "babel-plugin-transform-strict-mode": { 606 | "version": "6.24.1", 607 | "resolved": "http://registry.npm.taobao.org/babel-plugin-transform-strict-mode/download/babel-plugin-transform-strict-mode-6.24.1.tgz", 608 | "integrity": "sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g=", 609 | "dev": true, 610 | "requires": { 611 | "babel-runtime": "6.26.0", 612 | "babel-types": "6.26.0" 613 | } 614 | }, 615 | "babel-polyfill": { 616 | "version": "6.26.0", 617 | "resolved": "http://registry.npm.taobao.org/babel-polyfill/download/babel-polyfill-6.26.0.tgz", 618 | "integrity": "sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM=", 619 | "dev": true, 620 | "requires": { 621 | "babel-runtime": "6.26.0", 622 | "core-js": "2.5.1", 623 | "regenerator-runtime": "0.10.5" 624 | }, 625 | "dependencies": { 626 | "regenerator-runtime": { 627 | "version": "0.10.5", 628 | "resolved": "http://registry.npm.taobao.org/regenerator-runtime/download/regenerator-runtime-0.10.5.tgz", 629 | "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=", 630 | "dev": true 631 | } 632 | } 633 | }, 634 | "babel-preset-es2015": { 635 | "version": "6.24.1", 636 | "resolved": "http://registry.npm.taobao.org/babel-preset-es2015/download/babel-preset-es2015-6.24.1.tgz", 637 | "integrity": "sha1-1EBQ1rwsn+6nAqrzjXJ6AhBTiTk=", 638 | "dev": true, 639 | "requires": { 640 | "babel-plugin-check-es2015-constants": "6.22.0", 641 | "babel-plugin-transform-es2015-arrow-functions": "6.22.0", 642 | "babel-plugin-transform-es2015-block-scoped-functions": "6.22.0", 643 | "babel-plugin-transform-es2015-block-scoping": "6.26.0", 644 | "babel-plugin-transform-es2015-classes": "6.24.1", 645 | "babel-plugin-transform-es2015-computed-properties": "6.24.1", 646 | "babel-plugin-transform-es2015-destructuring": "6.23.0", 647 | "babel-plugin-transform-es2015-duplicate-keys": "6.24.1", 648 | "babel-plugin-transform-es2015-for-of": "6.23.0", 649 | "babel-plugin-transform-es2015-function-name": "6.24.1", 650 | "babel-plugin-transform-es2015-literals": "6.22.0", 651 | "babel-plugin-transform-es2015-modules-amd": "6.24.1", 652 | "babel-plugin-transform-es2015-modules-commonjs": "6.26.0", 653 | "babel-plugin-transform-es2015-modules-systemjs": "6.24.1", 654 | "babel-plugin-transform-es2015-modules-umd": "6.24.1", 655 | "babel-plugin-transform-es2015-object-super": "6.24.1", 656 | "babel-plugin-transform-es2015-parameters": "6.24.1", 657 | "babel-plugin-transform-es2015-shorthand-properties": "6.24.1", 658 | "babel-plugin-transform-es2015-spread": "6.22.0", 659 | "babel-plugin-transform-es2015-sticky-regex": "6.24.1", 660 | "babel-plugin-transform-es2015-template-literals": "6.22.0", 661 | "babel-plugin-transform-es2015-typeof-symbol": "6.23.0", 662 | "babel-plugin-transform-es2015-unicode-regex": "6.24.1", 663 | "babel-plugin-transform-regenerator": "6.26.0" 664 | } 665 | }, 666 | "babel-preset-es2016": { 667 | "version": "6.24.1", 668 | "resolved": "http://registry.npm.taobao.org/babel-preset-es2016/download/babel-preset-es2016-6.24.1.tgz", 669 | "integrity": "sha1-+QC/k+LrwNJ235uKtZck6/2Vn4s=", 670 | "dev": true, 671 | "requires": { 672 | "babel-plugin-transform-exponentiation-operator": "6.24.1" 673 | } 674 | }, 675 | "babel-preset-es2017": { 676 | "version": "6.24.1", 677 | "resolved": "http://registry.npm.taobao.org/babel-preset-es2017/download/babel-preset-es2017-6.24.1.tgz", 678 | "integrity": "sha1-WXvq37n38gi8/YoS6bKym4svFNE=", 679 | "dev": true, 680 | "requires": { 681 | "babel-plugin-syntax-trailing-function-commas": "6.22.0", 682 | "babel-plugin-transform-async-to-generator": "6.24.1" 683 | } 684 | }, 685 | "babel-preset-latest": { 686 | "version": "6.24.1", 687 | "resolved": "http://registry.npm.taobao.org/babel-preset-latest/download/babel-preset-latest-6.24.1.tgz", 688 | "integrity": "sha1-Z33gaRVKdIXC0lxXfAL2JLhbheg=", 689 | "dev": true, 690 | "requires": { 691 | "babel-preset-es2015": "6.24.1", 692 | "babel-preset-es2016": "6.24.1", 693 | "babel-preset-es2017": "6.24.1" 694 | } 695 | }, 696 | "babel-register": { 697 | "version": "6.26.0", 698 | "resolved": "http://registry.npm.taobao.org/babel-register/download/babel-register-6.26.0.tgz", 699 | "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", 700 | "dev": true, 701 | "requires": { 702 | "babel-core": "6.26.0", 703 | "babel-runtime": "6.26.0", 704 | "core-js": "2.5.1", 705 | "home-or-tmp": "2.0.0", 706 | "lodash": "4.17.4", 707 | "mkdirp": "0.5.1", 708 | "source-map-support": "0.4.18" 709 | } 710 | }, 711 | "babel-runtime": { 712 | "version": "6.26.0", 713 | "resolved": "http://registry.npm.taobao.org/babel-runtime/download/babel-runtime-6.26.0.tgz", 714 | "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", 715 | "dev": true, 716 | "requires": { 717 | "core-js": "2.5.1", 718 | "regenerator-runtime": "0.11.0" 719 | } 720 | }, 721 | "babel-template": { 722 | "version": "6.26.0", 723 | "resolved": "http://registry.npm.taobao.org/babel-template/download/babel-template-6.26.0.tgz", 724 | "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", 725 | "dev": true, 726 | "requires": { 727 | "babel-runtime": "6.26.0", 728 | "babel-traverse": "6.26.0", 729 | "babel-types": "6.26.0", 730 | "babylon": "6.18.0", 731 | "lodash": "4.17.4" 732 | } 733 | }, 734 | "babel-traverse": { 735 | "version": "6.26.0", 736 | "resolved": "http://registry.npm.taobao.org/babel-traverse/download/babel-traverse-6.26.0.tgz", 737 | "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", 738 | "dev": true, 739 | "requires": { 740 | "babel-code-frame": "6.26.0", 741 | "babel-messages": "6.23.0", 742 | "babel-runtime": "6.26.0", 743 | "babel-types": "6.26.0", 744 | "babylon": "6.18.0", 745 | "debug": "2.6.8", 746 | "globals": "9.18.0", 747 | "invariant": "2.2.2", 748 | "lodash": "4.17.4" 749 | }, 750 | "dependencies": { 751 | "debug": { 752 | "version": "2.6.8", 753 | "resolved": "http://registry.npm.taobao.org/debug/download/debug-2.6.8.tgz", 754 | "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", 755 | "dev": true, 756 | "requires": { 757 | "ms": "2.0.0" 758 | } 759 | }, 760 | "ms": { 761 | "version": "2.0.0", 762 | "resolved": "http://registry.npm.taobao.org/ms/download/ms-2.0.0.tgz", 763 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", 764 | "dev": true 765 | } 766 | } 767 | }, 768 | "babel-types": { 769 | "version": "6.26.0", 770 | "resolved": "http://registry.npm.taobao.org/babel-types/download/babel-types-6.26.0.tgz", 771 | "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", 772 | "dev": true, 773 | "requires": { 774 | "babel-runtime": "6.26.0", 775 | "esutils": "2.0.2", 776 | "lodash": "4.17.4", 777 | "to-fast-properties": "1.0.3" 778 | } 779 | }, 780 | "babylon": { 781 | "version": "6.18.0", 782 | "resolved": "http://registry.npm.taobao.org/babylon/download/babylon-6.18.0.tgz", 783 | "integrity": "sha1-ry87iPpvXB5MY00aD46sT1WzleM=", 784 | "dev": true 785 | }, 786 | "balanced-match": { 787 | "version": "1.0.0", 788 | "resolved": "http://registry.npm.taobao.org/balanced-match/download/balanced-match-1.0.0.tgz", 789 | "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", 790 | "dev": true 791 | }, 792 | "binary-extensions": { 793 | "version": "1.10.0", 794 | "resolved": "http://registry.npm.taobao.org/binary-extensions/download/binary-extensions-1.10.0.tgz", 795 | "integrity": "sha1-muuabF6IY4qtFx4Wf1kAq+JINdA=", 796 | "dev": true, 797 | "optional": true 798 | }, 799 | "body-parser": { 800 | "version": "https://registry.npm.taobao.org/body-parser/download/body-parser-1.17.1.tgz", 801 | "integrity": "sha1-dbO8mN3W5+DY/+dQ36ylxmmT+kc=", 802 | "requires": { 803 | "bytes": "https://registry.npm.taobao.org/bytes/download/bytes-2.4.0.tgz", 804 | "content-type": "https://registry.npm.taobao.org/content-type/download/content-type-1.0.2.tgz", 805 | "debug": "https://registry.npm.taobao.org/debug/download/debug-2.6.1.tgz", 806 | "depd": "https://registry.npm.taobao.org/depd/download/depd-1.1.0.tgz", 807 | "http-errors": "https://registry.npm.taobao.org/http-errors/download/http-errors-1.6.1.tgz", 808 | "iconv-lite": "https://registry.npm.taobao.org/iconv-lite/download/iconv-lite-0.4.15.tgz", 809 | "on-finished": "https://registry.npm.taobao.org/on-finished/download/on-finished-2.3.0.tgz", 810 | "qs": "https://registry.npm.taobao.org/qs/download/qs-6.4.0.tgz", 811 | "raw-body": "https://registry.npm.taobao.org/raw-body/download/raw-body-2.2.0.tgz", 812 | "type-is": "https://registry.npm.taobao.org/type-is/download/type-is-1.6.15.tgz" 813 | } 814 | }, 815 | "brace-expansion": { 816 | "version": "1.1.8", 817 | "resolved": "http://registry.npm.taobao.org/brace-expansion/download/brace-expansion-1.1.8.tgz", 818 | "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", 819 | "dev": true, 820 | "requires": { 821 | "balanced-match": "1.0.0", 822 | "concat-map": "0.0.1" 823 | } 824 | }, 825 | "braces": { 826 | "version": "1.8.5", 827 | "resolved": "http://registry.npm.taobao.org/braces/download/braces-1.8.5.tgz", 828 | "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", 829 | "dev": true, 830 | "optional": true, 831 | "requires": { 832 | "expand-range": "1.8.2", 833 | "preserve": "0.2.0", 834 | "repeat-element": "1.1.2" 835 | } 836 | }, 837 | "bytes": { 838 | "version": "https://registry.npm.taobao.org/bytes/download/bytes-2.4.0.tgz", 839 | "integrity": "sha1-fZcZb51br39pNeJZhVSe3SpsIzk=" 840 | }, 841 | "chalk": { 842 | "version": "1.1.3", 843 | "resolved": "http://registry.npm.taobao.org/chalk/download/chalk-1.1.3.tgz", 844 | "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", 845 | "dev": true, 846 | "requires": { 847 | "ansi-styles": "2.2.1", 848 | "escape-string-regexp": "1.0.5", 849 | "has-ansi": "2.0.0", 850 | "strip-ansi": "3.0.1", 851 | "supports-color": "2.0.0" 852 | } 853 | }, 854 | "chokidar": { 855 | "version": "1.7.0", 856 | "resolved": "http://registry.npm.taobao.org/chokidar/download/chokidar-1.7.0.tgz", 857 | "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", 858 | "dev": true, 859 | "optional": true, 860 | "requires": { 861 | "anymatch": "1.3.2", 862 | "async-each": "1.0.1", 863 | "fsevents": "1.1.2", 864 | "glob-parent": "2.0.0", 865 | "inherits": "https://registry.npm.taobao.org/inherits/download/inherits-2.0.3.tgz", 866 | "is-binary-path": "1.0.1", 867 | "is-glob": "2.0.1", 868 | "path-is-absolute": "1.0.1", 869 | "readdirp": "2.1.0" 870 | } 871 | }, 872 | "commander": { 873 | "version": "2.11.0", 874 | "resolved": "http://registry.npm.taobao.org/commander/download/commander-2.11.0.tgz", 875 | "integrity": "sha1-FXFS/R56bI2YpbcVzzdt+SgARWM=", 876 | "dev": true 877 | }, 878 | "concat-map": { 879 | "version": "0.0.1", 880 | "resolved": "http://registry.npm.taobao.org/concat-map/download/concat-map-0.0.1.tgz", 881 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", 882 | "dev": true 883 | }, 884 | "content-disposition": { 885 | "version": "https://registry.npm.taobao.org/content-disposition/download/content-disposition-0.5.2.tgz", 886 | "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=" 887 | }, 888 | "content-type": { 889 | "version": "https://registry.npm.taobao.org/content-type/download/content-type-1.0.2.tgz", 890 | "integrity": "sha1-t9ETrueo3Se9IRM8TcJSnfFyHu0=" 891 | }, 892 | "convert-source-map": { 893 | "version": "1.5.0", 894 | "resolved": "http://registry.npm.taobao.org/convert-source-map/download/convert-source-map-1.5.0.tgz", 895 | "integrity": "sha1-ms1whRxtXf3ZPZKC5e35SgP/RrU=", 896 | "dev": true 897 | }, 898 | "cookie": { 899 | "version": "https://registry.npm.taobao.org/cookie/download/cookie-0.3.1.tgz", 900 | "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=" 901 | }, 902 | "cookie-parser": { 903 | "version": "https://registry.npm.taobao.org/cookie-parser/download/cookie-parser-1.4.3.tgz", 904 | "integrity": "sha1-D+MfoZ0AC5X0qt8fU/3CuKIDuqU=", 905 | "requires": { 906 | "cookie": "https://registry.npm.taobao.org/cookie/download/cookie-0.3.1.tgz", 907 | "cookie-signature": "https://registry.npm.taobao.org/cookie-signature/download/cookie-signature-1.0.6.tgz" 908 | } 909 | }, 910 | "cookie-signature": { 911 | "version": "https://registry.npm.taobao.org/cookie-signature/download/cookie-signature-1.0.6.tgz", 912 | "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" 913 | }, 914 | "core-js": { 915 | "version": "2.5.1", 916 | "resolved": "http://registry.npm.taobao.org/core-js/download/core-js-2.5.1.tgz", 917 | "integrity": "sha1-rmh03GaTd4m4B1T/VCjfZoGcpQs=", 918 | "dev": true 919 | }, 920 | "core-util-is": { 921 | "version": "1.0.2", 922 | "resolved": "http://registry.npm.taobao.org/core-util-is/download/core-util-is-1.0.2.tgz", 923 | "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", 924 | "dev": true, 925 | "optional": true 926 | }, 927 | "crc": { 928 | "version": "https://registry.npm.taobao.org/crc/download/crc-3.4.4.tgz", 929 | "integrity": "sha1-naHpgOO9RPxck79as9ozeNheRms=" 930 | }, 931 | "debug": { 932 | "version": "https://registry.npm.taobao.org/debug/download/debug-2.6.1.tgz", 933 | "integrity": "sha1-eYVQkLosTjEVzH2HaUkdWPBJE1E=", 934 | "requires": { 935 | "ms": "https://registry.npm.taobao.org/ms/download/ms-0.7.2.tgz" 936 | } 937 | }, 938 | "depd": { 939 | "version": "https://registry.npm.taobao.org/depd/download/depd-1.1.0.tgz", 940 | "integrity": "sha1-4b2Cxqq2ztlluXuIsX7T5SjKGMM=" 941 | }, 942 | "destroy": { 943 | "version": "https://registry.npm.taobao.org/destroy/download/destroy-1.0.4.tgz", 944 | "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" 945 | }, 946 | "detect-indent": { 947 | "version": "4.0.0", 948 | "resolved": "http://registry.npm.taobao.org/detect-indent/download/detect-indent-4.0.0.tgz", 949 | "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", 950 | "dev": true, 951 | "requires": { 952 | "repeating": "2.0.1" 953 | } 954 | }, 955 | "ee-first": { 956 | "version": "https://registry.npm.taobao.org/ee-first/download/ee-first-1.1.1.tgz", 957 | "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" 958 | }, 959 | "encodeurl": { 960 | "version": "https://registry.npm.taobao.org/encodeurl/download/encodeurl-1.0.1.tgz", 961 | "integrity": "sha1-eePVhlU0aQn+bw9Fpd5oEDspTSA=" 962 | }, 963 | "escape-html": { 964 | "version": "https://registry.npm.taobao.org/escape-html/download/escape-html-1.0.3.tgz", 965 | "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" 966 | }, 967 | "escape-string-regexp": { 968 | "version": "1.0.5", 969 | "resolved": "http://registry.npm.taobao.org/escape-string-regexp/download/escape-string-regexp-1.0.5.tgz", 970 | "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", 971 | "dev": true 972 | }, 973 | "esutils": { 974 | "version": "2.0.2", 975 | "resolved": "http://registry.npm.taobao.org/esutils/download/esutils-2.0.2.tgz", 976 | "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", 977 | "dev": true 978 | }, 979 | "etag": { 980 | "version": "https://registry.npm.taobao.org/etag/download/etag-1.8.0.tgz", 981 | "integrity": "sha1-b2Ma7zNtbEY2K1F2QETOIWvjwFE=" 982 | }, 983 | "expand-brackets": { 984 | "version": "0.1.5", 985 | "resolved": "http://registry.npm.taobao.org/expand-brackets/download/expand-brackets-0.1.5.tgz", 986 | "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", 987 | "dev": true, 988 | "optional": true, 989 | "requires": { 990 | "is-posix-bracket": "0.1.1" 991 | } 992 | }, 993 | "expand-range": { 994 | "version": "1.8.2", 995 | "resolved": "http://registry.npm.taobao.org/expand-range/download/expand-range-1.8.2.tgz", 996 | "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", 997 | "dev": true, 998 | "optional": true, 999 | "requires": { 1000 | "fill-range": "2.2.3" 1001 | } 1002 | }, 1003 | "express": { 1004 | "version": "https://registry.npm.taobao.org/express/download/express-4.15.2.tgz", 1005 | "integrity": "sha1-rxB/wUhQRFfy3Kmm8lcdcSm5ezU=", 1006 | "requires": { 1007 | "accepts": "https://registry.npm.taobao.org/accepts/download/accepts-1.3.3.tgz", 1008 | "array-flatten": "https://registry.npm.taobao.org/array-flatten/download/array-flatten-1.1.1.tgz", 1009 | "content-disposition": "https://registry.npm.taobao.org/content-disposition/download/content-disposition-0.5.2.tgz", 1010 | "content-type": "https://registry.npm.taobao.org/content-type/download/content-type-1.0.2.tgz", 1011 | "cookie": "https://registry.npm.taobao.org/cookie/download/cookie-0.3.1.tgz", 1012 | "cookie-signature": "https://registry.npm.taobao.org/cookie-signature/download/cookie-signature-1.0.6.tgz", 1013 | "debug": "https://registry.npm.taobao.org/debug/download/debug-2.6.1.tgz", 1014 | "depd": "https://registry.npm.taobao.org/depd/download/depd-1.1.0.tgz", 1015 | "encodeurl": "https://registry.npm.taobao.org/encodeurl/download/encodeurl-1.0.1.tgz", 1016 | "escape-html": "https://registry.npm.taobao.org/escape-html/download/escape-html-1.0.3.tgz", 1017 | "etag": "https://registry.npm.taobao.org/etag/download/etag-1.8.0.tgz", 1018 | "finalhandler": "https://registry.npm.taobao.org/finalhandler/download/finalhandler-1.0.1.tgz", 1019 | "fresh": "https://registry.npm.taobao.org/fresh/download/fresh-0.5.0.tgz", 1020 | "merge-descriptors": "https://registry.npm.taobao.org/merge-descriptors/download/merge-descriptors-1.0.1.tgz", 1021 | "methods": "https://registry.npm.taobao.org/methods/download/methods-1.1.2.tgz", 1022 | "on-finished": "https://registry.npm.taobao.org/on-finished/download/on-finished-2.3.0.tgz", 1023 | "parseurl": "https://registry.npm.taobao.org/parseurl/download/parseurl-1.3.1.tgz", 1024 | "path-to-regexp": "https://registry.npm.taobao.org/path-to-regexp/download/path-to-regexp-0.1.7.tgz", 1025 | "proxy-addr": "https://registry.npm.taobao.org/proxy-addr/download/proxy-addr-1.1.4.tgz", 1026 | "qs": "https://registry.npm.taobao.org/qs/download/qs-6.4.0.tgz", 1027 | "range-parser": "https://registry.npm.taobao.org/range-parser/download/range-parser-1.2.0.tgz", 1028 | "send": "https://registry.npm.taobao.org/send/download/send-0.15.1.tgz", 1029 | "serve-static": "https://registry.npm.taobao.org/serve-static/download/serve-static-1.12.1.tgz", 1030 | "setprototypeof": "https://registry.npm.taobao.org/setprototypeof/download/setprototypeof-1.0.3.tgz", 1031 | "statuses": "https://registry.npm.taobao.org/statuses/download/statuses-1.3.1.tgz", 1032 | "type-is": "https://registry.npm.taobao.org/type-is/download/type-is-1.6.15.tgz", 1033 | "utils-merge": "https://registry.npm.taobao.org/utils-merge/download/utils-merge-1.0.0.tgz", 1034 | "vary": "https://registry.npm.taobao.org/vary/download/vary-1.1.1.tgz" 1035 | } 1036 | }, 1037 | "express-session": { 1038 | "version": "https://registry.npm.taobao.org/express-session/download/express-session-1.15.2.tgz", 1039 | "integrity": "sha1-2YUWRDpMy4aI4XJa5YTALapAk9Q=", 1040 | "requires": { 1041 | "cookie": "https://registry.npm.taobao.org/cookie/download/cookie-0.3.1.tgz", 1042 | "cookie-signature": "https://registry.npm.taobao.org/cookie-signature/download/cookie-signature-1.0.6.tgz", 1043 | "crc": "https://registry.npm.taobao.org/crc/download/crc-3.4.4.tgz", 1044 | "debug": "https://registry.npm.taobao.org/debug/download/debug-2.6.3.tgz", 1045 | "depd": "https://registry.npm.taobao.org/depd/download/depd-1.1.0.tgz", 1046 | "on-headers": "https://registry.npm.taobao.org/on-headers/download/on-headers-1.0.1.tgz", 1047 | "parseurl": "https://registry.npm.taobao.org/parseurl/download/parseurl-1.3.1.tgz", 1048 | "uid-safe": "https://registry.npm.taobao.org/uid-safe/download/uid-safe-2.1.4.tgz", 1049 | "utils-merge": "https://registry.npm.taobao.org/utils-merge/download/utils-merge-1.0.0.tgz" 1050 | }, 1051 | "dependencies": { 1052 | "debug": { 1053 | "version": "https://registry.npm.taobao.org/debug/download/debug-2.6.3.tgz", 1054 | "integrity": "sha1-D364wwll7AjHKsz6ATDIt5mEFB0=", 1055 | "requires": { 1056 | "ms": "https://registry.npm.taobao.org/ms/download/ms-0.7.2.tgz" 1057 | } 1058 | } 1059 | } 1060 | }, 1061 | "extglob": { 1062 | "version": "0.3.2", 1063 | "resolved": "http://registry.npm.taobao.org/extglob/download/extglob-0.3.2.tgz", 1064 | "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", 1065 | "dev": true, 1066 | "optional": true, 1067 | "requires": { 1068 | "is-extglob": "1.0.0" 1069 | } 1070 | }, 1071 | "filename-regex": { 1072 | "version": "2.0.1", 1073 | "resolved": "http://registry.npm.taobao.org/filename-regex/download/filename-regex-2.0.1.tgz", 1074 | "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", 1075 | "dev": true, 1076 | "optional": true 1077 | }, 1078 | "fill-range": { 1079 | "version": "2.2.3", 1080 | "resolved": "http://registry.npm.taobao.org/fill-range/download/fill-range-2.2.3.tgz", 1081 | "integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=", 1082 | "dev": true, 1083 | "optional": true, 1084 | "requires": { 1085 | "is-number": "2.1.0", 1086 | "isobject": "2.1.0", 1087 | "randomatic": "1.1.7", 1088 | "repeat-element": "1.1.2", 1089 | "repeat-string": "1.6.1" 1090 | } 1091 | }, 1092 | "finalhandler": { 1093 | "version": "https://registry.npm.taobao.org/finalhandler/download/finalhandler-1.0.1.tgz", 1094 | "integrity": "sha1-vNFdFonA5e1ym29/VBpt+YQRfbg=", 1095 | "requires": { 1096 | "debug": "https://registry.npm.taobao.org/debug/download/debug-2.6.3.tgz", 1097 | "encodeurl": "https://registry.npm.taobao.org/encodeurl/download/encodeurl-1.0.1.tgz", 1098 | "escape-html": "https://registry.npm.taobao.org/escape-html/download/escape-html-1.0.3.tgz", 1099 | "on-finished": "https://registry.npm.taobao.org/on-finished/download/on-finished-2.3.0.tgz", 1100 | "parseurl": "https://registry.npm.taobao.org/parseurl/download/parseurl-1.3.1.tgz", 1101 | "statuses": "https://registry.npm.taobao.org/statuses/download/statuses-1.3.1.tgz", 1102 | "unpipe": "https://registry.npm.taobao.org/unpipe/download/unpipe-1.0.0.tgz" 1103 | }, 1104 | "dependencies": { 1105 | "debug": { 1106 | "version": "https://registry.npm.taobao.org/debug/download/debug-2.6.3.tgz", 1107 | "integrity": "sha1-D364wwll7AjHKsz6ATDIt5mEFB0=", 1108 | "requires": { 1109 | "ms": "https://registry.npm.taobao.org/ms/download/ms-0.7.2.tgz" 1110 | } 1111 | } 1112 | } 1113 | }, 1114 | "for-in": { 1115 | "version": "1.0.2", 1116 | "resolved": "http://registry.npm.taobao.org/for-in/download/for-in-1.0.2.tgz", 1117 | "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", 1118 | "dev": true, 1119 | "optional": true 1120 | }, 1121 | "for-own": { 1122 | "version": "0.1.5", 1123 | "resolved": "http://registry.npm.taobao.org/for-own/download/for-own-0.1.5.tgz", 1124 | "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", 1125 | "dev": true, 1126 | "optional": true, 1127 | "requires": { 1128 | "for-in": "1.0.2" 1129 | } 1130 | }, 1131 | "forwarded": { 1132 | "version": "https://registry.npm.taobao.org/forwarded/download/forwarded-0.1.0.tgz", 1133 | "integrity": "sha1-Ge+YdMSuHCl7zweP3mOgm2aoQ2M=" 1134 | }, 1135 | "fresh": { 1136 | "version": "https://registry.npm.taobao.org/fresh/download/fresh-0.5.0.tgz", 1137 | "integrity": "sha1-9HTKXmqSRtb9jglTz6m5yAWvp44=" 1138 | }, 1139 | "fs-readdir-recursive": { 1140 | "version": "1.0.0", 1141 | "resolved": "http://registry.npm.taobao.org/fs-readdir-recursive/download/fs-readdir-recursive-1.0.0.tgz", 1142 | "integrity": "sha1-jNF0XItPiinIyuw5JHaSG6GV9WA=", 1143 | "dev": true 1144 | }, 1145 | "fs.realpath": { 1146 | "version": "1.0.0", 1147 | "resolved": "http://registry.npm.taobao.org/fs.realpath/download/fs.realpath-1.0.0.tgz", 1148 | "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", 1149 | "dev": true 1150 | }, 1151 | "fsevents": { 1152 | "version": "1.1.2", 1153 | "resolved": "http://registry.npm.taobao.org/fsevents/download/fsevents-1.1.2.tgz", 1154 | "integrity": "sha1-MoK3E/s62A7eDp/PRhG1qm/AM/Q=", 1155 | "dev": true, 1156 | "optional": true, 1157 | "requires": { 1158 | "nan": "2.7.0", 1159 | "node-pre-gyp": "0.6.36" 1160 | }, 1161 | "dependencies": { 1162 | "abbrev": { 1163 | "version": "1.1.0", 1164 | "bundled": true, 1165 | "dev": true, 1166 | "optional": true 1167 | }, 1168 | "ajv": { 1169 | "version": "4.11.8", 1170 | "bundled": true, 1171 | "dev": true, 1172 | "optional": true, 1173 | "requires": { 1174 | "co": "4.6.0", 1175 | "json-stable-stringify": "1.0.1" 1176 | } 1177 | }, 1178 | "ansi-regex": { 1179 | "version": "2.1.1", 1180 | "bundled": true, 1181 | "dev": true 1182 | }, 1183 | "aproba": { 1184 | "version": "1.1.1", 1185 | "bundled": true, 1186 | "dev": true, 1187 | "optional": true 1188 | }, 1189 | "are-we-there-yet": { 1190 | "version": "1.1.4", 1191 | "bundled": true, 1192 | "dev": true, 1193 | "optional": true, 1194 | "requires": { 1195 | "delegates": "1.0.0", 1196 | "readable-stream": "2.2.9" 1197 | } 1198 | }, 1199 | "asn1": { 1200 | "version": "0.2.3", 1201 | "bundled": true, 1202 | "dev": true, 1203 | "optional": true 1204 | }, 1205 | "assert-plus": { 1206 | "version": "0.2.0", 1207 | "bundled": true, 1208 | "dev": true, 1209 | "optional": true 1210 | }, 1211 | "asynckit": { 1212 | "version": "0.4.0", 1213 | "bundled": true, 1214 | "dev": true, 1215 | "optional": true 1216 | }, 1217 | "aws-sign2": { 1218 | "version": "0.6.0", 1219 | "bundled": true, 1220 | "dev": true, 1221 | "optional": true 1222 | }, 1223 | "aws4": { 1224 | "version": "1.6.0", 1225 | "bundled": true, 1226 | "dev": true, 1227 | "optional": true 1228 | }, 1229 | "balanced-match": { 1230 | "version": "0.4.2", 1231 | "bundled": true, 1232 | "dev": true 1233 | }, 1234 | "bcrypt-pbkdf": { 1235 | "version": "1.0.1", 1236 | "bundled": true, 1237 | "dev": true, 1238 | "optional": true, 1239 | "requires": { 1240 | "tweetnacl": "0.14.5" 1241 | } 1242 | }, 1243 | "block-stream": { 1244 | "version": "0.0.9", 1245 | "bundled": true, 1246 | "dev": true, 1247 | "requires": { 1248 | "inherits": "2.0.3" 1249 | } 1250 | }, 1251 | "boom": { 1252 | "version": "2.10.1", 1253 | "bundled": true, 1254 | "dev": true, 1255 | "requires": { 1256 | "hoek": "2.16.3" 1257 | } 1258 | }, 1259 | "brace-expansion": { 1260 | "version": "1.1.7", 1261 | "bundled": true, 1262 | "dev": true, 1263 | "requires": { 1264 | "balanced-match": "0.4.2", 1265 | "concat-map": "0.0.1" 1266 | } 1267 | }, 1268 | "buffer-shims": { 1269 | "version": "1.0.0", 1270 | "bundled": true, 1271 | "dev": true 1272 | }, 1273 | "caseless": { 1274 | "version": "0.12.0", 1275 | "bundled": true, 1276 | "dev": true, 1277 | "optional": true 1278 | }, 1279 | "co": { 1280 | "version": "4.6.0", 1281 | "bundled": true, 1282 | "dev": true, 1283 | "optional": true 1284 | }, 1285 | "code-point-at": { 1286 | "version": "1.1.0", 1287 | "bundled": true, 1288 | "dev": true 1289 | }, 1290 | "combined-stream": { 1291 | "version": "1.0.5", 1292 | "bundled": true, 1293 | "dev": true, 1294 | "requires": { 1295 | "delayed-stream": "1.0.0" 1296 | } 1297 | }, 1298 | "concat-map": { 1299 | "version": "0.0.1", 1300 | "bundled": true, 1301 | "dev": true 1302 | }, 1303 | "console-control-strings": { 1304 | "version": "1.1.0", 1305 | "bundled": true, 1306 | "dev": true 1307 | }, 1308 | "core-util-is": { 1309 | "version": "1.0.2", 1310 | "bundled": true, 1311 | "dev": true 1312 | }, 1313 | "cryptiles": { 1314 | "version": "2.0.5", 1315 | "bundled": true, 1316 | "dev": true, 1317 | "optional": true, 1318 | "requires": { 1319 | "boom": "2.10.1" 1320 | } 1321 | }, 1322 | "dashdash": { 1323 | "version": "1.14.1", 1324 | "bundled": true, 1325 | "dev": true, 1326 | "optional": true, 1327 | "requires": { 1328 | "assert-plus": "1.0.0" 1329 | }, 1330 | "dependencies": { 1331 | "assert-plus": { 1332 | "version": "1.0.0", 1333 | "bundled": true, 1334 | "dev": true, 1335 | "optional": true 1336 | } 1337 | } 1338 | }, 1339 | "debug": { 1340 | "version": "2.6.8", 1341 | "bundled": true, 1342 | "dev": true, 1343 | "optional": true, 1344 | "requires": { 1345 | "ms": "2.0.0" 1346 | } 1347 | }, 1348 | "deep-extend": { 1349 | "version": "0.4.2", 1350 | "bundled": true, 1351 | "dev": true, 1352 | "optional": true 1353 | }, 1354 | "delayed-stream": { 1355 | "version": "1.0.0", 1356 | "bundled": true, 1357 | "dev": true 1358 | }, 1359 | "delegates": { 1360 | "version": "1.0.0", 1361 | "bundled": true, 1362 | "dev": true, 1363 | "optional": true 1364 | }, 1365 | "ecc-jsbn": { 1366 | "version": "0.1.1", 1367 | "bundled": true, 1368 | "dev": true, 1369 | "optional": true, 1370 | "requires": { 1371 | "jsbn": "0.1.1" 1372 | } 1373 | }, 1374 | "extend": { 1375 | "version": "3.0.1", 1376 | "bundled": true, 1377 | "dev": true, 1378 | "optional": true 1379 | }, 1380 | "extsprintf": { 1381 | "version": "1.0.2", 1382 | "bundled": true, 1383 | "dev": true 1384 | }, 1385 | "forever-agent": { 1386 | "version": "0.6.1", 1387 | "bundled": true, 1388 | "dev": true, 1389 | "optional": true 1390 | }, 1391 | "form-data": { 1392 | "version": "2.1.4", 1393 | "bundled": true, 1394 | "dev": true, 1395 | "optional": true, 1396 | "requires": { 1397 | "asynckit": "0.4.0", 1398 | "combined-stream": "1.0.5", 1399 | "mime-types": "2.1.15" 1400 | } 1401 | }, 1402 | "fs.realpath": { 1403 | "version": "1.0.0", 1404 | "bundled": true, 1405 | "dev": true 1406 | }, 1407 | "fstream": { 1408 | "version": "1.0.11", 1409 | "bundled": true, 1410 | "dev": true, 1411 | "requires": { 1412 | "graceful-fs": "4.1.11", 1413 | "inherits": "2.0.3", 1414 | "mkdirp": "0.5.1", 1415 | "rimraf": "2.6.1" 1416 | } 1417 | }, 1418 | "fstream-ignore": { 1419 | "version": "1.0.5", 1420 | "bundled": true, 1421 | "dev": true, 1422 | "optional": true, 1423 | "requires": { 1424 | "fstream": "1.0.11", 1425 | "inherits": "2.0.3", 1426 | "minimatch": "3.0.4" 1427 | } 1428 | }, 1429 | "gauge": { 1430 | "version": "2.7.4", 1431 | "bundled": true, 1432 | "dev": true, 1433 | "optional": true, 1434 | "requires": { 1435 | "aproba": "1.1.1", 1436 | "console-control-strings": "1.1.0", 1437 | "has-unicode": "2.0.1", 1438 | "object-assign": "4.1.1", 1439 | "signal-exit": "3.0.2", 1440 | "string-width": "1.0.2", 1441 | "strip-ansi": "3.0.1", 1442 | "wide-align": "1.1.2" 1443 | } 1444 | }, 1445 | "getpass": { 1446 | "version": "0.1.7", 1447 | "bundled": true, 1448 | "dev": true, 1449 | "optional": true, 1450 | "requires": { 1451 | "assert-plus": "1.0.0" 1452 | }, 1453 | "dependencies": { 1454 | "assert-plus": { 1455 | "version": "1.0.0", 1456 | "bundled": true, 1457 | "dev": true, 1458 | "optional": true 1459 | } 1460 | } 1461 | }, 1462 | "glob": { 1463 | "version": "7.1.2", 1464 | "bundled": true, 1465 | "dev": true, 1466 | "requires": { 1467 | "fs.realpath": "1.0.0", 1468 | "inflight": "1.0.6", 1469 | "inherits": "2.0.3", 1470 | "minimatch": "3.0.4", 1471 | "once": "1.4.0", 1472 | "path-is-absolute": "1.0.1" 1473 | } 1474 | }, 1475 | "graceful-fs": { 1476 | "version": "4.1.11", 1477 | "bundled": true, 1478 | "dev": true 1479 | }, 1480 | "har-schema": { 1481 | "version": "1.0.5", 1482 | "bundled": true, 1483 | "dev": true, 1484 | "optional": true 1485 | }, 1486 | "har-validator": { 1487 | "version": "4.2.1", 1488 | "bundled": true, 1489 | "dev": true, 1490 | "optional": true, 1491 | "requires": { 1492 | "ajv": "4.11.8", 1493 | "har-schema": "1.0.5" 1494 | } 1495 | }, 1496 | "has-unicode": { 1497 | "version": "2.0.1", 1498 | "bundled": true, 1499 | "dev": true, 1500 | "optional": true 1501 | }, 1502 | "hawk": { 1503 | "version": "3.1.3", 1504 | "bundled": true, 1505 | "dev": true, 1506 | "optional": true, 1507 | "requires": { 1508 | "boom": "2.10.1", 1509 | "cryptiles": "2.0.5", 1510 | "hoek": "2.16.3", 1511 | "sntp": "1.0.9" 1512 | } 1513 | }, 1514 | "hoek": { 1515 | "version": "2.16.3", 1516 | "bundled": true, 1517 | "dev": true 1518 | }, 1519 | "http-signature": { 1520 | "version": "1.1.1", 1521 | "bundled": true, 1522 | "dev": true, 1523 | "optional": true, 1524 | "requires": { 1525 | "assert-plus": "0.2.0", 1526 | "jsprim": "1.4.0", 1527 | "sshpk": "1.13.0" 1528 | } 1529 | }, 1530 | "inflight": { 1531 | "version": "1.0.6", 1532 | "bundled": true, 1533 | "dev": true, 1534 | "requires": { 1535 | "once": "1.4.0", 1536 | "wrappy": "1.0.2" 1537 | } 1538 | }, 1539 | "inherits": { 1540 | "version": "2.0.3", 1541 | "bundled": true, 1542 | "dev": true 1543 | }, 1544 | "ini": { 1545 | "version": "1.3.4", 1546 | "bundled": true, 1547 | "dev": true, 1548 | "optional": true 1549 | }, 1550 | "is-fullwidth-code-point": { 1551 | "version": "1.0.0", 1552 | "bundled": true, 1553 | "dev": true, 1554 | "requires": { 1555 | "number-is-nan": "1.0.1" 1556 | } 1557 | }, 1558 | "is-typedarray": { 1559 | "version": "1.0.0", 1560 | "bundled": true, 1561 | "dev": true, 1562 | "optional": true 1563 | }, 1564 | "isarray": { 1565 | "version": "1.0.0", 1566 | "bundled": true, 1567 | "dev": true 1568 | }, 1569 | "isstream": { 1570 | "version": "0.1.2", 1571 | "bundled": true, 1572 | "dev": true, 1573 | "optional": true 1574 | }, 1575 | "jodid25519": { 1576 | "version": "1.0.2", 1577 | "bundled": true, 1578 | "dev": true, 1579 | "optional": true, 1580 | "requires": { 1581 | "jsbn": "0.1.1" 1582 | } 1583 | }, 1584 | "jsbn": { 1585 | "version": "0.1.1", 1586 | "bundled": true, 1587 | "dev": true, 1588 | "optional": true 1589 | }, 1590 | "json-schema": { 1591 | "version": "0.2.3", 1592 | "bundled": true, 1593 | "dev": true, 1594 | "optional": true 1595 | }, 1596 | "json-stable-stringify": { 1597 | "version": "1.0.1", 1598 | "bundled": true, 1599 | "dev": true, 1600 | "optional": true, 1601 | "requires": { 1602 | "jsonify": "0.0.0" 1603 | } 1604 | }, 1605 | "json-stringify-safe": { 1606 | "version": "5.0.1", 1607 | "bundled": true, 1608 | "dev": true, 1609 | "optional": true 1610 | }, 1611 | "jsonify": { 1612 | "version": "0.0.0", 1613 | "bundled": true, 1614 | "dev": true, 1615 | "optional": true 1616 | }, 1617 | "jsprim": { 1618 | "version": "1.4.0", 1619 | "bundled": true, 1620 | "dev": true, 1621 | "optional": true, 1622 | "requires": { 1623 | "assert-plus": "1.0.0", 1624 | "extsprintf": "1.0.2", 1625 | "json-schema": "0.2.3", 1626 | "verror": "1.3.6" 1627 | }, 1628 | "dependencies": { 1629 | "assert-plus": { 1630 | "version": "1.0.0", 1631 | "bundled": true, 1632 | "dev": true, 1633 | "optional": true 1634 | } 1635 | } 1636 | }, 1637 | "mime-db": { 1638 | "version": "1.27.0", 1639 | "bundled": true, 1640 | "dev": true 1641 | }, 1642 | "mime-types": { 1643 | "version": "2.1.15", 1644 | "bundled": true, 1645 | "dev": true, 1646 | "requires": { 1647 | "mime-db": "1.27.0" 1648 | } 1649 | }, 1650 | "minimatch": { 1651 | "version": "3.0.4", 1652 | "bundled": true, 1653 | "dev": true, 1654 | "requires": { 1655 | "brace-expansion": "1.1.7" 1656 | } 1657 | }, 1658 | "minimist": { 1659 | "version": "0.0.8", 1660 | "bundled": true, 1661 | "dev": true 1662 | }, 1663 | "mkdirp": { 1664 | "version": "0.5.1", 1665 | "bundled": true, 1666 | "dev": true, 1667 | "requires": { 1668 | "minimist": "0.0.8" 1669 | } 1670 | }, 1671 | "ms": { 1672 | "version": "2.0.0", 1673 | "bundled": true, 1674 | "dev": true, 1675 | "optional": true 1676 | }, 1677 | "node-pre-gyp": { 1678 | "version": "0.6.36", 1679 | "bundled": true, 1680 | "dev": true, 1681 | "optional": true, 1682 | "requires": { 1683 | "mkdirp": "0.5.1", 1684 | "nopt": "4.0.1", 1685 | "npmlog": "4.1.0", 1686 | "rc": "1.2.1", 1687 | "request": "2.81.0", 1688 | "rimraf": "2.6.1", 1689 | "semver": "5.3.0", 1690 | "tar": "2.2.1", 1691 | "tar-pack": "3.4.0" 1692 | } 1693 | }, 1694 | "nopt": { 1695 | "version": "4.0.1", 1696 | "bundled": true, 1697 | "dev": true, 1698 | "optional": true, 1699 | "requires": { 1700 | "abbrev": "1.1.0", 1701 | "osenv": "0.1.4" 1702 | } 1703 | }, 1704 | "npmlog": { 1705 | "version": "4.1.0", 1706 | "bundled": true, 1707 | "dev": true, 1708 | "optional": true, 1709 | "requires": { 1710 | "are-we-there-yet": "1.1.4", 1711 | "console-control-strings": "1.1.0", 1712 | "gauge": "2.7.4", 1713 | "set-blocking": "2.0.0" 1714 | } 1715 | }, 1716 | "number-is-nan": { 1717 | "version": "1.0.1", 1718 | "bundled": true, 1719 | "dev": true 1720 | }, 1721 | "oauth-sign": { 1722 | "version": "0.8.2", 1723 | "bundled": true, 1724 | "dev": true, 1725 | "optional": true 1726 | }, 1727 | "object-assign": { 1728 | "version": "4.1.1", 1729 | "bundled": true, 1730 | "dev": true, 1731 | "optional": true 1732 | }, 1733 | "once": { 1734 | "version": "1.4.0", 1735 | "bundled": true, 1736 | "dev": true, 1737 | "requires": { 1738 | "wrappy": "1.0.2" 1739 | } 1740 | }, 1741 | "os-homedir": { 1742 | "version": "1.0.2", 1743 | "bundled": true, 1744 | "dev": true, 1745 | "optional": true 1746 | }, 1747 | "os-tmpdir": { 1748 | "version": "1.0.2", 1749 | "bundled": true, 1750 | "dev": true, 1751 | "optional": true 1752 | }, 1753 | "osenv": { 1754 | "version": "0.1.4", 1755 | "bundled": true, 1756 | "dev": true, 1757 | "optional": true, 1758 | "requires": { 1759 | "os-homedir": "1.0.2", 1760 | "os-tmpdir": "1.0.2" 1761 | } 1762 | }, 1763 | "path-is-absolute": { 1764 | "version": "1.0.1", 1765 | "bundled": true, 1766 | "dev": true 1767 | }, 1768 | "performance-now": { 1769 | "version": "0.2.0", 1770 | "bundled": true, 1771 | "dev": true, 1772 | "optional": true 1773 | }, 1774 | "process-nextick-args": { 1775 | "version": "1.0.7", 1776 | "bundled": true, 1777 | "dev": true 1778 | }, 1779 | "punycode": { 1780 | "version": "1.4.1", 1781 | "bundled": true, 1782 | "dev": true, 1783 | "optional": true 1784 | }, 1785 | "qs": { 1786 | "version": "6.4.0", 1787 | "bundled": true, 1788 | "dev": true, 1789 | "optional": true 1790 | }, 1791 | "rc": { 1792 | "version": "1.2.1", 1793 | "bundled": true, 1794 | "dev": true, 1795 | "optional": true, 1796 | "requires": { 1797 | "deep-extend": "0.4.2", 1798 | "ini": "1.3.4", 1799 | "minimist": "1.2.0", 1800 | "strip-json-comments": "2.0.1" 1801 | }, 1802 | "dependencies": { 1803 | "minimist": { 1804 | "version": "1.2.0", 1805 | "bundled": true, 1806 | "dev": true, 1807 | "optional": true 1808 | } 1809 | } 1810 | }, 1811 | "readable-stream": { 1812 | "version": "2.2.9", 1813 | "bundled": true, 1814 | "dev": true, 1815 | "requires": { 1816 | "buffer-shims": "1.0.0", 1817 | "core-util-is": "1.0.2", 1818 | "inherits": "2.0.3", 1819 | "isarray": "1.0.0", 1820 | "process-nextick-args": "1.0.7", 1821 | "string_decoder": "1.0.1", 1822 | "util-deprecate": "1.0.2" 1823 | } 1824 | }, 1825 | "request": { 1826 | "version": "2.81.0", 1827 | "bundled": true, 1828 | "dev": true, 1829 | "optional": true, 1830 | "requires": { 1831 | "aws-sign2": "0.6.0", 1832 | "aws4": "1.6.0", 1833 | "caseless": "0.12.0", 1834 | "combined-stream": "1.0.5", 1835 | "extend": "3.0.1", 1836 | "forever-agent": "0.6.1", 1837 | "form-data": "2.1.4", 1838 | "har-validator": "4.2.1", 1839 | "hawk": "3.1.3", 1840 | "http-signature": "1.1.1", 1841 | "is-typedarray": "1.0.0", 1842 | "isstream": "0.1.2", 1843 | "json-stringify-safe": "5.0.1", 1844 | "mime-types": "2.1.15", 1845 | "oauth-sign": "0.8.2", 1846 | "performance-now": "0.2.0", 1847 | "qs": "6.4.0", 1848 | "safe-buffer": "5.0.1", 1849 | "stringstream": "0.0.5", 1850 | "tough-cookie": "2.3.2", 1851 | "tunnel-agent": "0.6.0", 1852 | "uuid": "3.0.1" 1853 | } 1854 | }, 1855 | "rimraf": { 1856 | "version": "2.6.1", 1857 | "bundled": true, 1858 | "dev": true, 1859 | "requires": { 1860 | "glob": "7.1.2" 1861 | } 1862 | }, 1863 | "safe-buffer": { 1864 | "version": "5.0.1", 1865 | "bundled": true, 1866 | "dev": true 1867 | }, 1868 | "semver": { 1869 | "version": "5.3.0", 1870 | "bundled": true, 1871 | "dev": true, 1872 | "optional": true 1873 | }, 1874 | "set-blocking": { 1875 | "version": "2.0.0", 1876 | "bundled": true, 1877 | "dev": true, 1878 | "optional": true 1879 | }, 1880 | "signal-exit": { 1881 | "version": "3.0.2", 1882 | "bundled": true, 1883 | "dev": true, 1884 | "optional": true 1885 | }, 1886 | "sntp": { 1887 | "version": "1.0.9", 1888 | "bundled": true, 1889 | "dev": true, 1890 | "optional": true, 1891 | "requires": { 1892 | "hoek": "2.16.3" 1893 | } 1894 | }, 1895 | "sshpk": { 1896 | "version": "1.13.0", 1897 | "bundled": true, 1898 | "dev": true, 1899 | "optional": true, 1900 | "requires": { 1901 | "asn1": "0.2.3", 1902 | "assert-plus": "1.0.0", 1903 | "bcrypt-pbkdf": "1.0.1", 1904 | "dashdash": "1.14.1", 1905 | "ecc-jsbn": "0.1.1", 1906 | "getpass": "0.1.7", 1907 | "jodid25519": "1.0.2", 1908 | "jsbn": "0.1.1", 1909 | "tweetnacl": "0.14.5" 1910 | }, 1911 | "dependencies": { 1912 | "assert-plus": { 1913 | "version": "1.0.0", 1914 | "bundled": true, 1915 | "dev": true, 1916 | "optional": true 1917 | } 1918 | } 1919 | }, 1920 | "string-width": { 1921 | "version": "1.0.2", 1922 | "bundled": true, 1923 | "dev": true, 1924 | "requires": { 1925 | "code-point-at": "1.1.0", 1926 | "is-fullwidth-code-point": "1.0.0", 1927 | "strip-ansi": "3.0.1" 1928 | } 1929 | }, 1930 | "string_decoder": { 1931 | "version": "1.0.1", 1932 | "bundled": true, 1933 | "dev": true, 1934 | "requires": { 1935 | "safe-buffer": "5.0.1" 1936 | } 1937 | }, 1938 | "stringstream": { 1939 | "version": "0.0.5", 1940 | "bundled": true, 1941 | "dev": true, 1942 | "optional": true 1943 | }, 1944 | "strip-ansi": { 1945 | "version": "3.0.1", 1946 | "bundled": true, 1947 | "dev": true, 1948 | "requires": { 1949 | "ansi-regex": "2.1.1" 1950 | } 1951 | }, 1952 | "strip-json-comments": { 1953 | "version": "2.0.1", 1954 | "bundled": true, 1955 | "dev": true, 1956 | "optional": true 1957 | }, 1958 | "tar": { 1959 | "version": "2.2.1", 1960 | "bundled": true, 1961 | "dev": true, 1962 | "requires": { 1963 | "block-stream": "0.0.9", 1964 | "fstream": "1.0.11", 1965 | "inherits": "2.0.3" 1966 | } 1967 | }, 1968 | "tar-pack": { 1969 | "version": "3.4.0", 1970 | "bundled": true, 1971 | "dev": true, 1972 | "optional": true, 1973 | "requires": { 1974 | "debug": "2.6.8", 1975 | "fstream": "1.0.11", 1976 | "fstream-ignore": "1.0.5", 1977 | "once": "1.4.0", 1978 | "readable-stream": "2.2.9", 1979 | "rimraf": "2.6.1", 1980 | "tar": "2.2.1", 1981 | "uid-number": "0.0.6" 1982 | } 1983 | }, 1984 | "tough-cookie": { 1985 | "version": "2.3.2", 1986 | "bundled": true, 1987 | "dev": true, 1988 | "optional": true, 1989 | "requires": { 1990 | "punycode": "1.4.1" 1991 | } 1992 | }, 1993 | "tunnel-agent": { 1994 | "version": "0.6.0", 1995 | "bundled": true, 1996 | "dev": true, 1997 | "optional": true, 1998 | "requires": { 1999 | "safe-buffer": "5.0.1" 2000 | } 2001 | }, 2002 | "tweetnacl": { 2003 | "version": "0.14.5", 2004 | "bundled": true, 2005 | "dev": true, 2006 | "optional": true 2007 | }, 2008 | "uid-number": { 2009 | "version": "0.0.6", 2010 | "bundled": true, 2011 | "dev": true, 2012 | "optional": true 2013 | }, 2014 | "util-deprecate": { 2015 | "version": "1.0.2", 2016 | "bundled": true, 2017 | "dev": true 2018 | }, 2019 | "uuid": { 2020 | "version": "3.0.1", 2021 | "bundled": true, 2022 | "dev": true, 2023 | "optional": true 2024 | }, 2025 | "verror": { 2026 | "version": "1.3.6", 2027 | "bundled": true, 2028 | "dev": true, 2029 | "optional": true, 2030 | "requires": { 2031 | "extsprintf": "1.0.2" 2032 | } 2033 | }, 2034 | "wide-align": { 2035 | "version": "1.1.2", 2036 | "bundled": true, 2037 | "dev": true, 2038 | "optional": true, 2039 | "requires": { 2040 | "string-width": "1.0.2" 2041 | } 2042 | }, 2043 | "wrappy": { 2044 | "version": "1.0.2", 2045 | "bundled": true, 2046 | "dev": true 2047 | } 2048 | } 2049 | }, 2050 | "glob": { 2051 | "version": "7.1.2", 2052 | "resolved": "http://registry.npm.taobao.org/glob/download/glob-7.1.2.tgz", 2053 | "integrity": "sha1-wZyd+aAocC1nhhI4SmVSQExjbRU=", 2054 | "dev": true, 2055 | "requires": { 2056 | "fs.realpath": "1.0.0", 2057 | "inflight": "1.0.6", 2058 | "inherits": "https://registry.npm.taobao.org/inherits/download/inherits-2.0.3.tgz", 2059 | "minimatch": "3.0.4", 2060 | "once": "1.4.0", 2061 | "path-is-absolute": "1.0.1" 2062 | } 2063 | }, 2064 | "glob-base": { 2065 | "version": "0.3.0", 2066 | "resolved": "http://registry.npm.taobao.org/glob-base/download/glob-base-0.3.0.tgz", 2067 | "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", 2068 | "dev": true, 2069 | "optional": true, 2070 | "requires": { 2071 | "glob-parent": "2.0.0", 2072 | "is-glob": "2.0.1" 2073 | } 2074 | }, 2075 | "glob-parent": { 2076 | "version": "2.0.0", 2077 | "resolved": "http://registry.npm.taobao.org/glob-parent/download/glob-parent-2.0.0.tgz", 2078 | "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", 2079 | "dev": true, 2080 | "requires": { 2081 | "is-glob": "2.0.1" 2082 | } 2083 | }, 2084 | "globals": { 2085 | "version": "9.18.0", 2086 | "resolved": "http://registry.npm.taobao.org/globals/download/globals-9.18.0.tgz", 2087 | "integrity": "sha1-qjiWs+abSH8X4x7SFD1pqOMMLYo=", 2088 | "dev": true 2089 | }, 2090 | "graceful-fs": { 2091 | "version": "4.1.11", 2092 | "resolved": "http://registry.npm.taobao.org/graceful-fs/download/graceful-fs-4.1.11.tgz", 2093 | "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", 2094 | "dev": true 2095 | }, 2096 | "has-ansi": { 2097 | "version": "2.0.0", 2098 | "resolved": "http://registry.npm.taobao.org/has-ansi/download/has-ansi-2.0.0.tgz", 2099 | "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", 2100 | "dev": true, 2101 | "requires": { 2102 | "ansi-regex": "2.1.1" 2103 | } 2104 | }, 2105 | "home-or-tmp": { 2106 | "version": "2.0.0", 2107 | "resolved": "http://registry.npm.taobao.org/home-or-tmp/download/home-or-tmp-2.0.0.tgz", 2108 | "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=", 2109 | "dev": true, 2110 | "requires": { 2111 | "os-homedir": "1.0.2", 2112 | "os-tmpdir": "1.0.2" 2113 | } 2114 | }, 2115 | "http-errors": { 2116 | "version": "https://registry.npm.taobao.org/http-errors/download/http-errors-1.6.1.tgz", 2117 | "integrity": "sha1-X4uO2YrKVFZWv1cplzh/kEpyIlc=", 2118 | "requires": { 2119 | "depd": "https://registry.npm.taobao.org/depd/download/depd-1.1.0.tgz", 2120 | "inherits": "https://registry.npm.taobao.org/inherits/download/inherits-2.0.3.tgz", 2121 | "setprototypeof": "https://registry.npm.taobao.org/setprototypeof/download/setprototypeof-1.0.3.tgz", 2122 | "statuses": "https://registry.npm.taobao.org/statuses/download/statuses-1.3.1.tgz" 2123 | } 2124 | }, 2125 | "iconv-lite": { 2126 | "version": "https://registry.npm.taobao.org/iconv-lite/download/iconv-lite-0.4.15.tgz", 2127 | "integrity": "sha1-/iZaIYrGpXz+hUkn6dBMGYJe3es=" 2128 | }, 2129 | "inflight": { 2130 | "version": "1.0.6", 2131 | "resolved": "http://registry.npm.taobao.org/inflight/download/inflight-1.0.6.tgz", 2132 | "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", 2133 | "dev": true, 2134 | "requires": { 2135 | "once": "1.4.0", 2136 | "wrappy": "1.0.2" 2137 | } 2138 | }, 2139 | "inherits": { 2140 | "version": "https://registry.npm.taobao.org/inherits/download/inherits-2.0.3.tgz", 2141 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" 2142 | }, 2143 | "invariant": { 2144 | "version": "2.2.2", 2145 | "resolved": "http://registry.npm.taobao.org/invariant/download/invariant-2.2.2.tgz", 2146 | "integrity": "sha1-nh9WrArNtr8wMwbzOL47IErmA2A=", 2147 | "dev": true, 2148 | "requires": { 2149 | "loose-envify": "1.3.1" 2150 | } 2151 | }, 2152 | "ipaddr.js": { 2153 | "version": "https://registry.npm.taobao.org/ipaddr.js/download/ipaddr.js-1.3.0.tgz", 2154 | "integrity": "sha1-HgOlL9rYOou7KyXL9JmLTP/NPew=" 2155 | }, 2156 | "is-binary-path": { 2157 | "version": "1.0.1", 2158 | "resolved": "http://registry.npm.taobao.org/is-binary-path/download/is-binary-path-1.0.1.tgz", 2159 | "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", 2160 | "dev": true, 2161 | "optional": true, 2162 | "requires": { 2163 | "binary-extensions": "1.10.0" 2164 | } 2165 | }, 2166 | "is-buffer": { 2167 | "version": "1.1.5", 2168 | "resolved": "http://registry.npm.taobao.org/is-buffer/download/is-buffer-1.1.5.tgz", 2169 | "integrity": "sha1-Hzsm72E7IUuIy8ojzGwB2Hlh7sw=", 2170 | "dev": true 2171 | }, 2172 | "is-dotfile": { 2173 | "version": "1.0.3", 2174 | "resolved": "http://registry.npm.taobao.org/is-dotfile/download/is-dotfile-1.0.3.tgz", 2175 | "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", 2176 | "dev": true, 2177 | "optional": true 2178 | }, 2179 | "is-equal-shallow": { 2180 | "version": "0.1.3", 2181 | "resolved": "http://registry.npm.taobao.org/is-equal-shallow/download/is-equal-shallow-0.1.3.tgz", 2182 | "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", 2183 | "dev": true, 2184 | "optional": true, 2185 | "requires": { 2186 | "is-primitive": "2.0.0" 2187 | } 2188 | }, 2189 | "is-extendable": { 2190 | "version": "0.1.1", 2191 | "resolved": "http://registry.npm.taobao.org/is-extendable/download/is-extendable-0.1.1.tgz", 2192 | "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", 2193 | "dev": true, 2194 | "optional": true 2195 | }, 2196 | "is-extglob": { 2197 | "version": "1.0.0", 2198 | "resolved": "http://registry.npm.taobao.org/is-extglob/download/is-extglob-1.0.0.tgz", 2199 | "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", 2200 | "dev": true 2201 | }, 2202 | "is-finite": { 2203 | "version": "1.0.2", 2204 | "resolved": "http://registry.npm.taobao.org/is-finite/download/is-finite-1.0.2.tgz", 2205 | "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", 2206 | "dev": true, 2207 | "requires": { 2208 | "number-is-nan": "1.0.1" 2209 | } 2210 | }, 2211 | "is-glob": { 2212 | "version": "2.0.1", 2213 | "resolved": "http://registry.npm.taobao.org/is-glob/download/is-glob-2.0.1.tgz", 2214 | "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", 2215 | "dev": true, 2216 | "requires": { 2217 | "is-extglob": "1.0.0" 2218 | } 2219 | }, 2220 | "is-number": { 2221 | "version": "2.1.0", 2222 | "resolved": "http://registry.npm.taobao.org/is-number/download/is-number-2.1.0.tgz", 2223 | "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", 2224 | "dev": true, 2225 | "optional": true, 2226 | "requires": { 2227 | "kind-of": "3.2.2" 2228 | } 2229 | }, 2230 | "is-posix-bracket": { 2231 | "version": "0.1.1", 2232 | "resolved": "http://registry.npm.taobao.org/is-posix-bracket/download/is-posix-bracket-0.1.1.tgz", 2233 | "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", 2234 | "dev": true, 2235 | "optional": true 2236 | }, 2237 | "is-primitive": { 2238 | "version": "2.0.0", 2239 | "resolved": "http://registry.npm.taobao.org/is-primitive/download/is-primitive-2.0.0.tgz", 2240 | "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", 2241 | "dev": true, 2242 | "optional": true 2243 | }, 2244 | "isarray": { 2245 | "version": "1.0.0", 2246 | "resolved": "http://registry.npm.taobao.org/isarray/download/isarray-1.0.0.tgz", 2247 | "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", 2248 | "dev": true 2249 | }, 2250 | "isobject": { 2251 | "version": "2.1.0", 2252 | "resolved": "http://registry.npm.taobao.org/isobject/download/isobject-2.1.0.tgz", 2253 | "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", 2254 | "dev": true, 2255 | "optional": true, 2256 | "requires": { 2257 | "isarray": "1.0.0" 2258 | } 2259 | }, 2260 | "js-tokens": { 2261 | "version": "3.0.2", 2262 | "resolved": "http://registry.npm.taobao.org/js-tokens/download/js-tokens-3.0.2.tgz", 2263 | "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", 2264 | "dev": true 2265 | }, 2266 | "jsesc": { 2267 | "version": "1.3.0", 2268 | "resolved": "http://registry.npm.taobao.org/jsesc/download/jsesc-1.3.0.tgz", 2269 | "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", 2270 | "dev": true 2271 | }, 2272 | "json5": { 2273 | "version": "0.5.1", 2274 | "resolved": "http://registry.npm.taobao.org/json5/download/json5-0.5.1.tgz", 2275 | "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", 2276 | "dev": true 2277 | }, 2278 | "kind-of": { 2279 | "version": "3.2.2", 2280 | "resolved": "http://registry.npm.taobao.org/kind-of/download/kind-of-3.2.2.tgz", 2281 | "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", 2282 | "dev": true, 2283 | "requires": { 2284 | "is-buffer": "1.1.5" 2285 | } 2286 | }, 2287 | "lodash": { 2288 | "version": "4.17.4", 2289 | "resolved": "http://registry.npm.taobao.org/lodash/download/lodash-4.17.4.tgz", 2290 | "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=", 2291 | "dev": true 2292 | }, 2293 | "loose-envify": { 2294 | "version": "1.3.1", 2295 | "resolved": "http://registry.npm.taobao.org/loose-envify/download/loose-envify-1.3.1.tgz", 2296 | "integrity": "sha1-0aitM/qc4OcT1l/dCsi3SNR4yEg=", 2297 | "dev": true, 2298 | "requires": { 2299 | "js-tokens": "3.0.2" 2300 | } 2301 | }, 2302 | "media-typer": { 2303 | "version": "https://registry.npm.taobao.org/media-typer/download/media-typer-0.3.0.tgz", 2304 | "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" 2305 | }, 2306 | "merge-descriptors": { 2307 | "version": "https://registry.npm.taobao.org/merge-descriptors/download/merge-descriptors-1.0.1.tgz", 2308 | "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" 2309 | }, 2310 | "methods": { 2311 | "version": "https://registry.npm.taobao.org/methods/download/methods-1.1.2.tgz", 2312 | "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" 2313 | }, 2314 | "micromatch": { 2315 | "version": "2.3.11", 2316 | "resolved": "http://registry.npm.taobao.org/micromatch/download/micromatch-2.3.11.tgz", 2317 | "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", 2318 | "dev": true, 2319 | "optional": true, 2320 | "requires": { 2321 | "arr-diff": "2.0.0", 2322 | "array-unique": "0.2.1", 2323 | "braces": "1.8.5", 2324 | "expand-brackets": "0.1.5", 2325 | "extglob": "0.3.2", 2326 | "filename-regex": "2.0.1", 2327 | "is-extglob": "1.0.0", 2328 | "is-glob": "2.0.1", 2329 | "kind-of": "3.2.2", 2330 | "normalize-path": "2.1.1", 2331 | "object.omit": "2.0.1", 2332 | "parse-glob": "3.0.4", 2333 | "regex-cache": "0.4.4" 2334 | } 2335 | }, 2336 | "mime": { 2337 | "version": "https://registry.npm.taobao.org/mime/download/mime-1.3.4.tgz", 2338 | "integrity": "sha1-EV+eO2s9rylZmDyzjxSaLUDrXVM=" 2339 | }, 2340 | "mime-db": { 2341 | "version": "https://registry.npm.taobao.org/mime-db/download/mime-db-1.27.0.tgz", 2342 | "integrity": "sha1-gg9XIpa70g7CXtVeW13oaeVDbrE=" 2343 | }, 2344 | "mime-types": { 2345 | "version": "https://registry.npm.taobao.org/mime-types/download/mime-types-2.1.15.tgz", 2346 | "integrity": "sha1-pOv1BkCUVpI3uM9wBGd20J/JKu0=", 2347 | "requires": { 2348 | "mime-db": "https://registry.npm.taobao.org/mime-db/download/mime-db-1.27.0.tgz" 2349 | } 2350 | }, 2351 | "minimatch": { 2352 | "version": "3.0.4", 2353 | "resolved": "http://registry.npm.taobao.org/minimatch/download/minimatch-3.0.4.tgz", 2354 | "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", 2355 | "dev": true, 2356 | "requires": { 2357 | "brace-expansion": "1.1.8" 2358 | } 2359 | }, 2360 | "minimist": { 2361 | "version": "0.0.8", 2362 | "resolved": "http://registry.npm.taobao.org/minimist/download/minimist-0.0.8.tgz", 2363 | "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", 2364 | "dev": true 2365 | }, 2366 | "mkdirp": { 2367 | "version": "0.5.1", 2368 | "resolved": "http://registry.npm.taobao.org/mkdirp/download/mkdirp-0.5.1.tgz", 2369 | "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", 2370 | "dev": true, 2371 | "requires": { 2372 | "minimist": "0.0.8" 2373 | } 2374 | }, 2375 | "ms": { 2376 | "version": "https://registry.npm.taobao.org/ms/download/ms-0.7.2.tgz", 2377 | "integrity": "sha1-riXPJRKziFodldfwN4aNhDESR2U=" 2378 | }, 2379 | "nan": { 2380 | "version": "2.7.0", 2381 | "resolved": "http://registry.npm.taobao.org/nan/download/nan-2.7.0.tgz", 2382 | "integrity": "sha1-2Vv3IeyHfgjbJ27T/G63j5CDrUY=", 2383 | "dev": true, 2384 | "optional": true 2385 | }, 2386 | "negotiator": { 2387 | "version": "https://registry.npm.taobao.org/negotiator/download/negotiator-0.6.1.tgz", 2388 | "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=" 2389 | }, 2390 | "normalize-path": { 2391 | "version": "2.1.1", 2392 | "resolved": "http://registry.npm.taobao.org/normalize-path/download/normalize-path-2.1.1.tgz", 2393 | "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", 2394 | "dev": true, 2395 | "requires": { 2396 | "remove-trailing-separator": "1.1.0" 2397 | } 2398 | }, 2399 | "number-is-nan": { 2400 | "version": "1.0.1", 2401 | "resolved": "http://registry.npm.taobao.org/number-is-nan/download/number-is-nan-1.0.1.tgz", 2402 | "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", 2403 | "dev": true 2404 | }, 2405 | "object-assign": { 2406 | "version": "4.1.1", 2407 | "resolved": "http://registry.npm.taobao.org/object-assign/download/object-assign-4.1.1.tgz", 2408 | "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", 2409 | "dev": true 2410 | }, 2411 | "object.omit": { 2412 | "version": "2.0.1", 2413 | "resolved": "http://registry.npm.taobao.org/object.omit/download/object.omit-2.0.1.tgz", 2414 | "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", 2415 | "dev": true, 2416 | "optional": true, 2417 | "requires": { 2418 | "for-own": "0.1.5", 2419 | "is-extendable": "0.1.1" 2420 | } 2421 | }, 2422 | "on-finished": { 2423 | "version": "https://registry.npm.taobao.org/on-finished/download/on-finished-2.3.0.tgz", 2424 | "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", 2425 | "requires": { 2426 | "ee-first": "https://registry.npm.taobao.org/ee-first/download/ee-first-1.1.1.tgz" 2427 | } 2428 | }, 2429 | "on-headers": { 2430 | "version": "https://registry.npm.taobao.org/on-headers/download/on-headers-1.0.1.tgz", 2431 | "integrity": "sha1-ko9dD0cNSTQmUepnlLCFfBAGk/c=" 2432 | }, 2433 | "once": { 2434 | "version": "1.4.0", 2435 | "resolved": "http://registry.npm.taobao.org/once/download/once-1.4.0.tgz", 2436 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", 2437 | "dev": true, 2438 | "requires": { 2439 | "wrappy": "1.0.2" 2440 | } 2441 | }, 2442 | "os-homedir": { 2443 | "version": "1.0.2", 2444 | "resolved": "http://registry.npm.taobao.org/os-homedir/download/os-homedir-1.0.2.tgz", 2445 | "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", 2446 | "dev": true 2447 | }, 2448 | "os-tmpdir": { 2449 | "version": "1.0.2", 2450 | "resolved": "http://registry.npm.taobao.org/os-tmpdir/download/os-tmpdir-1.0.2.tgz", 2451 | "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", 2452 | "dev": true 2453 | }, 2454 | "output-file-sync": { 2455 | "version": "1.1.2", 2456 | "resolved": "http://registry.npm.taobao.org/output-file-sync/download/output-file-sync-1.1.2.tgz", 2457 | "integrity": "sha1-0KM+7+YaIF+suQCS6CZZjVJFznY=", 2458 | "dev": true, 2459 | "requires": { 2460 | "graceful-fs": "4.1.11", 2461 | "mkdirp": "0.5.1", 2462 | "object-assign": "4.1.1" 2463 | } 2464 | }, 2465 | "parse-glob": { 2466 | "version": "3.0.4", 2467 | "resolved": "http://registry.npm.taobao.org/parse-glob/download/parse-glob-3.0.4.tgz", 2468 | "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", 2469 | "dev": true, 2470 | "optional": true, 2471 | "requires": { 2472 | "glob-base": "0.3.0", 2473 | "is-dotfile": "1.0.3", 2474 | "is-extglob": "1.0.0", 2475 | "is-glob": "2.0.1" 2476 | } 2477 | }, 2478 | "parseurl": { 2479 | "version": "https://registry.npm.taobao.org/parseurl/download/parseurl-1.3.1.tgz", 2480 | "integrity": "sha1-yKuMkiO6NIiKpkopeyiFO+wY2lY=" 2481 | }, 2482 | "path-is-absolute": { 2483 | "version": "1.0.1", 2484 | "resolved": "http://registry.npm.taobao.org/path-is-absolute/download/path-is-absolute-1.0.1.tgz", 2485 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", 2486 | "dev": true 2487 | }, 2488 | "path-to-regexp": { 2489 | "version": "https://registry.npm.taobao.org/path-to-regexp/download/path-to-regexp-0.1.7.tgz", 2490 | "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" 2491 | }, 2492 | "preserve": { 2493 | "version": "0.2.0", 2494 | "resolved": "http://registry.npm.taobao.org/preserve/download/preserve-0.2.0.tgz", 2495 | "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", 2496 | "dev": true, 2497 | "optional": true 2498 | }, 2499 | "private": { 2500 | "version": "0.1.7", 2501 | "resolved": "http://registry.npm.taobao.org/private/download/private-0.1.7.tgz", 2502 | "integrity": "sha1-aM5eih7woju1cMwoU3tTMqumPvE=", 2503 | "dev": true 2504 | }, 2505 | "process-nextick-args": { 2506 | "version": "1.0.7", 2507 | "resolved": "http://registry.npm.taobao.org/process-nextick-args/download/process-nextick-args-1.0.7.tgz", 2508 | "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", 2509 | "dev": true, 2510 | "optional": true 2511 | }, 2512 | "proxy-addr": { 2513 | "version": "https://registry.npm.taobao.org/proxy-addr/download/proxy-addr-1.1.4.tgz", 2514 | "integrity": "sha1-J+VF9pYKRKYn2bREZ+NcG2tM4vM=", 2515 | "requires": { 2516 | "forwarded": "https://registry.npm.taobao.org/forwarded/download/forwarded-0.1.0.tgz", 2517 | "ipaddr.js": "https://registry.npm.taobao.org/ipaddr.js/download/ipaddr.js-1.3.0.tgz" 2518 | } 2519 | }, 2520 | "qs": { 2521 | "version": "https://registry.npm.taobao.org/qs/download/qs-6.4.0.tgz", 2522 | "integrity": "sha1-E+JtKK1rD/qpExLNO/cI7TUecjM=" 2523 | }, 2524 | "random-bytes": { 2525 | "version": "https://registry.npm.taobao.org/random-bytes/download/random-bytes-1.0.0.tgz", 2526 | "integrity": "sha1-T2ih3Arli9P7lYSMMDJNt11kNgs=" 2527 | }, 2528 | "randomatic": { 2529 | "version": "1.1.7", 2530 | "resolved": "http://registry.npm.taobao.org/randomatic/download/randomatic-1.1.7.tgz", 2531 | "integrity": "sha1-x6vpzIuHwLqodrGf3oP9RkeX44w=", 2532 | "dev": true, 2533 | "optional": true, 2534 | "requires": { 2535 | "is-number": "3.0.0", 2536 | "kind-of": "4.0.0" 2537 | }, 2538 | "dependencies": { 2539 | "is-number": { 2540 | "version": "3.0.0", 2541 | "resolved": "http://registry.npm.taobao.org/is-number/download/is-number-3.0.0.tgz", 2542 | "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", 2543 | "dev": true, 2544 | "optional": true, 2545 | "requires": { 2546 | "kind-of": "3.2.2" 2547 | }, 2548 | "dependencies": { 2549 | "kind-of": { 2550 | "version": "3.2.2", 2551 | "resolved": "http://registry.npm.taobao.org/kind-of/download/kind-of-3.2.2.tgz", 2552 | "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", 2553 | "dev": true, 2554 | "optional": true, 2555 | "requires": { 2556 | "is-buffer": "1.1.5" 2557 | } 2558 | } 2559 | } 2560 | }, 2561 | "kind-of": { 2562 | "version": "4.0.0", 2563 | "resolved": "http://registry.npm.taobao.org/kind-of/download/kind-of-4.0.0.tgz", 2564 | "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", 2565 | "dev": true, 2566 | "optional": true, 2567 | "requires": { 2568 | "is-buffer": "1.1.5" 2569 | } 2570 | } 2571 | } 2572 | }, 2573 | "range-parser": { 2574 | "version": "https://registry.npm.taobao.org/range-parser/download/range-parser-1.2.0.tgz", 2575 | "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=" 2576 | }, 2577 | "raw-body": { 2578 | "version": "https://registry.npm.taobao.org/raw-body/download/raw-body-2.2.0.tgz", 2579 | "integrity": "sha1-mUl2z2pQlqQRYoQEkvC9xdbn+5Y=", 2580 | "requires": { 2581 | "bytes": "https://registry.npm.taobao.org/bytes/download/bytes-2.4.0.tgz", 2582 | "iconv-lite": "https://registry.npm.taobao.org/iconv-lite/download/iconv-lite-0.4.15.tgz", 2583 | "unpipe": "https://registry.npm.taobao.org/unpipe/download/unpipe-1.0.0.tgz" 2584 | } 2585 | }, 2586 | "readable-stream": { 2587 | "version": "2.3.3", 2588 | "resolved": "http://registry.npm.taobao.org/readable-stream/download/readable-stream-2.3.3.tgz", 2589 | "integrity": "sha1-No8lEtefnUb9/HE0mueHi7weuVw=", 2590 | "dev": true, 2591 | "optional": true, 2592 | "requires": { 2593 | "core-util-is": "1.0.2", 2594 | "inherits": "https://registry.npm.taobao.org/inherits/download/inherits-2.0.3.tgz", 2595 | "isarray": "1.0.0", 2596 | "process-nextick-args": "1.0.7", 2597 | "safe-buffer": "5.1.1", 2598 | "string_decoder": "1.0.3", 2599 | "util-deprecate": "1.0.2" 2600 | } 2601 | }, 2602 | "readdirp": { 2603 | "version": "2.1.0", 2604 | "resolved": "http://registry.npm.taobao.org/readdirp/download/readdirp-2.1.0.tgz", 2605 | "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=", 2606 | "dev": true, 2607 | "optional": true, 2608 | "requires": { 2609 | "graceful-fs": "4.1.11", 2610 | "minimatch": "3.0.4", 2611 | "readable-stream": "2.3.3", 2612 | "set-immediate-shim": "1.0.1" 2613 | } 2614 | }, 2615 | "regenerate": { 2616 | "version": "1.3.3", 2617 | "resolved": "http://registry.npm.taobao.org/regenerate/download/regenerate-1.3.3.tgz", 2618 | "integrity": "sha1-DDNtOYBVPXVcObWGrjsgqknIK38=", 2619 | "dev": true 2620 | }, 2621 | "regenerator-runtime": { 2622 | "version": "0.11.0", 2623 | "resolved": "http://registry.npm.taobao.org/regenerator-runtime/download/regenerator-runtime-0.11.0.tgz", 2624 | "integrity": "sha1-flT+W1zNXWYk6mJVw0c74JC4AuE=", 2625 | "dev": true 2626 | }, 2627 | "regenerator-transform": { 2628 | "version": "0.10.1", 2629 | "resolved": "http://registry.npm.taobao.org/regenerator-transform/download/regenerator-transform-0.10.1.tgz", 2630 | "integrity": "sha1-HkmWg3Ix2ot/PPQRTXG1aRoGgN0=", 2631 | "dev": true, 2632 | "requires": { 2633 | "babel-runtime": "6.26.0", 2634 | "babel-types": "6.26.0", 2635 | "private": "0.1.7" 2636 | } 2637 | }, 2638 | "regex-cache": { 2639 | "version": "0.4.4", 2640 | "resolved": "http://registry.npm.taobao.org/regex-cache/download/regex-cache-0.4.4.tgz", 2641 | "integrity": "sha1-db3FiioUls7EihKDW8VMjVYjNt0=", 2642 | "dev": true, 2643 | "optional": true, 2644 | "requires": { 2645 | "is-equal-shallow": "0.1.3" 2646 | } 2647 | }, 2648 | "regexpu-core": { 2649 | "version": "2.0.0", 2650 | "resolved": "http://registry.npm.taobao.org/regexpu-core/download/regexpu-core-2.0.0.tgz", 2651 | "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=", 2652 | "dev": true, 2653 | "requires": { 2654 | "regenerate": "1.3.3", 2655 | "regjsgen": "0.2.0", 2656 | "regjsparser": "0.1.5" 2657 | } 2658 | }, 2659 | "regjsgen": { 2660 | "version": "0.2.0", 2661 | "resolved": "http://registry.npm.taobao.org/regjsgen/download/regjsgen-0.2.0.tgz", 2662 | "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=", 2663 | "dev": true 2664 | }, 2665 | "regjsparser": { 2666 | "version": "0.1.5", 2667 | "resolved": "http://registry.npm.taobao.org/regjsparser/download/regjsparser-0.1.5.tgz", 2668 | "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", 2669 | "dev": true, 2670 | "requires": { 2671 | "jsesc": "0.5.0" 2672 | }, 2673 | "dependencies": { 2674 | "jsesc": { 2675 | "version": "0.5.0", 2676 | "resolved": "http://registry.npm.taobao.org/jsesc/download/jsesc-0.5.0.tgz", 2677 | "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", 2678 | "dev": true 2679 | } 2680 | } 2681 | }, 2682 | "remove-trailing-separator": { 2683 | "version": "1.1.0", 2684 | "resolved": "http://registry.npm.taobao.org/remove-trailing-separator/download/remove-trailing-separator-1.1.0.tgz", 2685 | "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", 2686 | "dev": true 2687 | }, 2688 | "repeat-element": { 2689 | "version": "1.1.2", 2690 | "resolved": "http://registry.npm.taobao.org/repeat-element/download/repeat-element-1.1.2.tgz", 2691 | "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=", 2692 | "dev": true 2693 | }, 2694 | "repeat-string": { 2695 | "version": "1.6.1", 2696 | "resolved": "http://registry.npm.taobao.org/repeat-string/download/repeat-string-1.6.1.tgz", 2697 | "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", 2698 | "dev": true, 2699 | "optional": true 2700 | }, 2701 | "repeating": { 2702 | "version": "2.0.1", 2703 | "resolved": "http://registry.npm.taobao.org/repeating/download/repeating-2.0.1.tgz", 2704 | "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", 2705 | "dev": true, 2706 | "requires": { 2707 | "is-finite": "1.0.2" 2708 | } 2709 | }, 2710 | "safe-buffer": { 2711 | "version": "5.1.1", 2712 | "resolved": "http://registry.npm.taobao.org/safe-buffer/download/safe-buffer-5.1.1.tgz", 2713 | "integrity": "sha1-iTMSr2myEj3vcfV4iQAWce6yyFM=", 2714 | "dev": true 2715 | }, 2716 | "send": { 2717 | "version": "https://registry.npm.taobao.org/send/download/send-0.15.1.tgz", 2718 | "integrity": "sha1-igI1TCbm9cynAAZfXwzeupDse18=", 2719 | "requires": { 2720 | "debug": "https://registry.npm.taobao.org/debug/download/debug-2.6.1.tgz", 2721 | "depd": "https://registry.npm.taobao.org/depd/download/depd-1.1.0.tgz", 2722 | "destroy": "https://registry.npm.taobao.org/destroy/download/destroy-1.0.4.tgz", 2723 | "encodeurl": "https://registry.npm.taobao.org/encodeurl/download/encodeurl-1.0.1.tgz", 2724 | "escape-html": "https://registry.npm.taobao.org/escape-html/download/escape-html-1.0.3.tgz", 2725 | "etag": "https://registry.npm.taobao.org/etag/download/etag-1.8.0.tgz", 2726 | "fresh": "https://registry.npm.taobao.org/fresh/download/fresh-0.5.0.tgz", 2727 | "http-errors": "https://registry.npm.taobao.org/http-errors/download/http-errors-1.6.1.tgz", 2728 | "mime": "https://registry.npm.taobao.org/mime/download/mime-1.3.4.tgz", 2729 | "ms": "https://registry.npm.taobao.org/ms/download/ms-0.7.2.tgz", 2730 | "on-finished": "https://registry.npm.taobao.org/on-finished/download/on-finished-2.3.0.tgz", 2731 | "range-parser": "https://registry.npm.taobao.org/range-parser/download/range-parser-1.2.0.tgz", 2732 | "statuses": "https://registry.npm.taobao.org/statuses/download/statuses-1.3.1.tgz" 2733 | } 2734 | }, 2735 | "serve-static": { 2736 | "version": "https://registry.npm.taobao.org/serve-static/download/serve-static-1.12.1.tgz", 2737 | "integrity": "sha1-dEOpZePO1kes61Y5+ga/TRu+ADk=", 2738 | "requires": { 2739 | "encodeurl": "https://registry.npm.taobao.org/encodeurl/download/encodeurl-1.0.1.tgz", 2740 | "escape-html": "https://registry.npm.taobao.org/escape-html/download/escape-html-1.0.3.tgz", 2741 | "parseurl": "https://registry.npm.taobao.org/parseurl/download/parseurl-1.3.1.tgz", 2742 | "send": "https://registry.npm.taobao.org/send/download/send-0.15.1.tgz" 2743 | } 2744 | }, 2745 | "set-immediate-shim": { 2746 | "version": "1.0.1", 2747 | "resolved": "http://registry.npm.taobao.org/set-immediate-shim/download/set-immediate-shim-1.0.1.tgz", 2748 | "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", 2749 | "dev": true, 2750 | "optional": true 2751 | }, 2752 | "setprototypeof": { 2753 | "version": "https://registry.npm.taobao.org/setprototypeof/download/setprototypeof-1.0.3.tgz", 2754 | "integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=" 2755 | }, 2756 | "slash": { 2757 | "version": "1.0.0", 2758 | "resolved": "http://registry.npm.taobao.org/slash/download/slash-1.0.0.tgz", 2759 | "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", 2760 | "dev": true 2761 | }, 2762 | "source-map": { 2763 | "version": "0.5.7", 2764 | "resolved": "http://registry.npm.taobao.org/source-map/download/source-map-0.5.7.tgz", 2765 | "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", 2766 | "dev": true 2767 | }, 2768 | "source-map-support": { 2769 | "version": "0.4.18", 2770 | "resolved": "http://registry.npm.taobao.org/source-map-support/download/source-map-support-0.4.18.tgz", 2771 | "integrity": "sha1-Aoam3ovkJkEzhZTpfM6nXwosWF8=", 2772 | "dev": true, 2773 | "requires": { 2774 | "source-map": "0.5.7" 2775 | } 2776 | }, 2777 | "statuses": { 2778 | "version": "https://registry.npm.taobao.org/statuses/download/statuses-1.3.1.tgz", 2779 | "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=" 2780 | }, 2781 | "string_decoder": { 2782 | "version": "1.0.3", 2783 | "resolved": "http://registry.npm.taobao.org/string_decoder/download/string_decoder-1.0.3.tgz", 2784 | "integrity": "sha1-D8Z9fBQYJd6UKC3VNr7GubzoYKs=", 2785 | "dev": true, 2786 | "optional": true, 2787 | "requires": { 2788 | "safe-buffer": "5.1.1" 2789 | } 2790 | }, 2791 | "strip-ansi": { 2792 | "version": "3.0.1", 2793 | "resolved": "http://registry.npm.taobao.org/strip-ansi/download/strip-ansi-3.0.1.tgz", 2794 | "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", 2795 | "dev": true, 2796 | "requires": { 2797 | "ansi-regex": "2.1.1" 2798 | } 2799 | }, 2800 | "supports-color": { 2801 | "version": "2.0.0", 2802 | "resolved": "http://registry.npm.taobao.org/supports-color/download/supports-color-2.0.0.tgz", 2803 | "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", 2804 | "dev": true 2805 | }, 2806 | "to-fast-properties": { 2807 | "version": "1.0.3", 2808 | "resolved": "http://registry.npm.taobao.org/to-fast-properties/download/to-fast-properties-1.0.3.tgz", 2809 | "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", 2810 | "dev": true 2811 | }, 2812 | "trim-right": { 2813 | "version": "1.0.1", 2814 | "resolved": "http://registry.npm.taobao.org/trim-right/download/trim-right-1.0.1.tgz", 2815 | "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", 2816 | "dev": true 2817 | }, 2818 | "type-is": { 2819 | "version": "https://registry.npm.taobao.org/type-is/download/type-is-1.6.15.tgz", 2820 | "integrity": "sha1-yrEPtJCeRByChC6v4a1kbIGARBA=", 2821 | "requires": { 2822 | "media-typer": "https://registry.npm.taobao.org/media-typer/download/media-typer-0.3.0.tgz", 2823 | "mime-types": "https://registry.npm.taobao.org/mime-types/download/mime-types-2.1.15.tgz" 2824 | } 2825 | }, 2826 | "uid-safe": { 2827 | "version": "https://registry.npm.taobao.org/uid-safe/download/uid-safe-2.1.4.tgz", 2828 | "integrity": "sha1-Otbzg2jG1MjHXsF2I/t5qh0HHYE=", 2829 | "requires": { 2830 | "random-bytes": "https://registry.npm.taobao.org/random-bytes/download/random-bytes-1.0.0.tgz" 2831 | } 2832 | }, 2833 | "unpipe": { 2834 | "version": "https://registry.npm.taobao.org/unpipe/download/unpipe-1.0.0.tgz", 2835 | "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" 2836 | }, 2837 | "user-home": { 2838 | "version": "1.1.1", 2839 | "resolved": "http://registry.npm.taobao.org/user-home/download/user-home-1.1.1.tgz", 2840 | "integrity": "sha1-K1viOjK2Onyd640PKNSFcko98ZA=", 2841 | "dev": true 2842 | }, 2843 | "util-deprecate": { 2844 | "version": "1.0.2", 2845 | "resolved": "http://registry.npm.taobao.org/util-deprecate/download/util-deprecate-1.0.2.tgz", 2846 | "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", 2847 | "dev": true, 2848 | "optional": true 2849 | }, 2850 | "utils-merge": { 2851 | "version": "https://registry.npm.taobao.org/utils-merge/download/utils-merge-1.0.0.tgz", 2852 | "integrity": "sha1-ApT7kiu5N1FTVBxPcJYjHyh8ivg=" 2853 | }, 2854 | "v8flags": { 2855 | "version": "2.1.1", 2856 | "resolved": "http://registry.npm.taobao.org/v8flags/download/v8flags-2.1.1.tgz", 2857 | "integrity": "sha1-qrGh+jDUX4jdMhFIh1rALAtV5bQ=", 2858 | "dev": true, 2859 | "requires": { 2860 | "user-home": "1.1.1" 2861 | } 2862 | }, 2863 | "vary": { 2864 | "version": "https://registry.npm.taobao.org/vary/download/vary-1.1.1.tgz", 2865 | "integrity": "sha1-Z1Neu2lMHVIldFeYRmUyP1h+jTc=" 2866 | }, 2867 | "wrappy": { 2868 | "version": "1.0.2", 2869 | "resolved": "http://registry.npm.taobao.org/wrappy/download/wrappy-1.0.2.tgz", 2870 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", 2871 | "dev": true 2872 | } 2873 | } 2874 | } 2875 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Simple-React-Native-Hot-Code-Push-Server", 3 | "version": "1.0.0", 4 | "description": "using express and node.js to build a server to provide management of patches of react-native js bundle.", 5 | "main": "index.js", 6 | "scripts": { 7 | "server":"node index", 8 | "test": "node test" 9 | }, 10 | "repository": { 11 | "type": "git", 12 | "url": "https://git.coding.net/marcusma/myExpressServer.git" 13 | }, 14 | "author": "Marucs Ma", 15 | "license": "MIT", 16 | "dependencies": { 17 | "body-parser": "^1.15.2", 18 | "cookie-parser": "^1.4.3", 19 | "express": "^4.14.0", 20 | "express-session": "^1.14.1" 21 | }, 22 | "devDependencies": { 23 | "babel-cli": "^6.26.0", 24 | "babel-preset-es2015": "^6.24.1", 25 | "babel-preset-latest": "^6.24.1" 26 | } 27 | } -------------------------------------------------------------------------------- /public/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarcusMa/simple-react-native-hot-code-push-server/ec66fb3b56a713cb990f5b7319b3b2dd341858c3/public/.DS_Store -------------------------------------------------------------------------------- /public/.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Files for the ART/Dalvik VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # Generated files 12 | bin/ 13 | gen/ 14 | out/ 15 | node_modules/ 16 | 17 | # Gradle files 18 | .gradle/ 19 | build/ 20 | 21 | # Local configuration file (sdk path, etc) 22 | local.properties 23 | 24 | # Proguard folder generated by Eclipse 25 | proguard/ 26 | 27 | # Log Files 28 | *.log 29 | 30 | # Android Studio Navigation editor temp files 31 | .navigation/ 32 | 33 | # Android Studio captures folder 34 | captures/ 35 | 36 | # Intellij 37 | *.iml 38 | .idea/workspace.xml 39 | 40 | # Keystore files 41 | *.jks -------------------------------------------------------------------------------- /public/dist/business/tag1_v_100_min.bundle.patch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarcusMa/simple-react-native-hot-code-push-server/ec66fb3b56a713cb990f5b7319b3b2dd341858c3/public/dist/business/tag1_v_100_min.bundle.patch -------------------------------------------------------------------------------- /src/entity/BusinessInfo.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * BusinessInfo 3 | * Copyright(c) 2009-2017 Marcus Ma 4 | * E-mail:maji1991@sina.com 5 | * GitHub : https://github.com/MarcusMa 6 | * MIT Licensed 7 | */ 8 | 'use strict'; 9 | 10 | /** 11 | * Module dependencies. 12 | */ 13 | const PatchVersionInfo = require("./PatchVersionInfo"); 14 | 15 | 16 | function BusinessInfo(id, name, tag) { 17 | this.businessId = id; 18 | this.businessName = name; 19 | this.businessTag = tag; 20 | this.patchVersions = []; 21 | } 22 | 23 | BusinessInfo.prototype.isPatchVersionExist = _isPatchVersionExist; 24 | BusinessInfo.prototype.getLatestPatchInfo = _getLatestPatchInfo; 25 | BusinessInfo.prototype.addNewPatchVersion = _addNewPatchVersion; 26 | BusinessInfo.prototype.toString = _toString; 27 | 28 | /** 29 | * Check the patch verions using patch package hashcode. 30 | * @param {String} patchHashCode 31 | */ 32 | function _isPatchVersionExist(patchHashCode) { 33 | var ret = false; 34 | this.patchVersions.forEach(function (tmp) { 35 | if (tmp.hashCode === patchHashCode) { 36 | ret = true; 37 | } 38 | }); 39 | return ret; 40 | } 41 | 42 | /** 43 | * Get the latest PatchVersionInfo 44 | */ 45 | function _getLatestPatchInfo() { 46 | var ret = null; 47 | if (this.patchVersions.length > 0) { 48 | var lastIndex = 0; 49 | for (var i = 1; i < this.patchVersions.length; i++) { 50 | if (this.patchVersions[i].version > this.patchVersions[lastIndex].version) { 51 | lastIndex = i; 52 | } 53 | } 54 | ret = this.patchVersions[lastIndex]; 55 | } 56 | return ret; 57 | } 58 | 59 | 60 | /** 61 | * Add a new PatchVersionInfo to the set of patchs. 62 | * @param {*} patchInfo 63 | */ 64 | function _addNewPatchVersion(patchInfo) { 65 | if (patchInfo instanceof PatchVersionInfo) { 66 | // check the patch version 67 | var isExit = false; 68 | this.patchVersions.forEach(function (tmp) { 69 | // FIXME 70 | if (tmp.version && tmp.version === patchInfo.version) { 71 | isExit = true; 72 | } 73 | }); 74 | if (!isExit) { 75 | this.patchVersions.push(patchInfo); 76 | } 77 | } 78 | } 79 | 80 | function _toString() { 81 | var ret = "businessId:" + this.businessId + 82 | ", businessName:" + this.businessName + 83 | ", businessTag:" + this.businessTag + 84 | ", versions:["; 85 | 86 | this.patchVersions.forEach(function (tmp) { 87 | if (tmp instanceof PatchVersionInfo) { 88 | ret += "{ " + tmp.toString() + "}, "; 89 | } 90 | }); 91 | ret += "]"; 92 | return ret; 93 | } 94 | 95 | module.exports = BusinessInfo; -------------------------------------------------------------------------------- /src/entity/PatchVersionInfo.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * BusinessInfo 3 | * Copyright(c) 2009-2017 Marcus Ma 4 | * E-mail:maji1991@sina.com 5 | * GitHub : https://github.com/MarcusMa 6 | * MIT Licensed 7 | */ 8 | 'use strict'; 9 | 10 | /** 11 | * Module dependencies. 12 | */ 13 | function PatchVersionInfo(id, patchVersion, patchHashCode, patchFilePath) { 14 | this.businessId = id; 15 | this.version = patchVersion; 16 | this.hashCode = patchHashCode; 17 | this.filePath = patchFilePath; 18 | } 19 | 20 | PatchVersionInfo.prototype.getDownloadUrl = _getDownloadUrl; 21 | PatchVersionInfo.prototype.toString = _toString; 22 | 23 | function _getDownloadUrl() { 24 | //FIXME 25 | var ret = null; 26 | if (this.filePath) { 27 | ret = this.filePath.substr(9); 28 | } 29 | return ret; 30 | } 31 | 32 | function _toString() { 33 | return "businessId: " + this.businessId + 34 | " , version: " + this.version + 35 | " , hashcode: " + this.hashCode + 36 | " , filePath: " + this.filePath; 37 | } 38 | 39 | 40 | module.exports = PatchVersionInfo; -------------------------------------------------------------------------------- /src/service/BusinessManager.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * BusinessManager 3 | * Copyright(c) 2009-2017 Marcus Ma 4 | * E-mail:maji1991@sina.com 5 | * GitHub : https://github.com/MarcusMa 6 | * MIT Licensed 7 | */ 8 | 9 | /** 10 | * Module dependencies. 11 | */ 12 | 13 | const Log = require('../utils/Log'); 14 | const BusinessInfo = require("../entity/BusinessInfo"); 15 | const TAG = "BusinessManager"; 16 | 17 | function BusinessManager() { 18 | this.businessMap = []; 19 | } 20 | 21 | BusinessManager.prototype.init = _init; 22 | BusinessManager.prototype.getBusinessInfoSize = _getBusinessInfoSize; 23 | BusinessManager.prototype.add = _add; 24 | BusinessManager.prototype.getBusinessInfoById = _getBusinessInfoById; 25 | BusinessManager.prototype.getBusinessInfoByTag = _getBusinessInfoByTag; 26 | 27 | /** 28 | * Init, not used now. 29 | */ 30 | function _init() { 31 | //init 32 | }; 33 | /** 34 | * Get the size of the business map. 35 | */ 36 | function _getBusinessInfoSize() { 37 | if (this.businessMap instanceof Array) { 38 | // do nothing 39 | } else { 40 | Log.e(TAG, "businessMap cannot be null, just reset it"); 41 | this.businessMap = []; 42 | } 43 | return this.businessMap.length; 44 | } 45 | 46 | /** 47 | * Add a BusinessInfo the set. 48 | * @param {BusinessInfo} business 49 | */ 50 | function _add(business) { 51 | if (business instanceof BusinessInfo) { 52 | if (this.businessMap instanceof Array) { 53 | // do nothing 54 | } else { 55 | Log.e(TAG, "businessMap cannot be null, just reset it"); 56 | this.businessMap = []; 57 | } 58 | var isExist = false; 59 | this.businessMap.forEach(function (tmp) { 60 | if (tmp.businessId === business.businessId) { 61 | isExist = true; 62 | } 63 | }); 64 | if (!isExist) { 65 | Log.i(TAG, "Add new BusinessInfo with businessId=" + business.businessId); 66 | this.businessMap.push(business); 67 | } else { 68 | Log.w(TAG, "Try to add an exist BusinessInfo with businessId=" + business.businessId); 69 | } 70 | } 71 | } 72 | 73 | /** 74 | * Get the BusinessInfo using businessId prop. 75 | * @param {String} queryId 76 | */ 77 | function _getBusinessInfoById(queryId) { 78 | var ret = null; 79 | if (this.businessMap instanceof Array) { 80 | // do nothing 81 | } else { 82 | Log.e(TAG, "businessMap cannot be null, just reset it"); 83 | this.businessMap = []; 84 | } 85 | 86 | this.businessMap.forEach(function (tmp) { 87 | Log.d(TAG, "get local id=" + tmp.businessId + ", and query id=" + queryId); 88 | if (tmp.businessId === queryId) { 89 | ret = tmp; 90 | } 91 | }); 92 | if (null === ret) { 93 | Log.w(TAG, "Can not find the BusinessInfo with id=" + queryId); 94 | } 95 | return ret; 96 | } 97 | 98 | /** 99 | * Get the BusinessInfo using businessTag prop. 100 | * @param {String} queryTag 101 | */ 102 | function _getBusinessInfoByTag(queryTag) { 103 | var ret = null; 104 | if (this.businessMap instanceof Array) { 105 | // do nothing 106 | } else { 107 | Log.e(TAG, "businessMap cannot be null, just reset it"); 108 | this.businessMap = []; 109 | } 110 | this.businessMap.forEach(function (tmp) { 111 | Log.d(TAG, "get local id=" + tmp.businessTag + ", and query id " + queryTag); 112 | if (tmp.businessTag === queryTag) { 113 | ret = tmp; 114 | } 115 | }); 116 | if (null === ret) { 117 | Log.w(TAG, "Can not find the BusinessInfo with tag=" + queryTag); 118 | } 119 | return ret; 120 | } 121 | 122 | module.exports = BusinessManager; -------------------------------------------------------------------------------- /src/service/PatchManager.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * PatchManager 3 | * Copyright(c) 2009-2017 Marcus Ma 4 | * E-mail:maji1991@sina.com 5 | * GitHub : https://github.com/MarcusMa 6 | * MIT Licensed 7 | */ 8 | 'use strict'; 9 | 10 | /** 11 | * Module dependencies. 12 | */ 13 | 14 | const exec = require('child_process').exec; 15 | const crypto = require('crypto'); 16 | const fs = require('fs'); 17 | const Log = require('../utils/Log'); 18 | const BusinessInfo = require("../entity/BusinessInfo"); 19 | const PatchVersionInfo = require("../entity/PatchVersionInfo"); 20 | const BusinessManager = require("./BusinessManager"); 21 | const EventEmitter = require('events'); 22 | class PatchEmitter extends EventEmitter {} 23 | const mPatchEmitter = new PatchEmitter(); 24 | 25 | const TAG = "PatchManager"; 26 | const DEFAULT_DIST_PATH = "./public/dist"; 27 | const DEFAULT_ORIGINSL_SOURCE_PATH = "./public/original"; 28 | const DEFAULT_COMMON_BUNDLE_FILE_PATH = DEFAULT_ORIGINSL_SOURCE_PATH + "/common_min.bundle"; 29 | const DEFAULT_BSDIFF_ROOT_PATH = "./bsdiff-4.3"; 30 | const DEFAULT_BSDIFF_CMD = DEFAULT_BSDIFF_ROOT_PATH + "/bsdiff"; 31 | 32 | /** 33 | * Defined the events during the patch process. 34 | */ 35 | const EVENT_START_BSDIFF_FILES = "event_start_bsdiff_files"; 36 | const EVENT_SINGLE_FILE_BSDIFF_SUCCESS = "event_single_file_bsdiff_success"; 37 | const EVENT_SINGLE_FILE_BSDIFF_FAILED = "event_single_file_bsdiff_failed"; 38 | const EVENT_START_COMPUTE_HASHCODE = "event_start_compute_hashcode"; 39 | 40 | var businessManager = null; 41 | var distPath = DEFAULT_DIST_PATH; 42 | var originalSourcePath = DEFAULT_ORIGINSL_SOURCE_PATH; 43 | var commonBundleFilePath = DEFAULT_COMMON_BUNDLE_FILE_PATH; 44 | var bsdiffRootPath = DEFAULT_BSDIFF_ROOT_PATH; 45 | var bsdiffCmd = DEFAULT_BSDIFF_CMD; 46 | // Record the files nums, which need to be bsdiffed. 47 | var patchFileSize = 0; 48 | 49 | function PatchManager() {} 50 | PatchManager.prototype.init = _init; 51 | PatchManager.prototype.setDistPath = _setDistPath; 52 | PatchManager.prototype.setCommonBundleFilePath = _setCommonBundleFilePath; 53 | PatchManager.prototype.setBsDiffRootPath = _setBsDiffRootPath; 54 | PatchManager.prototype.setBsDiffCmd = _setBsDiffCmd; 55 | PatchManager.prototype.startPatch = _startPatch; 56 | 57 | /** 58 | * Initialized method, need a BusinessManager Object. 59 | * @param {BusinessManager} businessManager 60 | */ 61 | function _init(manager) { 62 | if (manager instanceof BusinessManager) { 63 | businessManager = manager; 64 | // other init settings 65 | } else { 66 | Log.e(TAG, "Init failure, as input param is not A BusinessManager"); 67 | } 68 | } 69 | 70 | /** 71 | * Set Dist Path for diffed files to store. 72 | * @param {String} customDistPath 73 | */ 74 | function _setDistPath(customDistPath) { 75 | distPath = customDistPath; 76 | } 77 | /** 78 | * Set the path of common js bundle file, which will be used to compared and generate patches. 79 | * @param {String} customCommonBundleFilePath 80 | */ 81 | function _setCommonBundleFilePath(customCommonBundleFilePath) { 82 | commonBundleFilePath = customCommonBundleFilePath; 83 | } 84 | 85 | /** 86 | * Set the root dir path of the BSDIFF. 87 | * @param {String} customBsdiffRootPath 88 | */ 89 | function _setBsDiffRootPath(customBsdiffRootPath) { 90 | bsdiffRootPath = customBsdiffRootPath; 91 | bsdiffCmd = bsdiffRootPath + "/bsdiff"; 92 | } 93 | 94 | /** 95 | * Set the cmd path of the BSDIFF. 96 | * @param {String } customBsdiffCmd 97 | */ 98 | function _setBsDiffCmd(customBsdiffCmd) { 99 | bsdiffCmd = customBsdiffCmd; 100 | } 101 | 102 | /** 103 | * Check the Object is or not initialized, some method can be called must after initilzation. 104 | */ 105 | function _isInited() { 106 | if (null !== businessManager) { 107 | return true; 108 | } 109 | return false; 110 | } 111 | 112 | /** 113 | * Start bsdiff the js bundle files. 114 | */ 115 | function _startPatch() { 116 | if (!_isInited()) { 117 | Log.e(TAG, "You should init the PatchManager Object firstly."); 118 | return; 119 | } 120 | _onClearDistDir(function () { 121 | mPatchEmitter.emit(EVENT_START_BSDIFF_FILES); 122 | }, function () { 123 | Log.e(TAG, "Error happened in clearing progress for dist dir."); 124 | }) 125 | // or 126 | // _onStartBsdiffFiles( 127 | // function () { 128 | // mPatchEmitter.emit(EVENT_SINGLE_FILE_BSDIFF_SUCCESS); 129 | // }, 130 | // function () { 131 | // mPatchEmitter.emit(EVENT_SINGLE_FILE_BSDIFF_FAILED); 132 | // } 133 | // ); 134 | } 135 | 136 | /** 137 | * Event and Listners. 138 | */ 139 | mPatchEmitter.on(EVENT_START_BSDIFF_FILES, function () { 140 | Log.i(TAG, "Tiggle Event: Starting bsdiff jsbundle files"); 141 | _onStartBsdiffFiles( 142 | function () { 143 | mPatchEmitter.emit(EVENT_SINGLE_FILE_BSDIFF_SUCCESS); 144 | }, 145 | function () { 146 | mPatchEmitter.emit(EVENT_SINGLE_FILE_BSDIFF_FAILED); 147 | } 148 | ); 149 | }); 150 | 151 | mPatchEmitter.on(EVENT_SINGLE_FILE_BSDIFF_SUCCESS, function () { 152 | patchFileSize = patchFileSize - 1; 153 | /** 154 | * When the patchFileSize countdown to 0, mean all file has bsdiff success. 155 | * Otherwise, mean some file failed during bsdiff progress. 156 | */ 157 | if (patchFileSize <= 0) { 158 | Log.i(TAG, "Tiggle Event: Single file bsdiffed success."); 159 | mPatchEmitter.emit(EVENT_START_COMPUTE_HASHCODE); 160 | } 161 | }); 162 | 163 | mPatchEmitter.on(EVENT_SINGLE_FILE_BSDIFF_FAILED, function () { 164 | Log.e(TAG, "Tiggle Event: Single file bsdiffed failed."); 165 | }); 166 | 167 | /** 168 | * For compute hashcode the patch files in the dist dir. 169 | */ 170 | mPatchEmitter.on(EVENT_START_COMPUTE_HASHCODE, function () { 171 | Log.i(TAG, "Tiggle Event: Start computing hashcode of patches (using sha-256)"); 172 | // Defined the success callback to update the info in BussinessManager object. 173 | var _successCallback = function (patchFileFullPath, hashcode) { 174 | Log.i(TAG, `HashCode SUCCESS, file: ${patchFileFullPath}, hashcode: ${hashcode} `); 175 | /* Patch' filename formated: 176 | {businessTag}_v_{version}_{others}.patch 177 | Example: 178 | business1_v_100_min.patch 179 | */ 180 | var array = patchFileFullPath.split('/'); 181 | var fileName = array[array.length - 1]; 182 | var infos = fileName.split('_'); 183 | var busTag = infos[0]; 184 | var version = infos[2]; 185 | var businessInfo = businessManager.getBusinessInfoByTag(busTag); 186 | if (null !== businessInfo) { 187 | Log.i(TAG, `Get BusinesInfo :${businessInfo.toString()}`); 188 | // setTimeout(function () { 189 | 190 | // }, 0); 191 | var nPatchInfo = new PatchVersionInfo(businessInfo.businessId, version, hashcode, patchFileFullPath); 192 | businessInfo.addNewPatchVersion(nPatchInfo); 193 | } 194 | }; 195 | var _errorCallback = function () { 196 | Log.i(TAG, "Error happened in computing file hashcode"); 197 | }; 198 | 199 | var dirs = fs.readdirSync(distPath); 200 | dirs.forEach(function (tmpDir) { 201 | var distBuinessDir = distPath + "/" + tmpDir; 202 | if (fs.statSync(distBuinessDir).isDirectory()) { 203 | Log.i(TAG, `HashCode for Dir: ${distBuinessDir}`); 204 | var files = fs.readdirSync(distBuinessDir); 205 | files.forEach(function (patchName) { 206 | if (patchName == '.DS_Store' || patchName.substr(patchName.length - 6, 6) != '.patch') { 207 | return; 208 | } 209 | patchFileSize++; 210 | // start compute hashcode of file 211 | _onComputeFileHashCode( 212 | distBuinessDir + "/" + patchName, 213 | _successCallback, 214 | _errorCallback 215 | ); 216 | }); 217 | } 218 | }); 219 | }); 220 | 221 | function _onClearDistDir(successCallback, errorCallback) { 222 | Log.i(TAG, "Clear ./dist folder"); 223 | var clearDistCmd = "rm -rf " + distPath; 224 | exec(clearDistCmd, (error, stdout, stderr) => { 225 | if (error) { 226 | Log.i(TAG, `exec error: ${error}`); 227 | if (typeof errorCallback === 'function') { 228 | errorCallback(); 229 | } 230 | return; 231 | } 232 | fs.mkdir(distPath); 233 | if (typeof successCallback === 'function') { 234 | successCallback(); 235 | } 236 | }); 237 | } 238 | 239 | /** 240 | * Main Progress for computing the hashcode of a file 241 | * @param {String} _filePath ,the path where the file located. 242 | * @param {*} _successCallback , callback function when progress success. 243 | * @param {*} _errorCallback , callback function when progress failed. 244 | */ 245 | function _onComputeFileHashCode(_filePath, _successCallback, _errorCallback) { 246 | Log.i(TAG, `HashCode for File: ${_filePath}`); 247 | var rs = fs.createReadStream(_filePath); 248 | var hash = crypto.createHash('sha256'); 249 | rs.on('data', hash.update.bind(hash)); 250 | rs.on('end', function () { 251 | let hashcode = hash.digest('hex'); 252 | if (hashcode.length <= 0 && typeof _errorCallback === 'function') { 253 | _errorCallback(); 254 | } else { 255 | _successCallback(_filePath, hashcode); 256 | } 257 | }); 258 | } 259 | 260 | /** 261 | * Main progress for bsdiffing the jsBundle. 262 | * @param {Function} _successCallback function will be called if sucess. 263 | * @param {Function} _errorCallback function will be called if some error happened druing the progress. 264 | */ 265 | function _onStartBsdiffFiles(_successCallback, _errorCallback) { 266 | var dirs = fs.readdirSync(originalSourcePath); 267 | dirs.forEach(function (tmpDir) { 268 | // var distBuinessDir = distPath + "/" + tmpDir; 269 | // var originalBuinessDir = originalSourcePath + "/" + tmpDir; 270 | var distBuinessDir = `${distPath}/${tmpDir}`; 271 | var originalBuinessDir = `${originalSourcePath}/${tmpDir}`; 272 | 273 | if (fs.statSync(originalBuinessDir).isDirectory()) { 274 | Log.i(TAG, `Bsdiff progress in dir: ${originalBuinessDir}`); 275 | fs.mkdirSync(distBuinessDir); // make /dist/xxxx dir 276 | var files = fs.readdirSync(originalBuinessDir); 277 | 278 | files.forEach(function (jsBundleFileName) { 279 | 280 | if (jsBundleFileName == '.DS_Store') { 281 | Log.w(TAG, "Find a .DS_Store file"); 282 | return; 283 | } 284 | 285 | (function () { 286 | // var option = commonBundleFilePath + " " + 287 | // originalBuinessDir + "/" + jsBundleFileName + " " + 288 | // distBuinessDir + "/" + jsBundleFileName + ".patch"; 289 | // var execCmd = bsdiffCmd + " " + option; 290 | var execCmd = `${bsdiffCmd} ${commonBundleFilePath} ${originalBuinessDir}/${jsBundleFileName} ${distBuinessDir}/${jsBundleFileName}.patch`; 291 | Log.i(TAG, `Bsdiff cmd is : ${execCmd}`); 292 | patchFileSize++; 293 | exec(execCmd, (error, stdout, stderr) => { 294 | if (error) { 295 | Log.i(TAG, `exec error: ${error}`); 296 | if (typeof _errorCallback === "function") { 297 | _errorCallback(); 298 | } 299 | return; 300 | } 301 | Log.i(TAG, "Bsdiff SUCCESS"); 302 | if (typeof _successCallback === "function") { 303 | _successCallback(); 304 | } 305 | }); 306 | })(); 307 | }); 308 | } 309 | }); 310 | } 311 | 312 | 313 | module.exports = PatchManager; -------------------------------------------------------------------------------- /src/utils/Log.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Log 3 | * Copyright(c) 2009-2017 Marcus Ma 4 | * E-mail:maji1991@sina.com 5 | * GitHub : https://github.com/MarcusMa 6 | * MIT Licensed 7 | */ 8 | 'use strict'; 9 | const DEFAULT_TAG = "default"; 10 | 11 | function Log(msg) { 12 | var time = new Date(); 13 | console.log(time.toLocaleString() + " - " + msg); 14 | } 15 | 16 | Log.prototype.e = function (tag, msg) { 17 | printLog("error", tag, msg); 18 | }; 19 | Log.prototype.i = function (tag, msg) { 20 | 21 | printLog("info", tag, msg); 22 | } 23 | Log.prototype.d = function (tag, msg) { 24 | printLog("debug", tag, msg); 25 | } 26 | Log.prototype.v = function (tag, msg) { 27 | printLog("vebose", tag, msg); 28 | } 29 | Log.prototype.w = function (tag, msg) { 30 | printLog("warn", tag, msg); 31 | } 32 | 33 | function printLog(prefix, tag, msg) { 34 | var realTag = DEFAULT_TAG; 35 | var realMsg = msg; 36 | if(msg != undefined){ 37 | realTag = tag; 38 | } 39 | else{ 40 | realMsg = tag; 41 | } 42 | var time = new Date(); 43 | console.log(time.toLocaleString() + "-[" + prefix + "]\t" + " [" + realTag + "] " + " ~ " + realMsg); 44 | } 45 | 46 | module.exports = new Log(); 47 | // exports.Log = Log; -------------------------------------------------------------------------------- /test.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Simple Test 3 | * Copyright(c) 2009-2017 Marcus Ma 4 | * E-mail:maji1991@sina.com 5 | * GitHub : https://github.com/MarcusMa 6 | * MIT Licensed 7 | */ 8 | 'use strict'; 9 | 10 | const express = require('express'); 11 | const Log = require('./src/utils/Log'); 12 | const BusinessInfo = require('./src/entity/BusinessInfo'); 13 | const PatchVersionIno = require('./src/entity/PatchVersionInfo'); 14 | const BusinessManager = require('./src/service/BusinessManager'); 15 | const PatchManager = require('./src/service/PatchManager'); 16 | 17 | const TAG = "test"; 18 | Log.i(TAG, "### Test BusinessInfo "); 19 | let info = new BusinessInfo("1", 2, 3); 20 | let patchVersion = new PatchVersionIno(1, '1.1.1', "234", "/sdaf/sdfasdf"); 21 | let patchVersion2 = new PatchVersionIno(2, '1.1.2', "aasdf", "asdfa/asdfas/asdfasd"); 22 | 23 | info.addNewPatchVersion(patchVersion); 24 | info.addNewPatchVersion(patchVersion2); 25 | 26 | Log.d(TAG, info.toString()); 27 | 28 | Log.i(TAG, "### Test BusinessManager "); 29 | let manager = new BusinessManager(); 30 | manager.add(info); 31 | let findInfo = manager.getBusinessInfoById("1"); 32 | Log.d(TAG, findInfo.toString()); 33 | let findTagInfo = manager.getBusinessInfoByTag(3); 34 | Log.d(findTagInfo.toString()); 35 | manager.add(info); 36 | info.businessId = "2"; 37 | manager.add(info); 38 | Log.d(manager.getBusinessInfoSize()); 39 | 40 | Log.i(TAG, "### Test PatchManager "); 41 | 42 | let patchManager = new PatchManager(); 43 | patchManager.startPatch(); 44 | patchManager.init(manager); 45 | patchManager.startPatch(); --------------------------------------------------------------------------------