From c7baf60e50fbffb15ff9d64d73218954db33a169 Mon Sep 17 00:00:00 2001 From: Michal Kochel Date: Wed, 15 Apr 2020 18:05:55 +0200 Subject: [PATCH] Dependencies updated. Tests fixed. --- README.md | 2 ++ package-lock.json | 54 ++++++++++++++++++++-------------------- package.json | 14 +++++------ test/test.js | 63 ++++++++++++++--------------------------------- 4 files changed, 55 insertions(+), 78 deletions(-) diff --git a/README.md b/README.md index fd61aef..7c659c6 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,7 @@ const onPushEnd = (err, target, log) => { const checkBeforePush = true // Will watch for changes over workingDir and push upon a file change. +// Only the first argument is mandatory. aemsync(workingDir, { targets, exclude, interval, packmgrUrl, onPushEnd, checkBeforePush }) ``` @@ -112,6 +113,7 @@ const checkBeforePush = true // Will push the path to AEM. // To use await, the call must be made inside an async function. // The result is a Promise so it can also be resolved with .then(). +// Only the first argument is mandatory. await push(pathToPush, { targets, onPushEnd, checkBeforePush }) ``` diff --git a/package-lock.json b/package-lock.json index 599bbee..c003650 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,13 +1,13 @@ { "name": "aemsync", - "version": "4.0.0-rc1", + "version": "4.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { "adm-zip": { - "version": "0.4.13", - "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.13.tgz", - "integrity": "sha512-fERNJX8sOXfel6qCBCMPvZLzENBEhZTzKqg6vrOW5pvoEaQuJhRU4ndTAh6lHOxn1I6jnz2NHra56ZODM751uw==" + "version": "0.4.14", + "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.14.tgz", + "integrity": "sha512-/9aQCnQHF+0IiCl0qhXoK7qs//SwYE7zX8lsr/DNk1BRAHYxeLZPL4pguwK29gUEqasYQjqPtEpDRSWEkdHn9g==" }, "asynckit": { "version": "0.4.0", @@ -15,9 +15,9 @@ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" }, "combined-stream": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", - "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "requires": { "delayed-stream": "~1.0.0" } @@ -28,12 +28,12 @@ "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" }, "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.0.tgz", + "integrity": "sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg==", "requires": { "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", + "combined-stream": "^1.0.8", "mime-types": "^2.1.12" } }, @@ -43,32 +43,32 @@ "integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==" }, "mime-db": { - "version": "1.40.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", - "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==" + "version": "1.43.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.43.0.tgz", + "integrity": "sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ==" }, "mime-types": { - "version": "2.1.24", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", - "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", + "version": "2.1.26", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.26.tgz", + "integrity": "sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ==", "requires": { - "mime-db": "1.40.0" + "mime-db": "1.43.0" } }, "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" }, "node-fetch": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.4.1.tgz", - "integrity": "sha512-P9UbpFK87NyqBZzUuDBDz4f6Yiys8xm8j7ACDbi6usvFm6KItklQUKjeoqTrYS/S1k6I8oaOC2YLLDr/gg26Mw==" + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", + "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==" }, "simple-watcher": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/simple-watcher/-/simple-watcher-4.0.0.tgz", - "integrity": "sha512-vdT8721TVJWUXyxsFoLr7mHzGNsLuuloQ0GIePAqcpFeH9+p4CUO4nLg9X0F5uYIF3Afw01qwc3Ob90gzaY42w==" + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/simple-watcher/-/simple-watcher-4.0.1.tgz", + "integrity": "sha512-ITLIHrLjkBw7V6YZXW7FwBMuIAI+Gy2lgnyLozQfcoL2255XfBj9XIxOhuYqgfCZOsNe3UxG2FM+VICtouD28A==" }, "triala": { "version": "0.3.0", diff --git a/package.json b/package.json index 027038e..0e6b7d4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aemsync", - "version": "4.0.0", + "version": "4.0.1", "description": "The code and content synchronization for Sling / AEM (Adobe Experience Manager).", "author": "Michal Kochel ", "keywords": [ @@ -23,16 +23,16 @@ "triala": "^0.3.0" }, "dependencies": { - "adm-zip": "^0.4.13", - "form-data": "^2.3.3", + "adm-zip": "^0.4.14", + "form-data": "^3.0.0", "globrex": "^0.1.2", - "minimist": "^1.2.0", - "node-fetch": "^2.4.1", - "simple-watcher": "^4.0.0", + "minimist": "^1.2.5", + "node-fetch": "^2.6.0", + "simple-watcher": "^4.0.1", "xml-to-json-stream": "^1.1.0" }, "scripts": { - "test": "node test.js -v" + "test": "node test/test.js -v" }, "bin": { "aemsync": "./bin/aemsync" diff --git a/test/test.js b/test/test.js index 0376d29..5820cb0 100644 --- a/test/test.js +++ b/test/test.js @@ -18,6 +18,10 @@ test('aemsync', class { return pack.zip.inspect() } + // + // Test cases start here. + // + async 'onPushEnd failure' () { const msg = 'Something went wrong' this.pipeline._post = (archivePath, target) => ({ err: new Error(msg), target }) @@ -36,7 +40,7 @@ test('aemsync', class { } async 'exclude' () { - const expected = { entries: [], filter: [ '' ] } + const expected = { entries: [], filter: [''] } assert.deepStrictEqual(await this._push(path.join('jcr_root')), expected) assert.deepStrictEqual(await this._push(path.join('jcr_root', 'bar')), expected) @@ -73,7 +77,8 @@ test('aemsync', class { 'META-INF/vault/definition/.content.xml@vlt:PackageDefinition', 'META-INF/vault/filter.xml', 'META-INF/vault/nodetypes.cnd', - 'META-INF/vault/properties.xml' ], + 'META-INF/vault/properties.xml' + ], filter: [ '', '', @@ -116,9 +121,6 @@ test('aemsync', class { 'jcr_root/apps/.content.xml@nt:folder', 'jcr_root/apps/myapp/.content.xml@nt:folder', 'jcr_root/apps/myapp/component/.content.xml@cq:Component', - 'jcr_root/apps/myapp/component/folder/', - 'jcr_root/apps/myapp/component/folder/.content.xml@nt:folder', - 'jcr_root/apps/myapp/component/folder/sub-folder/', 'META-INF/', 'META-INF/vault/', 'META-INF/vault/config.xml', @@ -126,21 +128,12 @@ test('aemsync', class { 'META-INF/vault/definition/.content.xml@vlt:PackageDefinition', 'META-INF/vault/filter.xml', 'META-INF/vault/nodetypes.cnd', - 'META-INF/vault/properties.xml' ], + 'META-INF/vault/properties.xml' + ], filter: [ '', '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', + '', '', '', '', @@ -175,9 +168,6 @@ test('aemsync', class { 'jcr_root/apps/.content.xml@nt:folder', 'jcr_root/apps/myapp/.content.xml@nt:folder', 'jcr_root/apps/myapp/component/.content.xml@cq:Component', - 'jcr_root/apps/myapp/component/folder/.content.xml@nt:folder', - 'jcr_root/apps/myapp/component/folder/sub-folder/', - 'jcr_root/apps/myapp/component/folder/sub-folder/.content.xml@nt:folder', 'META-INF/', 'META-INF/vault/', 'META-INF/vault/config.xml', @@ -185,27 +175,12 @@ test('aemsync', class { 'META-INF/vault/definition/.content.xml@vlt:PackageDefinition', 'META-INF/vault/filter.xml', 'META-INF/vault/nodetypes.cnd', - 'META-INF/vault/properties.xml' ], + 'META-INF/vault/properties.xml' + ], filter: [ '', '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', + '', '', '', '', @@ -258,8 +233,6 @@ test('aemsync', class { 'jcr_root/apps/myapp/component/folder-node-nested/foo/bar/baz/file-node.xml', 'jcr_root/apps/myapp/component/folder-node/', 'jcr_root/apps/myapp/component/folder-node/.content.xml@nt:unstructured', - 'jcr_root/apps/myapp/component/folder/', - 'jcr_root/apps/myapp/component/folder/sub-folder/', 'META-INF/', 'META-INF/vault/', 'META-INF/vault/config.xml', @@ -332,7 +305,8 @@ test('aemsync', class { 'META-INF/vault/definition/.content.xml@vlt:PackageDefinition', 'META-INF/vault/filter.xml', 'META-INF/vault/nodetypes.cnd', - 'META-INF/vault/properties.xml' ], + 'META-INF/vault/properties.xml' + ], filter: [ '', '', @@ -402,8 +376,8 @@ test('aemsync', class { 'META-INF/vault/nodetypes.cnd', 'META-INF/vault/properties.xml' ], - filter: - [ '', + filter: [ + '', '', '', '', @@ -541,7 +515,8 @@ test('aemsync', class { 'META-INF/vault/definition/.content.xml@vlt:PackageDefinition', 'META-INF/vault/filter.xml', 'META-INF/vault/nodetypes.cnd', - 'META-INF/vault/properties.xml' ], + 'META-INF/vault/properties.xml' + ], filter: [ '', '',