diff --git a/package-lock.json b/package-lock.json index d1e0e05..73d5dc9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -197,7 +197,8 @@ "@babel/parser": { "version": "7.8.4", "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/@babel/parser/-/parser-7.8.4.tgz", - "integrity": "sha1-0dvmRpHWA1ipdClfpT2gdN0s6Og=" + "integrity": "sha1-0dvmRpHWA1ipdClfpT2gdN0s6Og=", + "dev": true }, "@babel/plugin-syntax-object-rest-spread": { "version": "7.8.3", @@ -209,11 +210,11 @@ } }, "@babel/runtime": { - "version": "7.8.4", - "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/@babel/runtime/-/runtime-7.8.4.tgz", - "integrity": "sha1-159aIED3yqJNU+VjqtScvAVYEwg=", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.9.6.tgz", + "integrity": "sha512-64AF1xY3OAkFHqOb9s4jpgk1Mm5vDZ4L3acHvAml+53nO1XbXLuDodsVpO4OIUsmemlUHMxNdYMNJmsvOwLrvQ==", "requires": { - "regenerator-runtime": "^0.13.2" + "regenerator-runtime": "^0.13.4" } }, "@babel/template": { @@ -890,8 +891,8 @@ }, "@nodelib/fs.scandir": { "version": "2.1.3", - "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", - "integrity": "sha1-Olgr21OATGum0UZXnEblITDPSjs=", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", + "integrity": "sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw==", "requires": { "@nodelib/fs.stat": "2.0.3", "run-parallel": "^1.1.9" @@ -899,13 +900,13 @@ }, "@nodelib/fs.stat": { "version": "2.0.3", - "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", - "integrity": "sha1-NNxfTKu8cg9OYPdadH5+zWwXW9M=" + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", + "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==" }, "@nodelib/fs.walk": { "version": "1.2.4", - "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/@nodelib/fs.walk/-/fs.walk-1.2.4.tgz", - "integrity": "sha1-ARuSAqcKY2bkNspcBlhEUoqwSXY=", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.4.tgz", + "integrity": "sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ==", "requires": { "@nodelib/fs.scandir": "2.1.3", "fastq": "^1.6.0" @@ -954,8 +955,8 @@ }, "@types/color-name": { "version": "1.1.1", - "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/@types/color-name/-/color-name-1.1.1.tgz", - "integrity": "sha1-HBJhu+qhCoBVu8XYq4S3sq/IRqA=" + "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==" }, "@types/estree": { "version": "0.0.39", @@ -963,6 +964,21 @@ "integrity": "sha1-4Xfmme4bjCLSMXTKqnQiZEOJUJ8=", "dev": true }, + "@types/events": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", + "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==" + }, + "@types/glob": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.1.tgz", + "integrity": "sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w==", + "requires": { + "@types/events": "*", + "@types/minimatch": "*", + "@types/node": "*" + } + }, "@types/istanbul-lib-coverage": { "version": "2.0.1", "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz", @@ -1003,14 +1019,12 @@ "@types/minimatch": { "version": "3.0.3", "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/@types/minimatch/-/minimatch-3.0.3.tgz", - "integrity": "sha1-PcoOPzOyAPx9ETnAzZbBJoyt/Z0=", - "dev": true + "integrity": "sha1-PcoOPzOyAPx9ETnAzZbBJoyt/Z0=" }, "@types/node": { "version": "10.17.16", "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/@types/node/-/node-10.17.16.tgz", - "integrity": "sha1-7pbdrBo42Y0sinHH3wza1XWOiZM=", - "dev": true + "integrity": "sha1-7pbdrBo42Y0sinHH3wza1XWOiZM=" }, "@types/stack-utils": { "version": "1.0.1", @@ -1094,8 +1108,8 @@ }, "ansi-styles": { "version": "4.2.1", - "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha1-kK51xCTQCNJiTFvynq0xd+v881k=", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", "requires": { "@types/color-name": "^1.1.1", "color-convert": "^2.0.1" @@ -1251,8 +1265,8 @@ }, "array-union": { "version": "2.1.0", - "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha1-t5hCCtvrHego2ErNii4j0+/oXo0=" + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==" }, "array-unique": { "version": "0.3.2", @@ -1291,6 +1305,14 @@ "integrity": "sha1-bIw/uCfdQ+45GPJ7gngqt2WKb9k=", "dev": true }, + "async": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", + "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", + "requires": { + "lodash": "^4.17.14" + } + }, "async-limiter": { "version": "1.0.1", "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/async-limiter/-/async-limiter-1.0.1.tgz", @@ -1479,8 +1501,7 @@ "balanced-match": { "version": "1.0.0", "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" }, "base": { "version": "0.11.2", @@ -1559,7 +1580,6 @@ "version": "1.1.11", "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha1-PH/L9SnYcibz0vUrlm/1Jx60Qd0=", - "dev": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -1567,8 +1587,8 @@ }, "braces": { "version": "3.0.2", - "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/braces/-/braces-3.0.2.tgz", - "integrity": "sha1-NFThpGLujVmeI23zNs2epPiv4Qc=", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", "requires": { "fill-range": "^7.0.1" } @@ -1676,8 +1696,8 @@ }, "chalk": { "version": "3.0.0", - "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/chalk/-/chalk-3.0.0.tgz", - "integrity": "sha1-P3PCv1JlkfV0zEksUeJFY0n4ROQ=", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -1754,16 +1774,16 @@ }, "color-convert": { "version": "2.0.1", - "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "requires": { "color-name": "~1.1.4" } }, "color-name": { "version": "1.1.4", - "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=" + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "combined-stream": { "version": "1.0.8", @@ -1787,8 +1807,7 @@ "concat-map": { "version": "0.0.1", "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, "convert-source-map": { "version": "1.7.0", @@ -1979,8 +1998,8 @@ }, "dir-glob": { "version": "3.0.1", - "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha1-Vtv3PZkqSpO6FYT0U0Bj/S5BcX8=", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", "requires": { "path-type": "^4.0.0" } @@ -2018,6 +2037,11 @@ "webidl-conversions": "^4.0.2" } }, + "duplexer": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", + "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=" + }, "ecc-jsbn": { "version": "0.1.2", "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", @@ -2120,6 +2144,20 @@ "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/esutils/-/esutils-2.0.3.tgz", "integrity": "sha1-dNLrTeC42hKTcRkQ1Qd1ubcQ72Q=" }, + "event-stream": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/event-stream/-/event-stream-4.0.1.tgz", + "integrity": "sha512-qACXdu/9VHPBzcyhdOWR5/IahhGMf0roTeZJfzz077GwylcDd90yOHLouhmv7GJ5XzPi6ekaQWd8AvPP2nOvpA==", + "requires": { + "duplexer": "^0.1.1", + "from": "^0.1.7", + "map-stream": "0.0.7", + "pause-stream": "^0.0.11", + "split": "^1.0.1", + "stream-combiner": "^0.2.2", + "through": "^2.3.8" + } + }, "exec-sh": { "version": "0.3.4", "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/exec-sh/-/exec-sh-0.3.4.tgz", @@ -2184,8 +2222,8 @@ }, "expand-template": { "version": "2.0.3", - "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/expand-template/-/expand-template-2.0.3.tgz", - "integrity": "sha1-bhSz/O4POmNA7LV9LokYaSBSpHw=" + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", + "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==" }, "expect": { "version": "24.9.0", @@ -2329,9 +2367,9 @@ "integrity": "sha1-VFFFB3xQFJHjOxXsQIwpQ3bpSuQ=" }, "fast-glob": { - "version": "3.2.1", - "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/fast-glob/-/fast-glob-3.2.1.tgz", - "integrity": "sha1-xarqYy+SVDt0S9yxnxHv1J5Wx7M=", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.2.tgz", + "integrity": "sha512-UDV82o4uQyljznxwMxyVRJgZZt3O5wENYojjzbaGEGZgeOxkLFf+V4cnUD+krzb2F72E18RhamkMZ7AdeggF7A==", "requires": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -2352,11 +2390,11 @@ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" }, "fastq": { - "version": "1.6.0", - "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/fastq/-/fastq-1.6.0.tgz", - "integrity": "sha1-Tsijj0rCXyFJJnOtt+rpz+9H0cI=", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.8.0.tgz", + "integrity": "sha512-SMIZoZdLh/fgofivvIkmknUXyPnvxRE3DhtZ5Me3Mrsk5gyPL42F0xr51TdRXskBxHfMp+07bcYzfsYEsSQA9Q==", "requires": { - "reusify": "^1.0.0" + "reusify": "^1.0.4" } }, "fb-watchman": { @@ -2377,8 +2415,8 @@ }, "fill-range": { "version": "7.0.1", - "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha1-GRmmp8df44ssfHflGYU12prN2kA=", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", "requires": { "to-regex-range": "^5.0.1" } @@ -2413,6 +2451,11 @@ "map-cache": "^0.2.2" } }, + "from": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz", + "integrity": "sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4=" + }, "from2": { "version": "2.3.0", "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/from2/-/from2-2.3.0.tgz", @@ -2435,8 +2478,7 @@ "fs.realpath": { "version": "1.0.0", "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "fsevents": { "version": "1.2.11", @@ -3039,9 +3081,8 @@ }, "glob": { "version": "7.1.6", - "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/glob/-/glob-7.1.6.tgz", - "integrity": "sha1-FB8zuBp8JJLhJVlDB0gMRmeSeKY=", - "dev": true, + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -3052,9 +3093,9 @@ } }, "glob-parent": { - "version": "5.1.0", - "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/glob-parent/-/glob-parent-5.1.0.tgz", - "integrity": "sha1-X0wdHnSNMM1zrSlEs1d6gbCB6MI=", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", "requires": { "is-glob": "^4.0.1" } @@ -3067,8 +3108,8 @@ }, "globby": { "version": "11.0.0", - "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/globby/-/globby-11.0.0.tgz", - "integrity": "sha1-Vv0Onw1Pj7DEVvGrDe6W4TgLwVQ=", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.0.tgz", + "integrity": "sha512-iuehFnR3xu5wBBtm4xi0dMe92Ob87ufyu/dHwpDYfbcpYpIbrO5OnS8M1vWvrBhSGEJ3/Ecj7gnX76P8YxpPEg==", "requires": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", @@ -3126,8 +3167,8 @@ }, "has-flag": { "version": "4.0.0", - "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=" + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" }, "has-symbols": { "version": "1.0.1", @@ -3235,8 +3276,8 @@ }, "ignore": { "version": "5.1.4", - "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/ignore/-/ignore-5.1.4.tgz", - "integrity": "sha1-hLez2+ZFUrbvDsqZ9nQ9vsbZet8=" + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.4.tgz", + "integrity": "sha512-MzbUSahkTW1u7JpKKjY7LCARd1fU5W2rLdxlM4kdkayuCwZImjkpluF9CM1aLewYJguPDqewLam18Y6AU69A8A==" }, "import-local": { "version": "2.0.0", @@ -3258,7 +3299,6 @@ "version": "1.0.6", "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -3277,8 +3317,8 @@ }, "into-stream": { "version": "5.1.1", - "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/into-stream/-/into-stream-5.1.1.tgz", - "integrity": "sha1-+aIKNIoR88E/rOInY/LQLhJ/Tbg=", + "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-5.1.1.tgz", + "integrity": "sha512-krrAJ7McQxGGmvaYbB7Q1mcA+cRwg9Ij2RfWIeVesNBgVDZmzY/Fa4IpZUT3bmdRzMzdf/mzltCG2Dq99IZGBA==", "requires": { "from2": "^2.3.0", "p-is-promise": "^3.0.0" @@ -3410,8 +3450,8 @@ }, "is-glob": { "version": "4.0.1", - "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha1-dWfb6fL14kZ7x3q4PEopSCQHpdw=", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", "requires": { "is-extglob": "^2.1.1" } @@ -3424,8 +3464,8 @@ }, "is-number": { "version": "7.0.0", - "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha1-dTU0W4lnNNX4DE0GxQlVUnoU8Ss=" + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" }, "is-plain-object": { "version": "2.0.4", @@ -5238,6 +5278,11 @@ "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/lodash/-/lodash-4.17.15.tgz", "integrity": "sha1-tEf2ZwoEVbv+7dETku/zMOoJdUg=" }, + "lodash.assign": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", + "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=" + }, "lodash.camelcase": { "version": "4.3.0", "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", @@ -5319,6 +5364,11 @@ "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", "dev": true }, + "map-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.0.7.tgz", + "integrity": "sha1-ih8HiW2CsQkmvTdEokIACfiJdKg=" + }, "map-visit": { "version": "1.0.0", "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/map-visit/-/map-visit-1.0.0.tgz", @@ -5342,13 +5392,13 @@ }, "merge2": { "version": "1.3.0", - "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/merge2/-/merge2-1.3.0.tgz", - "integrity": "sha1-WzZu6DsvFYLEj4fkfPGpNSEDyoE=" + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.3.0.tgz", + "integrity": "sha512-2j4DAdlBOkiSZIsaXk4mTE3sRS02yBHAtfy127xRV3bQUFqXkjHCHLW6Scv7DwNRbIWNHH8zpnz9zMaKXIdvYw==" }, "micromatch": { "version": "4.0.2", - "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/micromatch/-/micromatch-4.0.2.tgz", - "integrity": "sha1-T8sJmb+fvC/L3SEvbWKbmlbDklk=", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", + "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", "requires": { "braces": "^3.0.1", "picomatch": "^2.0.5" @@ -5367,11 +5417,15 @@ "mime-db": "1.43.0" } }, + "mingo": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/mingo/-/mingo-1.3.3.tgz", + "integrity": "sha1-aSLE0Ufvx3GgFCWixMj3eER4xUY=" + }, "minimatch": { "version": "3.0.4", "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", - "dev": true, "requires": { "brace-expansion": "^1.1.7" } @@ -5379,7 +5433,8 @@ "minimist": { "version": "1.2.0", "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true }, "mixin-deep": { "version": "1.3.2", @@ -5425,8 +5480,8 @@ }, "multistream": { "version": "2.1.1", - "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/multistream/-/multistream-2.1.1.tgz", - "integrity": "sha1-Yp06Kb12YjSJmA0EUZosNllIFIw=", + "resolved": "https://registry.npmjs.org/multistream/-/multistream-2.1.1.tgz", + "integrity": "sha512-xasv76hl6nr1dEy3lPvy7Ej7K/Lx3O/FCvwge8PeVJpciPPoNCbaANcNiBug3IpdvTveZUcAV0DJzdnUDMesNQ==", "requires": { "inherits": "^2.0.1", "readable-stream": "^2.0.5" @@ -5547,6 +5602,11 @@ "path-key": "^2.0.0" } }, + "nvm": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/nvm/-/nvm-0.0.4.tgz", + "integrity": "sha1-OKF46dMbKDUIyS0VydqGHRqSELw=" + }, "nwsapi": { "version": "2.2.0", "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/nwsapi/-/nwsapi-2.2.0.tgz", @@ -5645,7 +5705,6 @@ "version": "1.4.0", "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, "requires": { "wrappy": "1" } @@ -5703,8 +5762,8 @@ }, "p-is-promise": { "version": "3.0.0", - "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/p-is-promise/-/p-is-promise-3.0.0.tgz", - "integrity": "sha1-WOeMff4uFjzyoE/4aefB26ZKWXE=" + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-3.0.0.tgz", + "integrity": "sha512-Wo8VsW4IRQSKVXsJCn7TomUaVtyfjVDn3nUP7kE967BQk0CwFpdbZs0X0uk5sW9mkBa9eNM7hCMaG93WUAwxYQ==" }, "p-reduce": { "version": "1.0.0", @@ -5743,8 +5802,7 @@ "path-is-absolute": { "version": "1.0.1", "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "path-key": { "version": "2.0.1", @@ -5759,8 +5817,16 @@ }, "path-type": { "version": "4.0.0", - "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha1-hO0BwKe6OAr+CdkKjBgNzZ0DBDs=" + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==" + }, + "pause-stream": { + "version": "0.0.11", + "resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", + "integrity": "sha1-/lo0sMvOErWqaitAPuLnO2AvFEU=", + "requires": { + "through": "~2.3" + } }, "performance-now": { "version": "2.1.0", @@ -5768,9 +5834,9 @@ "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" }, "picomatch": { - "version": "2.2.1", - "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/picomatch/-/picomatch-2.2.1.tgz", - "integrity": "sha1-IbrIiLbthgH4Mc54FuM1vHefCko=" + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==" }, "pify": { "version": "3.0.0", @@ -5788,23 +5854,35 @@ } }, "pkg": { - "version": "4.4.3", - "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/pkg/-/pkg-4.4.3.tgz", - "integrity": "sha1-ua3vqbf2lUq9K2JlVkoe2DroG3o=", + "version": "4.4.8", + "resolved": "https://registry.npmjs.org/pkg/-/pkg-4.4.8.tgz", + "integrity": "sha512-Fqqv0iaX48U3CFZxd6Dq6JKe7BrAWbgRAqMJkz/m8W3H5cqJ6suvsUWe5AJPRlN/AhbBYXBJ0XG9QlYPTXcVFA==", "requires": { - "@babel/parser": "^7.7.5", - "@babel/runtime": "^7.7.5", + "@babel/parser": "^7.9.4", + "@babel/runtime": "^7.9.2", "chalk": "^3.0.0", - "escodegen": "^1.13.0", + "escodegen": "^1.14.1", "fs-extra": "^8.1.0", "globby": "^11.0.0", "into-stream": "^5.1.1", - "minimist": "^1.2.0", + "minimist": "^1.2.5", "multistream": "^2.1.1", - "pkg-fetch": "^2.6.4", + "pkg-fetch": "^2.6.7", "progress": "^2.0.3", - "resolve": "^1.15.0", + "resolve": "^1.15.1", "stream-meter": "^1.0.4" + }, + "dependencies": { + "@babel/parser": { + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.6.tgz", + "integrity": "sha512-AoeIEJn8vt+d/6+PXDRPaksYhnlbMIiejioBZvvMQsOjW/JYK6k/0dKnvvP3EhK5GfMBWDPtrxRtegWdAcdq9Q==" + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" + } } }, "pkg-dir": { @@ -5862,21 +5940,28 @@ } }, "pkg-fetch": { - "version": "2.6.4", - "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/pkg-fetch/-/pkg-fetch-2.6.4.tgz", - "integrity": "sha1-D6rExK6WaOHa+YGRgGBpZqXjP5Y=", + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/pkg-fetch/-/pkg-fetch-2.6.8.tgz", + "integrity": "sha512-CFG7jOeVD38lltLGA7xCJxYsD//GKLjl1P9tc/n9By2a4WEHQjfkBMrYdMS8WOHVP+r9L20fsZNbaKcubDAiQg==", "requires": { - "@babel/runtime": "^7.7.5", + "@babel/runtime": "^7.9.2", "byline": "^5.0.0", "chalk": "^3.0.0", "expand-template": "^2.0.3", "fs-extra": "^8.1.0", - "minimist": "^1.2.0", + "minimist": "^1.2.5", "progress": "^2.0.3", "request": "^2.88.0", "request-progress": "^3.0.0", "semver": "^6.3.0", "unique-temp-dir": "^1.0.0" + }, + "dependencies": { + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" + } } }, "pn": { @@ -5948,8 +6033,8 @@ }, "process-nextick-args": { "version": "2.0.1", - "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha1-eCDZsWEgzFXKmud5JoCufbptf+I=" + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" }, "progress": { "version": "2.0.3", @@ -6021,8 +6106,8 @@ }, "readable-stream": { "version": "2.3.7", - "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha1-Hsoc9xGu+BTAT2IlKjamL2yyO1c=", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "requires": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -6052,9 +6137,9 @@ } }, "regenerator-runtime": { - "version": "0.13.3", - "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz", - "integrity": "sha1-fPanfY9cb2Drc8X8GVWyzrAea/U=" + "version": "0.13.5", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz", + "integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==" }, "regex-not": { "version": "1.0.2", @@ -6190,8 +6275,8 @@ }, "reusify": { "version": "1.0.4", - "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha1-kNo4Kx4SbvwCFG6QhFqI2xKSXXY=" + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==" }, "rimraf": { "version": "2.7.1", @@ -6424,8 +6509,8 @@ }, "run-parallel": { "version": "1.1.9", - "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/run-parallel/-/run-parallel-1.1.9.tgz", - "integrity": "sha1-yd06fPn0ssS2JE4XOm7YZuYd1nk=" + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz", + "integrity": "sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==" }, "safe-buffer": { "version": "5.1.2", @@ -6568,6 +6653,17 @@ } } }, + "save": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/save/-/save-2.4.0.tgz", + "integrity": "sha512-wd5L2uVnsKYkIUaK6i8Ie66IOHaI328gMF0MPuTJtYOjXgUolC33LSIk7Qr8WVA55QHaGwfiVS8a7EFIeGOR3w==", + "requires": { + "async": "^2.6.2", + "event-stream": "^4.0.1", + "lodash.assign": "^4.2.0", + "mingo": "1" + } + }, "sax": { "version": "1.2.4", "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/sax/-/sax-1.2.4.tgz", @@ -6654,8 +6750,8 @@ }, "slash": { "version": "3.0.0", - "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/slash/-/slash-3.0.0.tgz", - "integrity": "sha1-ZTm+hwwWWtvVJAIg2+Nh8bxNRjQ=" + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==" }, "snapdragon": { "version": "0.8.2", @@ -6842,6 +6938,14 @@ "integrity": "sha1-NpS1gEVnpFjTyARYQqY1hjL2JlQ=", "dev": true }, + "split": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz", + "integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==", + "requires": { + "through": "2" + } + }, "split-string": { "version": "3.1.0", "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/split-string/-/split-string-3.1.0.tgz", @@ -6906,6 +7010,15 @@ "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", "dev": true }, + "stream-combiner": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.2.2.tgz", + "integrity": "sha1-rsjLrBd7Vrb0+kec7YwZEs7lKFg=", + "requires": { + "duplexer": "~0.1.1", + "through": "~2.3.4" + } + }, "stream-meter": { "version": "1.0.4", "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/stream-meter/-/stream-meter-1.0.4.tgz", @@ -6957,8 +7070,8 @@ }, "string_decoder": { "version": "1.1.1", - "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha1-nPFhG6YmhdcDCunkujQUnDrwP8g=", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "requires": { "safe-buffer": "~5.1.0" } @@ -6994,8 +7107,8 @@ }, "supports-color": { "version": "7.1.0", - "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha1-aOMlkd9z4lrRxLSRCKLsUHliv9E=", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", "requires": { "has-flag": "^4.0.0" } @@ -7084,6 +7197,11 @@ "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/throttleit/-/throttleit-1.0.0.tgz", "integrity": "sha1-nnhYNtr0Z0MUWlmEtiaNgoUorGw=" }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" + }, "tmpl": { "version": "1.0.4", "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/tmpl/-/tmpl-1.0.4.tgz", @@ -7130,8 +7248,8 @@ }, "to-regex-range": { "version": "5.0.1", - "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha1-FkjESq58jZiKMmAY7XL1tN0DkuQ=", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "requires": { "is-number": "^7.0.0" } @@ -7703,8 +7821,7 @@ "wrappy": { "version": "1.0.2", "resolved": "https://upsidetravel.jfrog.io/upsidetravel/api/npm/npm-virtual/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "write-file-atomic": { "version": "2.4.1", diff --git a/package.json b/package.json index 03b3653..72ae61b 100644 --- a/package.json +++ b/package.json @@ -101,8 +101,12 @@ "typescript": "^3.8.2" }, "dependencies": { + "@types/glob": "^7.1.1", "commander": "^4.1.1", + "glob": "^7.1.6", "lodash": "^4.17.15", - "pkg": "^4.4.3" + "nvm": "0.0.4", + "pkg": "^4.4.8", + "save": "^2.4.0" } } diff --git a/src/core/writer.ts b/src/core/writer.ts new file mode 100644 index 0000000..84e25d3 --- /dev/null +++ b/src/core/writer.ts @@ -0,0 +1,29 @@ +import {writeFileSync, readFileSync} from 'fs'; + + +export interface Writer{ + write(buffer: string) : void +} + +export class FileWriter implements Writer{ + private file_path: string; + constructor(file_path: string){ + this.file_path = file_path; + } + write(buffer: string): void { + // lets read the file first, and output to stdout if we actually modify it + let original = readFileSync(this.file_path) + if(original.compare(Buffer.from(buffer))){ + process.stdout.write(`${this.file_path}\n`); + } + writeFileSync(this.file_path, buffer) + } + +} +export class StdOutWriter implements Writer{ + + write(buffer: string): void { + process.stdout.write(buffer) + } + +} \ No newline at end of file diff --git a/src/dbt-command.ts b/src/dbt-command.ts index 5f7cc4a..73b8feb 100755 --- a/src/dbt-command.ts +++ b/src/dbt-command.ts @@ -1,21 +1,40 @@ -import { readFileSync } from 'fs'; +import { readFileSync, fstat, writeFileSync } from 'fs'; import * as program from 'commander'; import formatter from './dbt-formatter'; +import * as glob from 'glob'; +import { Writer, StdOutWriter, FileWriter } from './core/writer'; +import { writer } from 'repl'; program - .requiredOption('-f, --file ', 'sql file to format') - .option('--sql ', 'what sql flavor to use') - .option('--camelcase', 'allow camelcase') - .option('-i', '--indent ', 'how much to spaces for indentations') - .option('---no-upper', 'disable uppercasing reserved sql words') + .option('-f, --file ', 'sql file to format') + .option('-d, --directory ', 'The directory to recursively search.') + .option('-i', '--indent ', 'number of spaces for indent. Defaults to 4.') + .option('--upper', 'upercase reserved sql words') + .option('--replace', 'overwrites the linted file(s).') .parse(process.argv); -const query = readFileSync(program.file); -const formatted = formatter(query.toString(), { - sql: program.sql || 'default', - indent: program.indent || 2, - upper: program.upper || true, - allowCamelcase: program.camelcase || false, -}); +const writer_factory = (file:string): Writer => { + return program.replace ? new FileWriter(file) : new StdOutWriter() +} + +const do_work = (file: string) => { + + let query = readFileSync(file); + let formatted = formatter(query.toString(), { + sql: 'default', + indent: program.indent || 4, + upper: program.upper, + allowCamelcase: false, + }); + let writer = writer_factory(file) + writer.write(formatted) + +} + +if(program.file){ + do_work(program.file); +}else if (program.directory){ + let all_files = glob.sync(`${program.directory}/**/*.sql`) + all_files.forEach(do_work) +} -process.stdout.write(formatted);