diff --git a/build.gradle b/build.gradle --- a/build.gradle +++ b/build.gradle @@ -58,23 +58,29 @@ task beforeBuild { def createSoursetTasks = { String name, String outDir -> def setName = name.capitalize(); - def destDir = "$buildDir/compile/$name" + def compileDir = "$buildDir/compile/$name" def declDir = "$typingsDir/$name" def setDir = "$projectDir/src/$name" + def jsDir = outDir; def beforeBuildTask = task "beforeBuild$setName"(dependsOn: beforeBuild) { } def copyJsTask = task "copyJs$setName"(dependsOn: beforeBuildTask, type: Copy) { from "$setDir/js" - into outDir + into jsDir + } + + def lintJsTask = task "lintJs$setName"(dependsOn: beforeBuildTask, type: Exec) { + inputs.dir("$setDir/js/").skipWhenEmpty(); + commandLine "eslint", '--format', 'stylish', "$setDir/js/" } def compileTsTask = task "compileTs$setName"(dependsOn: beforeBuildTask, type: Exec) { - inputs.dir("$setDir/ts") + inputs.dir("$setDir/ts").skipWhenEmpty() inputs.file("$srcDir/tsconfig.json") inputs.file("$setDir/tsconfig.json") - outputs.dir(destDir) + outputs.dir(compileDir) outputs.dir(declDir) commandLine 'node_modules/.bin/tsc', @@ -82,7 +88,7 @@ def createSoursetTasks = { String name, '-t', target, '-m', jsmodule, '-d', - '--outDir', destDir, + '--outDir', compileDir, '--declarationDir', declDir if (lib) @@ -90,16 +96,26 @@ def createSoursetTasks = { String name, } def copyTsOutputTask = task "copyTsOutput$setName"(dependsOn: compileTsTask, type: Copy) { - from destDir - into outDir + from compileDir + into jsDir } def copyTypingsTask = task "copyTypings$setName"(dependsOn: compileTsTask, type: Copy) { from declDir + into jsDir + } + + def copyResourcesTask = task "copyResources$setName"(dependsOn: beforeBuildTask, type: Copy) { + from "$setDir/resources" into outDir } - task "build$setName"(dependsOn: [copyTypingsTask, copyTsOutputTask, copyJsTask]) { + task "build$setName" { + dependsOn copyTypingsTask, + copyTsOutputTask, + copyJsTask, + copyResourcesTask, + lintJsTask } } diff --git a/history.md b/history.md --- a/history.md +++ b/history.md @@ -4,7 +4,7 @@ HISTORY 1.2.0 ----- -Major rafactoring, moving to support browser (rjs) and server (cjs) environments. +Major rafactoring, moving to support both browser (rjs) and server (cjs) environments. - dependency injection container ported to typescript - sources are split to several sets to provide the ability for the conditional build of the project. diff --git a/package-lock.json b/package-lock.json --- a/package-lock.json +++ b/package-lock.json @@ -90,7 +90,7 @@ }, "duplexer": { "version": "0.1.1", - "resolved": "http://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=", "dev": true }, @@ -144,7 +144,7 @@ "dependencies": { "tape": { "version": "2.3.3", - "resolved": "http://registry.npmjs.org/tape/-/tape-2.3.3.tgz", + "resolved": "https://registry.npmjs.org/tape/-/tape-2.3.3.tgz", "integrity": "sha1-Lnzgox3wn41oUWZKcYQuDKUFevc=", "dev": true, "requires": { @@ -277,7 +277,7 @@ }, "minimist": { "version": "0.0.5", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.5.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.5.tgz", "integrity": "sha1-16oye87PUY+RBqxrjwA/o7zqhWY=", "dev": true }, @@ -316,7 +316,7 @@ }, "readable-stream": { "version": "1.1.14", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", "dev": true, "requires": { @@ -369,7 +369,7 @@ }, "string_decoder": { "version": "0.10.31", - "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", "dev": true }, @@ -432,7 +432,7 @@ }, "through2": { "version": "0.2.3", - "resolved": "http://registry.npmjs.org/through2/-/through2-0.2.3.tgz", + "resolved": "https://registry.npmjs.org/through2/-/through2-0.2.3.tgz", "integrity": "sha1-6zKE2k6jEbbMis42U3SKUqvyWj8=", "dev": true, "requires": { diff --git a/src/amd/js/messaging/Client.js b/src/amd/js/messaging/Client.js --- a/src/amd/js/messaging/Client.js +++ b/src/amd/js/messaging/Client.js @@ -7,7 +7,7 @@ _destination : null, _id : null, - constructor : function(session, destination, options) { + constructor : function(session, destination) { this._destination = destination; this._session = session; }, @@ -35,7 +35,7 @@ return options; }, - process : function(msg) { + process : function() { this.warn("Messages are not acceped by this client"); }, diff --git a/src/amd/js/messaging/Session.js b/src/amd/js/messaging/Session.js --- a/src/amd/js/messaging/Session.js +++ b/src/amd/js/messaging/Session.js @@ -76,26 +76,23 @@ }, handleAs: 'json' }) - .then( - function (id) { - me - .log( - "CLIENT id=${0}, mode=${1}, destination=${2}", + .then(function (id) { + me.log( + "CLIENT id=${0}, mode=${1}, destination=${2}", + id, + options.mode, + options.destination); + me._clients[id] = options.client ? + options.client : + function () { + me.warn( + "The client id=${0}, mode=${1}, destination=${2} isn't accepting mesages", id, options.mode, options.destination); - me._clients[id] = options.client ? - options.client : - function (msg) { - me - .warn( - "The client id=${0}, mode=${1}, destination=${2} isn't accepting mesages", - id, - options.mode, - options.destination); - }; - return id; - }); + }; + return id; + }); }); },