Skip to content

Commit

Permalink
Dependencies updated. Tests fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
gavoja committed Apr 15, 2020
1 parent 9350b99 commit c7baf60
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 78 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
```

Expand Down Expand Up @@ -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 })
```

Expand Down
54 changes: 27 additions & 27 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>",
"keywords": [
Expand All @@ -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"
Expand Down
63 changes: 19 additions & 44 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
Expand All @@ -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)
Expand Down Expand Up @@ -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: [
'<?xml version="1.0" encoding="UTF-8"?>',
'<workspaceFilter version="1.0">',
Expand Down Expand Up @@ -116,31 +121,19 @@ 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',
'META-INF/vault/definition/',
'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: [
'<?xml version="1.0" encoding="UTF-8"?>',
'<workspaceFilter version="1.0">',
'<filter root="/apps/myapp/component">',
'<exclude pattern="/apps/myapp/component/.*" />',
'<include pattern="/apps/myapp/component/folder" />',
'<include pattern="/apps/myapp/component/folder/.*" />',
'</filter>',
'',
'<filter root="/apps/myapp/component/folder">',
'<exclude pattern="/apps/myapp/component/folder/.*" />',
'<include pattern="/apps/myapp/component/folder/.content" />',
'<include pattern="/apps/myapp/component/folder/.content/.*" />',
'</filter>',
'<filter root="/apps/myapp/component/folder" />',
'',
'<filter root="/apps/myapp/component">',
'<exclude pattern="/apps/myapp/component/.*" />',
Expand Down Expand Up @@ -175,37 +168,19 @@ 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',
'META-INF/vault/definition/',
'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: [
'<?xml version="1.0" encoding="UTF-8"?>',
'<workspaceFilter version="1.0">',
'<filter root="/apps/myapp/component/folder">',
'<exclude pattern="/apps/myapp/component/folder/.*" />',
'<include pattern="/apps/myapp/component/folder/sub-folder" />',
'<include pattern="/apps/myapp/component/folder/sub-folder/.*" />',
'</filter>',
'',
'<filter root="/apps/myapp/component/folder/sub-folder">',
'<exclude pattern="/apps/myapp/component/folder/sub-folder/.*" />',
'<include pattern="/apps/myapp/component/folder/sub-folder/.content" />',
'<include pattern="/apps/myapp/component/folder/sub-folder/.content/.*" />',
'</filter>',
'',
'<filter root="/apps/myapp/component/folder">',
'<exclude pattern="/apps/myapp/component/folder/.*" />',
'<include pattern="/apps/myapp/component/folder/.content" />',
'<include pattern="/apps/myapp/component/folder/.content/.*" />',
'</filter>',
'<filter root="/apps/myapp/component/folder/sub-folder" />',
'',
'<filter root="/apps/myapp/component">',
'<exclude pattern="/apps/myapp/component/.*" />',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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: [
'<?xml version="1.0" encoding="UTF-8"?>',
'<workspaceFilter version="1.0">',
Expand Down Expand Up @@ -402,8 +376,8 @@ test('aemsync', class {
'META-INF/vault/nodetypes.cnd',
'META-INF/vault/properties.xml'
],
filter:
[ '<?xml version="1.0" encoding="UTF-8"?>',
filter: [
'<?xml version="1.0" encoding="UTF-8"?>',
'<workspaceFilter version="1.0">',
'<filter root="/apps/myapp/component">',
'<exclude pattern="/apps/myapp/component/.*" />',
Expand Down Expand Up @@ -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: [
'<?xml version="1.0" encoding="UTF-8"?>',
'<workspaceFilter version="1.0">',
Expand Down

0 comments on commit c7baf60

Please sign in to comment.