diff --git a/README.md b/README.md index 219db4d..22a2a02 100644 --- a/README.md +++ b/README.md @@ -23,31 +23,61 @@ npm install aemsync -g Commandline ``` -aemsync -t targets -w path_to_watch - --t: Comma separated list of target hosts; default is http://admin:admin@localhost:4502. --w: Folder to watch; default is current. --i: Update interval; default is 300ms. --e: Anymatch exclude filter; any file matching the pattern will be skipped. --d: Enable debug mode. +Usage: + aemsync [OPTIONS] + +Options: + -t Defult is http://admin:admin@localhost:4502 + -w Default is current + -p Path to push directly; used instead of above, + no watching takes place + -e Micromatch exclude filter; disabled by default + -i Update interval; default is 300ms + -u Package manager path; default is + /crx/packmgr/service.jsp + -d Enable debug mode + -h Displays this screen ``` ``` aemsync -t http://admin:admin@localhost:4502,http://admin:admin@localhost:4503 -w ~/workspace/my_project ``` -JavaScript +JavaScript (full watch example): +```JavaScript +// Import aemsync. +const aemsync = require('aemsync') + +// Set up the environment. +const workingDir = '~/workspace/my_project' +const targets = [ + 'http://admin:admin@localhost:4502', + 'http://admin:admin@localhost:4503' +] +const exclude = '**/*.orig' // Skip merge files. +const interval = 300 +const packmgrUrl = '/foo/crx/packmgr/service.jsp' +const onPushEnd = (err, host) => { + if (err) { + return console.log(`Error when pushing package to ${host}.`, err) + } + console.log(`Package pushed to ${host}.`) +} + +// Will watch for changes on workingDir and push them. +aemsync({workingDir, targets, exclude, interval, packmgrUrl, onPushEnd}) +``` + +JavaScript (direct push example): ```JavaScript // Import aemsync. const aemsync = require('aemsync') // Set up the environment. -let workingDir = '~/workspace/my_project' +let path = '~/foo/bar/my-workspace/jcr_content/apps/my-app/components/my-component' let targets = [ 'http://admin:admin@localhost:4502', 'http://admin:admin@localhost:4503' ] -let exclude = '**/*.orig' // Skip merge files. -let pushInterval = 300 let onPushEnd = (err, host) => { if (err) { return console.log(`Error when pushing package to ${host}.`, err) @@ -55,7 +85,8 @@ let onPushEnd = (err, host) => { console.log(`Package pushed to ${host}.`) } -aemsync({workingDir, targets, exclude, pushInterval, onPushEnd}) +// Will push the path to AEM. +aemsync.push({path, targets, onPushEnd}) ``` ### Description diff --git a/index.js b/index.js index 7bc5fd7..5fc86d6 100644 --- a/index.js +++ b/index.js @@ -6,60 +6,85 @@ const fs = require('graceful-fs') const log = require('./src/log') const chalk = require('chalk') const Watcher = require('./src/watcher') -const Pusher = require('./src/pusher') +const Pipeline = require('./src/pipeline') -const MSG_HELP = `Usage: aemsync [OPTIONS] +const MSG_HELP = ` +Usage: + aemsync [OPTIONS] Options: - -t targets Defult is http://admin:admin@localhost:4502 - -w path_to_watch Default is current - -e exclude_filter Micromatch exclude filter; disabled by default - -i sync_interval Update interval; default is 300ms - -d Enable debug mode - -h Displays this screen + -t Defult is http://admin:admin@localhost:4502 + -w Default is current + -p Path to push directly; used instead of above, + no watching takes place + -e Micromatch exclude filter; disabled by default + -i Update interval; default is 300ms + -u Package manager path; default is + /crx/packmgr/service.jsp + -d Enable debug mode + -h Displays this screen -Website: https://github.com/gavoja/aemsync` +Website: + https://github.com/gavoja/aemsync +` function aemsync (args) { - let pusher = new Pusher(args.targets.split(','), args.pushInterval, args.onPushEnd) - let watcher = new Watcher() + const pipeline = new Pipeline(args) + const watcher = new Watcher() - pusher.start() - watcher.watch(args.workingDir, args.exclude, (localPath) => { - pusher.enqueue(localPath) - }) + pipeline.start() + + args.callback = (localPath) => { + pipeline.enqueue(localPath) + } + + watcher.watch(args) +} + +function push (args) { + const pipeline = new Pipeline(args) + pipeline.push(args.pathToPush) } function main () { - let args = minimist(process.argv.slice(2)) + const args = minimist(process.argv.slice(2)) // Show help. if (args.h) { - console.log(MSG_HELP) - return + return console.log(MSG_HELP) } // Get other args. log.isDebug = args.d - let workingDir = path.resolve(args.w ? args.w : '.') + const workingDir = path.resolve(args.w || '.') + const targets = (args.t || 'http://admin:admin@localhost:4502').split(',') + const interval = args.i || 300 + const exclude = args.e || '' + const packmgrPath = args.u - if (!fs.existsSync(workingDir)) { - log.info('Invalid path:', chalk.yellow(workingDir)) - return + // Just the push. + if (args.p) { + let pathToPush = path.resolve(args.p) + if (!fs.existsSync(pathToPush)) { + return log.info('Invalid path:', chalk.yellow(workingDir)) + } + + return push({pathToPush, targets}) } - let targets = args.t ? args.t : 'http://admin:admin@localhost:4502' - let pushInterval = args.i ? args.i : 300 - let exclude = args.e ? args.e : '' + if (!fs.existsSync(workingDir)) { + return log.info('Invalid path:', chalk.yellow(workingDir)) + } + // Start aemsync log.info(` - Working dir: ${chalk.yellow(workingDir)} - Targets: ${chalk.yellow(targets)} - Interval: ${chalk.yellow(pushInterval)} - Exclude: ${chalk.yellow(exclude)} + Working dir: ${chalk.yellow(workingDir)} + Targets: ${chalk.yellow(targets)} + Interval: ${chalk.yellow(interval)} + Exclude: ${chalk.yellow(exclude)} `) - aemsync({workingDir, targets, pushInterval, exclude}) + aemsync({workingDir, targets, interval, exclude, packmgrPath}) } if (require.main === module) { @@ -67,6 +92,7 @@ if (require.main === module) { } aemsync.Watcher = Watcher -aemsync.Pusher = Pusher +aemsync.Pipeline = Pipeline aemsync.main = main +aemsync.push = push module.exports = aemsync diff --git a/package-lock.json b/package-lock.json index 3ff84c9..6bbaa07 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,7 +1,8 @@ { "name": "aemsync", - "version": "2.0.0", + "version": "2.1.0", "lockfileVersion": 1, + "requires": true, "dependencies": { "ansi-regex": { "version": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz", @@ -13,11 +14,28 @@ }, "archiver": { "version": "https://registry.npmjs.org/archiver/-/archiver-0.21.0.tgz", - "integrity": "sha1-Ep2gyOrhqb8IoBLYpOIEOh4pCc4=" + "integrity": "sha1-Ep2gyOrhqb8IoBLYpOIEOh4pCc4=", + "requires": { + "archiver-utils": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-0.3.0.tgz", + "async": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "buffer-crc32": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.5.tgz", + "glob": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", + "lodash": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", + "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.5.tgz", + "tar-stream": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.3.2.tgz", + "zip-stream": "https://registry.npmjs.org/zip-stream/-/zip-stream-0.8.0.tgz" + } }, "archiver-utils": { "version": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-0.3.0.tgz", - "integrity": "sha1-nYU0CJL+nnxsGxtq88M2ks9ZW3A=" + "integrity": "sha1-nYU0CJL+nnxsGxtq88M2ks9ZW3A=", + "requires": { + "glob": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", + "lazystream": "https://registry.npmjs.org/lazystream/-/lazystream-0.1.0.tgz", + "lodash": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", + "normalize-path": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.0.1.tgz", + "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.5.tgz" + } }, "arr-union": { "version": "3.1.0", @@ -41,16 +59,36 @@ "version": "0.11.1", "resolved": "https://registry.npmjs.org/base/-/base-0.11.1.tgz", "integrity": "sha1-s2p/ERE4U6NCoVaR2Y4tzIpswnA=", + "requires": { + "arr-union": "3.1.0", + "cache-base": "0.8.5", + "class-utils": "0.3.5", + "component-emitter": "1.2.1", + "define-property": "0.2.5", + "isobject": "2.1.0", + "lazy-cache": "2.0.2", + "mixin-deep": "1.2.0", + "pascalcase": "0.1.1" + }, "dependencies": { "define-property": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=" + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "0.1.5" + } }, "is-descriptor": { "version": "0.1.5", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.5.tgz", - "integrity": "sha1-4/uLSrZfOjc3M4jhi0AdeMWMvqc=" + "integrity": "sha1-4/uLSrZfOjc3M4jhi0AdeMWMvqc=", + "requires": { + "is-accessor-descriptor": "0.1.6", + "is-data-descriptor": "0.1.4", + "kind-of": "https://registry.npmjs.org/kind-of/-/kind-of-3.0.2.tgz", + "lazy-cache": "2.0.2" + } }, "isarray": { "version": "1.0.0", @@ -60,17 +98,27 @@ "isobject": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=" + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "requires": { + "isarray": "1.0.0" + } } } }, "bl": { "version": "https://registry.npmjs.org/bl/-/bl-1.1.2.tgz", - "integrity": "sha1-/cqHGplxOqANGeO7ukHER4emU5g=" + "integrity": "sha1-/cqHGplxOqANGeO7ukHER4emU5g=", + "requires": { + "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.5.tgz" + } }, "brace-expansion": { "version": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.3.tgz", - "integrity": "sha1-Rr/1ARXUf8mriYVKu4fZgHihCZE=" + "integrity": "sha1-Rr/1ARXUf8mriYVKu4fZgHihCZE=", + "requires": { + "balanced-match": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.3.0.tgz", + "concat-map": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + } }, "buffer-crc32": { "version": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.5.tgz", @@ -80,6 +128,18 @@ "version": "0.8.5", "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-0.8.5.tgz", "integrity": "sha1-YM6zUEAh7O7HAR/TOEt/TpVym/o=", + "requires": { + "collection-visit": "0.2.3", + "component-emitter": "1.2.1", + "get-value": "2.0.6", + "has-value": "0.3.1", + "isobject": "3.0.0", + "lazy-cache": "2.0.2", + "set-value": "0.4.3", + "to-object-path": "0.3.0", + "union-value": "0.2.4", + "unset-value": "0.1.2" + }, "dependencies": { "isobject": { "version": "3.0.0", @@ -90,22 +150,45 @@ }, "chalk": { "version": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=" + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "requires": { + "ansi-styles": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "escape-string-regexp": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "has-ansi": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "strip-ansi": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "supports-color": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz" + } }, "class-utils": { "version": "0.3.5", "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.5.tgz", "integrity": "sha1-F+eTEDdQ+WJ7IXbqNM/RtWWQPIA=", + "requires": { + "arr-union": "3.1.0", + "define-property": "0.2.5", + "isobject": "3.0.0", + "lazy-cache": "2.0.2", + "static-extend": "0.1.2" + }, "dependencies": { "define-property": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=" + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "0.1.5" + } }, "is-descriptor": { "version": "0.1.5", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.5.tgz", - "integrity": "sha1-4/uLSrZfOjc3M4jhi0AdeMWMvqc=" + "integrity": "sha1-4/uLSrZfOjc3M4jhi0AdeMWMvqc=", + "requires": { + "is-accessor-descriptor": "0.1.6", + "is-data-descriptor": "0.1.4", + "kind-of": "https://registry.npmjs.org/kind-of/-/kind-of-3.0.2.tgz", + "lazy-cache": "2.0.2" + } }, "isobject": { "version": "3.0.0", @@ -117,11 +200,19 @@ "collection-visit": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-0.2.3.tgz", - "integrity": "sha1-L2JIPK7MlfCDuaRUo+6eYTmteVc=" + "integrity": "sha1-L2JIPK7MlfCDuaRUo+6eYTmteVc=", + "requires": { + "lazy-cache": "2.0.2", + "map-visit": "0.1.5", + "object-visit": "0.3.4" + } }, "combined-stream": { "version": "https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.7.tgz", - "integrity": "sha1-ATfmV7qlp1QcV6w3rF/AfXO03B8=" + "integrity": "sha1-ATfmV7qlp1QcV6w3rF/AfXO03B8=", + "requires": { + "delayed-stream": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz" + } }, "component-emitter": { "version": "1.2.1", @@ -130,7 +221,14 @@ }, "compress-commons": { "version": "https://registry.npmjs.org/compress-commons/-/compress-commons-0.4.2.tgz", - "integrity": "sha1-GghHSJ8NcT0N12NDwMLQVdyc2JI=" + "integrity": "sha1-GghHSJ8NcT0N12NDwMLQVdyc2JI=", + "requires": { + "buffer-crc32": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.5.tgz", + "crc32-stream": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-0.4.0.tgz", + "node-int64": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "normalize-path": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.0.1.tgz", + "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.5.tgz" + } }, "concat-map": { "version": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -147,17 +245,27 @@ }, "crc32-stream": { "version": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-0.4.0.tgz", - "integrity": "sha1-tU1Mbu/TW1PmU9BiswbtxjFq4m0=" + "integrity": "sha1-tU1Mbu/TW1PmU9BiswbtxjFq4m0=", + "requires": { + "buffer-crc32": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.5.tgz", + "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.5.tgz" + } }, "debug": { "version": "2.6.8", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", - "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=" + "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", + "requires": { + "ms": "2.0.0" + } }, "define-property": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=" + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "requires": { + "is-descriptor": "1.0.0" + } }, "delayed-stream": { "version": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz", @@ -165,7 +273,10 @@ }, "end-of-stream": { "version": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.1.0.tgz", - "integrity": "sha1-6TUyWLqpEIll78QcsO+K3i88+wc=" + "integrity": "sha1-6TUyWLqpEIll78QcsO+K3i88+wc=", + "requires": { + "once": "https://registry.npmjs.org/once/-/once-1.3.3.tgz" + } }, "escape-string-regexp": { "version": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -174,11 +285,19 @@ "extend-shallow": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=" + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz" + } }, "form-data": { "version": "https://registry.npmjs.org/form-data/-/form-data-0.2.0.tgz", "integrity": "sha1-Jvi8JtpkQOKZy9z7aQNcT3em5GY=", + "requires": { + "async": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", + "combined-stream": "https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.7.tgz", + "mime-types": "https://registry.npmjs.org/mime-types/-/mime-types-2.0.14.tgz" + }, "dependencies": { "async": { "version": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", @@ -189,7 +308,10 @@ "fragment-cache": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=" + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "requires": { + "map-cache": "0.2.2" + } }, "get-value": { "version": "2.0.6", @@ -198,7 +320,14 @@ }, "glob": { "version": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", - "integrity": "sha1-DwiGD2oVUSey+t1PnOJLGqtuTSI=" + "integrity": "sha1-DwiGD2oVUSey+t1PnOJLGqtuTSI=", + "requires": { + "inflight": "https://registry.npmjs.org/inflight/-/inflight-1.0.4.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "minimatch": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.0.tgz", + "once": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", + "path-is-absolute": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz" + } }, "graceful-fs": { "version": "4.1.11", @@ -207,12 +336,20 @@ }, "has-ansi": { "version": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=" + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "requires": { + "ansi-regex": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz" + } }, "has-value": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=" + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "requires": { + "get-value": "2.0.6", + "has-values": "0.1.4", + "isobject": "https://registry.npmjs.org/isobject/-/isobject-2.0.0.tgz" + } }, "has-values": { "version": "0.1.4", @@ -221,7 +358,11 @@ }, "inflight": { "version": "https://registry.npmjs.org/inflight/-/inflight-1.0.4.tgz", - "integrity": "sha1-bLtFIevVHODsCpNr/XZX736bFyo=" + "integrity": "sha1-bLtFIevVHODsCpNr/XZX736bFyo=", + "requires": { + "once": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", + "wrappy": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz" + } }, "inherits": { "version": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", @@ -230,7 +371,10 @@ "is-accessor-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=" + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "requires": { + "kind-of": "https://registry.npmjs.org/kind-of/-/kind-of-3.0.2.tgz" + } }, "is-buffer": { "version": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.3.tgz", @@ -239,12 +383,21 @@ "is-data-descriptor": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=" + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "requires": { + "kind-of": "https://registry.npmjs.org/kind-of/-/kind-of-3.0.2.tgz" + } }, "is-descriptor": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.0.tgz", - "integrity": "sha1-1uxobyOPawLyN1er4Sz2suonkPk=" + "integrity": "sha1-1uxobyOPawLyN1er4Sz2suonkPk=", + "requires": { + "is-accessor-descriptor": "0.1.6", + "is-data-descriptor": "0.1.4", + "kind-of": "https://registry.npmjs.org/kind-of/-/kind-of-3.0.2.tgz", + "lazy-cache": "2.0.2" + } }, "is-extendable": { "version": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", @@ -254,11 +407,17 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-odd/-/is-odd-1.0.0.tgz", "integrity": "sha1-O4qTLrAos3dcObsJ6RdnrM22kIg=", + "requires": { + "is-number": "3.0.0" + }, "dependencies": { "is-number": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=" + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "requires": { + "kind-of": "https://registry.npmjs.org/kind-of/-/kind-of-3.0.2.tgz" + } } } }, @@ -266,6 +425,9 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.3.tgz", "integrity": "sha1-wVvz5LZrYtcu+vKSWEhmPsvGGbY=", + "requires": { + "isobject": "3.0.0" + }, "dependencies": { "isobject": { "version": "3.0.0", @@ -280,24 +442,42 @@ }, "isobject": { "version": "https://registry.npmjs.org/isobject/-/isobject-2.0.0.tgz", - "integrity": "sha1-II3ocr1zeMKpKvlCij9W65GhIsQ=" + "integrity": "sha1-II3ocr1zeMKpKvlCij9W65GhIsQ=", + "requires": { + "isarray": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz" + } }, "kind-of": { "version": "https://registry.npmjs.org/kind-of/-/kind-of-3.0.2.tgz", - "integrity": "sha1-GH20JwRufpCUVpLmdoZovWkA3qA=" + "integrity": "sha1-GH20JwRufpCUVpLmdoZovWkA3qA=", + "requires": { + "is-buffer": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.3.tgz" + } }, "lazy-cache": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-2.0.2.tgz", - "integrity": "sha1-uRkKT5EzVGlIQIWfio9whNiCImQ=" + "integrity": "sha1-uRkKT5EzVGlIQIWfio9whNiCImQ=", + "requires": { + "set-getter": "0.1.0" + } }, "lazystream": { "version": "https://registry.npmjs.org/lazystream/-/lazystream-0.1.0.tgz", "integrity": "sha1-GyXWPHcqTCDwpe0KnXf0hLbhaSA=", + "requires": { + "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.33.tgz" + }, "dependencies": { "readable-stream": { "version": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.33.tgz", - "integrity": "sha1-OjYN1mwbHX/UcFOJhg7aHQ9hEmw=" + "integrity": "sha1-OjYN1mwbHX/UcFOJhg7aHQ9hEmw=", + "requires": { + "core-util-is": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "isarray": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "string_decoder": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" + } } } }, @@ -313,12 +493,31 @@ "map-visit": { "version": "0.1.5", "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-0.1.5.tgz", - "integrity": "sha1-2+Q5J85VJbgN/BVzpE1oxR8mgWs=" + "integrity": "sha1-2+Q5J85VJbgN/BVzpE1oxR8mgWs=", + "requires": { + "lazy-cache": "2.0.2", + "object-visit": "0.3.4" + } }, "micromatch": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.0.3.tgz", "integrity": "sha512-uTjtugrI0sC0KbJNLZtCmyrg5oFESH++4QqLUdHLrKugDbCz+9V5983YfjpfJhmxqf5f2H+JV9JJhS0brPS9TA==", + "requires": { + "arr-diff": "4.0.0", + "array-unique": "0.3.2", + "braces": "2.2.2", + "define-property": "1.0.0", + "extend-shallow": "2.0.1", + "extglob": "1.1.0", + "fragment-cache": "0.2.1", + "kind-of": "4.0.0", + "nanomatch": "1.2.0", + "object.pick": "1.2.0", + "regex-not": "1.0.0", + "snapdragon": "0.8.1", + "to-regex": "3.0.1" + }, "dependencies": { "arr-diff": { "version": "4.0.0", @@ -338,17 +537,42 @@ "braces": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/braces/-/braces-2.2.2.tgz", - "integrity": "sha1-JB+GjCsmkNn+vu5afIP7vyXQCxs=" + "integrity": "sha1-JB+GjCsmkNn+vu5afIP7vyXQCxs=", + "requires": { + "arr-flatten": "1.0.3", + "array-unique": "0.3.2", + "define-property": "1.0.0", + "extend-shallow": "2.0.1", + "fill-range": "4.0.0", + "isobject": "3.0.0", + "repeat-element": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", + "snapdragon": "0.8.1", + "snapdragon-node": "2.0.1", + "split-string": "2.1.1", + "to-regex": "3.0.1" + } }, "expand-brackets": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "requires": { + "debug": "2.6.8", + "define-property": "0.2.5", + "extend-shallow": "2.0.1", + "posix-character-classes": "0.1.1", + "regex-not": "1.0.0", + "snapdragon": "0.8.1", + "to-regex": "3.0.1" + }, "dependencies": { "define-property": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=" + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "0.1.5" + } } } }, @@ -356,16 +580,34 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/extglob/-/extglob-1.1.0.tgz", "integrity": "sha1-Bni04s5FwOTlD15er7Gw2rW05CQ=", + "requires": { + "array-unique": "0.3.2", + "define-property": "0.2.5", + "expand-brackets": "2.1.4", + "extend-shallow": "2.0.1", + "fragment-cache": "0.2.1", + "regex-not": "1.0.0", + "snapdragon": "0.8.1", + "to-regex": "2.1.0" + }, "dependencies": { "define-property": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=" + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "0.1.5" + } }, "to-regex": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-2.1.0.tgz", "integrity": "sha1-4606QM/hGVWaBa6kPkyu+sxekB0=", + "requires": { + "define-property": "0.2.5", + "extend-shallow": "2.0.1", + "regex-not": "0.1.2" + }, "dependencies": { "regex-not": { "version": "0.1.2", @@ -379,7 +621,13 @@ "fill-range": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=" + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "requires": { + "extend-shallow": "2.0.1", + "is-number": "3.0.0", + "repeat-string": "1.6.1", + "to-regex-range": "2.1.1" + } }, "is-buffer": { "version": "1.1.5", @@ -390,11 +638,20 @@ "version": "0.1.5", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.5.tgz", "integrity": "sha1-4/uLSrZfOjc3M4jhi0AdeMWMvqc=", + "requires": { + "is-accessor-descriptor": "0.1.6", + "is-data-descriptor": "0.1.4", + "kind-of": "3.2.2", + "lazy-cache": "2.0.2" + }, "dependencies": { "kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=" + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "1.1.5" + } } } }, @@ -402,11 +659,17 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "requires": { + "kind-of": "3.2.2" + }, "dependencies": { "kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=" + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "1.1.5" + } } } }, @@ -418,7 +681,10 @@ "kind-of": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=" + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "requires": { + "is-buffer": "1.1.5" + } }, "repeat-string": { "version": "1.6.1", @@ -433,11 +699,17 @@ }, "mime-types": { "version": "https://registry.npmjs.org/mime-types/-/mime-types-2.0.14.tgz", - "integrity": "sha1-MQ4VnbI+B3+Lsit0jav6SVcUCqY=" + "integrity": "sha1-MQ4VnbI+B3+Lsit0jav6SVcUCqY=", + "requires": { + "mime-db": "https://registry.npmjs.org/mime-db/-/mime-db-1.12.0.tgz" + } }, "minimatch": { "version": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.0.tgz", - "integrity": "sha1-UjYVelHk8ATBd/s8Un/33Xjw74M=" + "integrity": "sha1-UjYVelHk8ATBd/s8Un/33Xjw74M=", + "requires": { + "brace-expansion": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.3.tgz" + } }, "minimist": { "version": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", @@ -447,6 +719,10 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.2.0.tgz", "integrity": "sha1-0CuMb4ttS49ZgtP9AJxJGYUcP+I=", + "requires": { + "for-in": "1.0.2", + "is-extendable": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz" + }, "dependencies": { "for-in": { "version": "1.0.2", @@ -464,6 +740,20 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.0.tgz", "integrity": "sha1-dv2z1K52F+N3GeekBHuECFfAyxw=", + "requires": { + "arr-diff": "4.0.0", + "array-unique": "0.3.2", + "define-property": "1.0.0", + "extend-shallow": "2.0.1", + "fragment-cache": "0.2.1", + "is-extglob": "2.1.1", + "is-odd": "1.0.0", + "kind-of": "4.0.0", + "object.pick": "1.2.0", + "regex-not": "1.0.0", + "snapdragon": "0.8.1", + "to-regex": "3.0.1" + }, "dependencies": { "arr-diff": { "version": "4.0.0", @@ -488,7 +778,10 @@ "kind-of": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=" + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "requires": { + "is-buffer": "1.1.5" + } } } }, @@ -504,11 +797,19 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "requires": { + "copy-descriptor": "0.1.1", + "define-property": "0.2.5", + "kind-of": "3.2.2" + }, "dependencies": { "define-property": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=" + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "0.1.5" + } }, "is-buffer": { "version": "1.1.5", @@ -518,24 +819,39 @@ "is-descriptor": { "version": "0.1.5", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.5.tgz", - "integrity": "sha1-4/uLSrZfOjc3M4jhi0AdeMWMvqc=" + "integrity": "sha1-4/uLSrZfOjc3M4jhi0AdeMWMvqc=", + "requires": { + "is-accessor-descriptor": "0.1.6", + "is-data-descriptor": "0.1.4", + "kind-of": "3.2.2", + "lazy-cache": "2.0.2" + } }, "kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=" + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "1.1.5" + } } } }, "object-visit": { "version": "0.3.4", "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-0.3.4.tgz", - "integrity": "sha1-rhXPhvCy/dVRdxY2RIRSxUw9qCk=" + "integrity": "sha1-rhXPhvCy/dVRdxY2RIRSxUw9qCk=", + "requires": { + "isobject": "https://registry.npmjs.org/isobject/-/isobject-2.0.0.tgz" + } }, "object.pick": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.2.0.tgz", "integrity": "sha1-tTkr7peC2m2ft9avr1OXefEjTCs=", + "requires": { + "isobject": "2.1.0" + }, "dependencies": { "isarray": { "version": "1.0.0", @@ -545,13 +861,19 @@ "isobject": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=" + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "requires": { + "isarray": "1.0.0" + } } } }, "once": { "version": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", - "integrity": "sha1-suJhVXzkwxTsgwTz+oJmPkKXyiA=" + "integrity": "sha1-suJhVXzkwxTsgwTz+oJmPkKXyiA=", + "requires": { + "wrappy": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz" + } }, "pascalcase": { "version": "0.1.1", @@ -573,12 +895,23 @@ }, "readable-stream": { "version": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.5.tgz", - "integrity": "sha1-okJvjc1FUcd6M/lu3yiGojyClmk=" + "integrity": "sha1-okJvjc1FUcd6M/lu3yiGojyClmk=", + "requires": { + "core-util-is": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "isarray": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "process-nextick-args": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.6.tgz", + "string_decoder": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "util-deprecate": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" + } }, "regex-not": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.0.tgz", - "integrity": "sha1-Qvg+OXcWIt+CawKvF2Ul1qXxV/k=" + "integrity": "sha1-Qvg+OXcWIt+CawKvF2Ul1qXxV/k=", + "requires": { + "extend-shallow": "2.0.1" + } }, "repeat-element": { "version": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", @@ -592,12 +925,21 @@ "set-getter": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/set-getter/-/set-getter-0.1.0.tgz", - "integrity": "sha1-12nBgsnVpR9AkUXy+6guXoboA3Y=" + "integrity": "sha1-12nBgsnVpR9AkUXy+6guXoboA3Y=", + "requires": { + "to-object-path": "0.3.0" + } }, "set-value": { "version": "0.4.3", "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", - "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=" + "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", + "requires": { + "extend-shallow": "2.0.1", + "is-extendable": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "is-plain-object": "2.0.3", + "to-object-path": "0.3.0" + } }, "simple-watcher": { "version": "3.0.0", @@ -608,16 +950,35 @@ "version": "0.8.1", "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.1.tgz", "integrity": "sha1-4StUh/re0+PeoKyR6UAL91tAE3A=", + "requires": { + "base": "0.11.1", + "debug": "2.6.8", + "define-property": "0.2.5", + "extend-shallow": "2.0.1", + "map-cache": "0.2.2", + "source-map": "0.5.6", + "source-map-resolve": "0.5.0", + "use": "2.0.2" + }, "dependencies": { "define-property": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=" + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "0.1.5" + } }, "is-descriptor": { "version": "0.1.5", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.5.tgz", - "integrity": "sha1-4/uLSrZfOjc3M4jhi0AdeMWMvqc=" + "integrity": "sha1-4/uLSrZfOjc3M4jhi0AdeMWMvqc=", + "requires": { + "is-accessor-descriptor": "0.1.6", + "is-data-descriptor": "0.1.4", + "kind-of": "https://registry.npmjs.org/kind-of/-/kind-of-3.0.2.tgz", + "lazy-cache": "2.0.2" + } } } }, @@ -625,6 +986,11 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.0.1.tgz", "integrity": "sha1-O0hc7yptVd+utSZBqDiMbqgcvqI=", + "requires": { + "define-property": "1.0.0", + "isobject": "3.0.0", + "snapdragon-util": "3.0.0" + }, "dependencies": { "isobject": { "version": "3.0.0", @@ -637,6 +1003,9 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.0.tgz", "integrity": "sha1-CsYojYQJ5F0E/RA04Lt0VwHK6cA=", + "requires": { + "kind-of": "3.2.2" + }, "dependencies": { "is-buffer": { "version": "1.1.5", @@ -646,7 +1015,10 @@ "kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=" + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "1.1.5" + } } } }, @@ -658,7 +1030,13 @@ "source-map-resolve": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.0.tgz", - "integrity": "sha1-/K0LZLcK+ydpnkJZUMtevNQQvCA=" + "integrity": "sha1-/K0LZLcK+ydpnkJZUMtevNQQvCA=", + "requires": { + "atob": "2.0.3", + "resolve-url": "0.2.1", + "source-map-url": "0.4.0", + "urix": "0.1.0" + } }, "source-map-url": { "version": "0.4.0", @@ -668,22 +1046,38 @@ "split-string": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/split-string/-/split-string-2.1.1.tgz", - "integrity": "sha1-r0sG2CFWBCZEbDzZMc2mGJQNN9A=" + "integrity": "sha1-r0sG2CFWBCZEbDzZMc2mGJQNN9A=", + "requires": { + "extend-shallow": "2.0.1" + } }, "static-extend": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "requires": { + "define-property": "0.2.5", + "object-copy": "0.1.0" + }, "dependencies": { "define-property": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=" + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "0.1.5" + } }, "is-descriptor": { "version": "0.1.5", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.5.tgz", - "integrity": "sha1-4/uLSrZfOjc3M4jhi0AdeMWMvqc=" + "integrity": "sha1-4/uLSrZfOjc3M4jhi0AdeMWMvqc=", + "requires": { + "is-accessor-descriptor": "0.1.6", + "is-data-descriptor": "0.1.4", + "kind-of": "https://registry.npmjs.org/kind-of/-/kind-of-3.0.2.tgz", + "lazy-cache": "2.0.2" + } } } }, @@ -693,7 +1087,10 @@ }, "strip-ansi": { "version": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=" + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz" + } }, "supports-color": { "version": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", @@ -701,27 +1098,50 @@ }, "tar-stream": { "version": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.3.2.tgz", - "integrity": "sha1-ck0atIAcmzFJzep2X+jJDqcfZgY=" + "integrity": "sha1-ck0atIAcmzFJzep2X+jJDqcfZgY=", + "requires": { + "bl": "https://registry.npmjs.org/bl/-/bl-1.1.2.tgz", + "end-of-stream": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.1.0.tgz", + "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.5.tgz", + "xtend": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz" + } }, "to-object-path": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=" + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "requires": { + "kind-of": "https://registry.npmjs.org/kind-of/-/kind-of-3.0.2.tgz" + } }, "to-regex": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.1.tgz", "integrity": "sha1-FTWL7kosg712N3uh3ASdDxiDeq4=", + "requires": { + "define-property": "0.2.5", + "extend-shallow": "2.0.1", + "regex-not": "1.0.0" + }, "dependencies": { "define-property": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=" + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "0.1.5" + } }, "is-descriptor": { "version": "0.1.5", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.5.tgz", - "integrity": "sha1-4/uLSrZfOjc3M4jhi0AdeMWMvqc=" + "integrity": "sha1-4/uLSrZfOjc3M4jhi0AdeMWMvqc=", + "requires": { + "is-accessor-descriptor": "0.1.6", + "is-data-descriptor": "0.1.4", + "kind-of": "https://registry.npmjs.org/kind-of/-/kind-of-3.0.2.tgz", + "lazy-cache": "2.0.2" + } } } }, @@ -729,11 +1149,18 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "requires": { + "is-number": "3.0.0", + "repeat-string": "1.6.1" + }, "dependencies": { "is-number": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=" + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "requires": { + "kind-of": "https://registry.npmjs.org/kind-of/-/kind-of-3.0.2.tgz" + } }, "repeat-string": { "version": "1.6.1", @@ -745,12 +1172,22 @@ "union-value": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/union-value/-/union-value-0.2.4.tgz", - "integrity": "sha1-c3UVJ4ZnkFfns3qmdug0aPwCdPA=" + "integrity": "sha1-c3UVJ4ZnkFfns3qmdug0aPwCdPA=", + "requires": { + "arr-union": "3.1.0", + "get-value": "2.0.6", + "is-extendable": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "set-value": "0.4.3" + } }, "unset-value": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-0.1.2.tgz", "integrity": "sha1-UGgQuGfyfCpabpsEgzYx9t5Y0xA=", + "requires": { + "has-value": "0.3.1", + "isobject": "3.0.0" + }, "dependencies": { "isobject": { "version": "3.0.0", @@ -768,16 +1205,30 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/use/-/use-2.0.2.tgz", "integrity": "sha1-riig1y+TvyJCKhii43mZMRLeyOg=", + "requires": { + "define-property": "0.2.5", + "isobject": "3.0.0", + "lazy-cache": "2.0.2" + }, "dependencies": { "define-property": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=" + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "0.1.5" + } }, "is-descriptor": { "version": "0.1.5", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.5.tgz", - "integrity": "sha1-4/uLSrZfOjc3M4jhi0AdeMWMvqc=" + "integrity": "sha1-4/uLSrZfOjc3M4jhi0AdeMWMvqc=", + "requires": { + "is-accessor-descriptor": "0.1.6", + "is-data-descriptor": "0.1.4", + "kind-of": "https://registry.npmjs.org/kind-of/-/kind-of-3.0.2.tgz", + "lazy-cache": "2.0.2" + } }, "isobject": { "version": "3.0.0", @@ -800,7 +1251,13 @@ }, "zip-stream": { "version": "https://registry.npmjs.org/zip-stream/-/zip-stream-0.8.0.tgz", - "integrity": "sha1-I2sv4lgjy09I6DNvW/p0OqWunb0=" + "integrity": "sha1-I2sv4lgjy09I6DNvW/p0OqWunb0=", + "requires": { + "archiver-utils": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-0.3.0.tgz", + "compress-commons": "https://registry.npmjs.org/compress-commons/-/compress-commons-0.4.2.tgz", + "lodash": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", + "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.5.tgz" + } } } } diff --git a/package.json b/package.json index 2a5f1a6..4080199 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aemsync", - "version": "2.0.1", + "version": "3.0.0", "description": "Adobe AEM Synchronization Tool", "author": "Michal Kochel ", "keywords": [ diff --git a/src/handlers/content-handler.js b/src/handlers/content-handler.js index cf56fc4..9bc06c0 100644 --- a/src/handlers/content-handler.js +++ b/src/handlers/content-handler.js @@ -2,8 +2,8 @@ const path = require('path') -const RE_CONTENT_PATH = /^.*\/jcr_root(\/[^\/]+){2,}$/ -const RE_SPECIAL = /^.*\/(_jcr_content|[^\/]+\.dir|\.content\.xml).*$/ +const RE_CONTENT_PATH = /^.*\/jcr_root(\/[^/]+){2,}$/ +const RE_SPECIAL = /^.*\/(_jcr_content|[^/]+\.dir|\.content\.xml).*$/ const RE_TARGET_PATH = /^.*\/(target|\..*)\/(.*\/)?jcr_root\/.*$/ const IGNORED = ['.svn', '.hg', '.git'] diff --git a/src/package.js b/src/package.js index ac6185f..ede7046 100644 --- a/src/package.js +++ b/src/package.js @@ -11,7 +11,7 @@ const DATA_PATH = path.resolve(__dirname, '..', 'data') const PACKAGE_CONTENT_PATH = path.join(DATA_PATH, 'package_content') const NT_FOLDER_PATH = path.join(DATA_PATH, 'nt_folder', '.content.xml') const RE_UNSTRUCTURED = /jcr:primaryType\s*=\s*"nt:unstructured"/g -const RE_CONTENT_PATH = /^.*\/jcr_root(\/[^\/]+){2,}$/ +const RE_CONTENT_PATH = /^.*\/jcr_root(\/[^/]+){2,}$/ const FILTER_ZIP_PATH = 'META-INF/vault/filter.xml' const FILTER_WRAPPER = ` %s @@ -148,7 +148,7 @@ class Package { // Wrap filters filters = util.format(FILTER_WRAPPER, filters) - archive.addFile(new Buffer(filters), FILTER_ZIP_PATH) + archive.addFile(Buffer.from(filters), FILTER_ZIP_PATH) log.debug(filters) archive.save(callback) } @@ -194,7 +194,7 @@ class Package { getFilterPath (localPath) { return this.cleanPath(localPath) .replace(/(.*jcr_root)|(\.xml$)|(\.dir)/g, '') - .replace(/\/_([^\/]*)_([^\/]*)$/g, '\/$1:$2') + .replace(/\/_([^/]*)_([^/]*)$/g, '/$1:$2') } } diff --git a/src/pusher.js b/src/pipeline.js similarity index 87% rename from src/pusher.js rename to src/pipeline.js index 976b8c6..543a47a 100644 --- a/src/pusher.js +++ b/src/pipeline.js @@ -7,14 +7,14 @@ const Sender = require('./sender.js') const log = require('./log.js') /** Pushes changes to AEM. */ -class Pusher { - constructor (targets, interval, onPushEnd) { +class Pipeline { + constructor ({targets, interval, packmgrPath, onPushEnd}) { this.lock = 0 this.queue = [] this.targets = targets this.interval = interval || 300 this.handlers = [new ContentHandler()] - this.sender = new Sender(targets) + this.sender = new Sender({targets, packmgrPath}) this.onPushEnd = onPushEnd || function () {} } @@ -72,7 +72,7 @@ class Pusher { let finalize = (err) => { this.lock = err ? 0 : this.lock - 1 if (this.lock === 0) { - callback(err) + callback && callback(err) log.groupEnd() } } @@ -102,6 +102,10 @@ class Pusher { finalize(err) } } + + push (localPath) { + this.process([localPath]) + } } -module.exports = Pusher +module.exports = Pipeline diff --git a/src/sender.js b/src/sender.js index fe2dfa9..2870c70 100644 --- a/src/sender.js +++ b/src/sender.js @@ -6,12 +6,13 @@ const FormData = require('form-data') const StringDecoder = require('string_decoder').StringDecoder const log = require('./log') -const PACKAGE_MANAGER_URL = '/crx/packmgr/service.jsp' +const PACKMGR_PATH = '/crx/packmgr/service.jsp' const RE_STATUS = /code="([0-9]+)">(.*) { + this.onSubmit(err, res, zipPath, target, timestamp, callback) }) } /** Package install submit callback */ onSubmit (err, res, zipPath, target, timestamp, callback) { - let host = target.substring(target.indexOf('@') + 1) + const host = target.substring(target.indexOf('@') + 1) + let errorMessage = 'Invalid response; is the packmgr path valid?' // Server error. if (!res) { - let delta = Date.now() - timestamp - let time = new Date().toISOString() + const delta = Date.now() - timestamp + const time = new Date().toISOString() return callback(err.code, host, delta, time) } - let decoder = new StringDecoder('utf8') - let output = [`Output from ${host}:`] - res.on('data', function (chunk) { + const decoder = new StringDecoder('utf8') + const output = [`Output from ${host}:`] + + res.on('data', (chunk) => { // Get message and remove new line. let textChunk = decoder.write(chunk) textChunk = textChunk.replace(/\r/g, '').substring(0, textChunk.length - 1) output.push(textChunk) // Parse message. - let match = RE_STATUS.exec(textChunk) + const match = RE_STATUS.exec(textChunk) if (match === null || match.length !== 3) { return } - let code = match[1] - let msg = match[2] - let err = code === '200' ? '' : msg + const code = match[1] + const msg = match[2] + errorMessage = code === '200' ? '' : msg log.group() output.forEach(line => { log.debug(line) if (line.startsWith('E ')) { - err += `\n${line.substr(2)}` + errorMessage += `\n${line.substr(2)}` } }) + log.groupEnd() + }) + res.on('end', () => { let delta = Date.now() - timestamp let time = new Date().toISOString() - - callback(err, host, delta, time) + callback(errorMessage, host, delta, time) }) } } diff --git a/src/watcher.js b/src/watcher.js index 893637d..ed560f6 100644 --- a/src/watcher.js +++ b/src/watcher.js @@ -6,14 +6,14 @@ const chalk = require('chalk') const watcher = require('simple-watcher') class Watcher { - watch (workingDir, exclude, callback) { + watch ({workingDir, exclude, callback}) { log.info(`Scanning: ${chalk.yellow(workingDir)} ...`) watcher(workingDir, (localPath) => { log.debug('Changed:', localPath) // Skip excluded. - if (exclude && mm([localPath], exclude).length > 0) { + if (exclude && mm([localPath], {dot: true}, exclude).length > 0) { return }