diff --git a/.gitignore b/.gitignore index 08cb4a8..3ca2406 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,17 @@ node_modules/ __pycache__/ *.pyc *.pyo + + +# .NET Core build assets +tmp/dotnet/ +release/dotnet/ +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]eleases/ +x64/ +x86/ +build/ +bld/ +[Bb]in/ +[Oo]bj/ \ No newline at end of file diff --git a/ReadMe.md b/ReadMe.md index 56af35d..2c73e97 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -28,6 +28,7 @@ see: [100+ Working Service Examples](https://github.com/stackvana/microcule-exam - coffee-script - common lisp - bash + - dotnet (.NET Core) - lua - golang - ocaml diff --git a/bin/microcule b/bin/microcule index dfaf439..fd7a896 100755 --- a/bin/microcule +++ b/bin/microcule @@ -15,12 +15,12 @@ config.http.port = argv.p || argv.port || config.http.port; config.watch = argv.w || argv.watch || config.watch; config.stream = argv.s || argv.stream || config.stream; -// default to releasing compiled binaries to current working directory of `microcule` binary +// If no config, default to releasing compiled binaries to current working directory of `microcule` binary config.releaseDir = config.releaseDir || process.cwd(); if (typeof argv.v !== "undefined" || typeof argv.version !== "undefined") { - var pkg = require('../package.json') - console.log(pkg.version) + var pkg = require('../package.json'); + console.log(pkg.version); process.exit(); } @@ -48,6 +48,10 @@ var _service; try { _service = requireServiceSync({ path: servicePath }); + + //console.log('#### microcule: requireServiceSync() ######'); + //console.dir(_service); + } catch (err) { if (err.code === 'ENOENT') { // if we could not find the service, attempt to see if it's a globally available binary @@ -71,7 +75,7 @@ if (typeof argv.l !== "undefined" || typeof argv.language !== "undefined") { } if (stdin.isTTY) { - // console.log('ignoring will not run in TTY mode') + //console.log('ignoring will not run in TTY mode') // helps with peformance of STDIN tool http = require('resource-http'); startServer(_service); @@ -109,6 +113,7 @@ function startSTDIN (service) { mode: 'stream' }; + var Readable = require('stream').Readable; var Writable = require('stream').Writable; @@ -116,7 +121,7 @@ function startSTDIN (service) { var output = Writable(); output._write = function (chunk, enc, next) { - // console.log('wirtint out',chunk.toString()); + console.log('wirtint out',chunk.toString()); process.stdout.write(chunk); next(); }; @@ -145,6 +150,7 @@ function startSTDIN (service) { bin: service.bin, argv: service.argv, code: service.code, + originalCodeFilePath: service.originalCodeFilePath, schema: service.schema, view: service.view, presenter: service.presenter, @@ -153,7 +159,7 @@ function startSTDIN (service) { config: config, log: console.log })(stdin, output, function(){ - // console.log("COMPLETED STREAMING SERVICE") + console.log("COMPLETED STREAMING SERVICE") }); } else { var result = ''; @@ -164,11 +170,12 @@ function startSTDIN (service) { STDIN: result } }; - // console.log('spawning service'.yellow) + console.log('spawning service'.yellow) microcule.plugins.spawn({ bin: service.bin, argv: service.argv, code: service.code, + originalCodeFilePath: service.originalCodeFilePath, schema: service.schema, view: service.view, presenter: service.presenter, @@ -208,7 +215,7 @@ function startServer (_service) { console.log('using presenter for service') } - console.log(_service.language + ' microcule started at: http://' + addr.address + ":" + addr.port); + console.log(_service.language + ' microcule started at: http://'.blue + addr.address + ":" + addr.port); // Remark: Will automatically map the process.env `microcule` was spawned in to the service.env of the spawned function config.env = process.env; @@ -233,9 +240,11 @@ function startServer (_service) { spawnService(__service); }); */ + console.log('1'.red); spawnService(requireServiceSync({ path: servicePath })); } else { - spawnService(_service) + console.log('2'.red); + spawnService(_service); } function spawnService (service) { @@ -248,10 +257,12 @@ function startServer (_service) { if (err) { return next(err); } + console.log('3'.red); microcule.plugins.spawn({ bin: service.bin, argv: service.argv, code: service.code, + originalCodeFilePath: service.originalCodeFilePath, schema: service.schema, view: service.view, presenter: service.presenter, @@ -266,10 +277,12 @@ function startServer (_service) { }); }); } else { + console.log('4'.red); microcule.plugins.spawn({ bin: service.bin, argv: service.argv, code: service.code, + originalCodeFilePath: service.originalCodeFilePath, schema: service.schema, view: service.view, presenter: service.presenter, diff --git a/config/index.js b/config/index.js index 8684793..71cb614 100644 --- a/config/index.js +++ b/config/index.js @@ -10,10 +10,12 @@ module.exports = { ca: [fs.readFileSync(__dirname + '/ssl/ca-crt.pem').toString()], sslRequired: true, // redirects all http traffic to https, optional onlySSL: false // will only start https server with no unprotected http interface, optional + }, SERVICE_MAX_TIMEOUT: 10000, messages: { childProcessSpawnError: require('./messages/childProcessSpawnError'), serviceExecutionTimeout: require('./messages/serviceExecutionTimeout') - } + }, + releaseDir: process.cwd() + '/release' }; \ No newline at end of file diff --git a/examples/express-compiled-languages.js b/examples/express-compiled-languages.js index a62bbcf..a21c27e 100644 --- a/examples/express-compiled-languages.js +++ b/examples/express-compiled-languages.js @@ -10,7 +10,7 @@ var service = { var spawn = microcule.plugins.spawn(service); app.use(function(req, res, next){ - console.log('attempting to spawn', service) + console.log('[express-compiled-languages.js] attempting to spawn ', service) spawn(req, res, next); }); diff --git a/examples/services/hello-world/dotnet-hello/Program.cs b/examples/services/hello-world/dotnet-hello/Program.cs new file mode 100755 index 0000000..65ce358 --- /dev/null +++ b/examples/services/hello-world/dotnet-hello/Program.cs @@ -0,0 +1,18 @@ +using System; + +namespace dotnet_hello +{ + class Program + { + static void Main(string[] args) + { + Console.WriteLine("Hello World from .NET Core!!!"); + + foreach (var arg in args) + { + Console.WriteLine("param: {0}", arg); + } + + } + } +} diff --git a/examples/services/hello-world/dotnet-hello/dotnet-hello.csproj b/examples/services/hello-world/dotnet-hello/dotnet-hello.csproj new file mode 100755 index 0000000..97a38c1 --- /dev/null +++ b/examples/services/hello-world/dotnet-hello/dotnet-hello.csproj @@ -0,0 +1,7 @@ + + + + Exe + netcoreapp1.1 + + diff --git a/lib/plugins/compile/compileServiceCode/dotnet/index.js b/lib/plugins/compile/compileServiceCode/dotnet/index.js new file mode 100644 index 0000000..37e23ed --- /dev/null +++ b/lib/plugins/compile/compileServiceCode/dotnet/index.js @@ -0,0 +1,155 @@ +var fs = require('fs'); +var spawn = require('child_process').spawn; +var crypto = require('crypto'); +var path = require('path'); +var ncp = require('ncp').ncp; +var shasum = require('shasum'); +var path = require('path'); + +module.exports = function (req, res, cb) { +console.log('compileServiceCode.dotnet(). just executed'.yellow); + var service = req.service; + + // TODO: override hash logic here to include the csproj contents. + // by default handled in compile/index.js and only used the code file + var hash = service.sha1; + + console.log('inside compileServiceCode.dotnet()'.yellow) + console.dir(service); + /* + Supported Target: .NET Core 1.1 + .NET Core 2.0 (untested) + Uasge: + - Standard .NET Core console app created via `dotnet new console -n ` + - To execute run `microcule .//Program.cs` + */ + + //console.log('buildDir: ' + service.buildDir); + //console.log('releaseDir: ' + service.releaseDir); + + + // release is explicityly defaulted to the root of the microcule binary. Not sure why given there is a release folder. + // This may will break if the releaseDir default is overriden in config + //service.releaseDir = service.releaseDir + '/release'; + + + // first, we need to write the file to a temporary location on the disk + // it could be possible to bypass writing to the disk entirely here, but it will be easier to debug user-scripts, + // and also interact with various compilers without having to look up special use cases for stdin / argv code parsing + + + //console.dir(service, { depth: null, colors: true }); + + var tmpBuildDir = service.buildDir + '/dotnet/' + hash; + var buildOutputDir = service.releaseDir + '/dotnet/' + hash; + //service.sourceCodeFilePath = '/Users/janaka.abeywardhana/code-projects/microcule/examples/services/hello-world/dotnet-hello/Program.cs'; + //console.log('codefilepath = '.yellow, service.originalCodeFilePath); + + + + // Create the folders we need. Because put code in a folders based on the hash we need to create folders it code changes. + // Logic for deciding if we needed re-build is in the shared complile logic. + if (!fs.existsSync(buildOutputDir)) { + fs.mkdirSync(buildOutputDir); + if (!fs.existsSync(tmpBuildDir)) { + fs.mkdirSync(tmpBuildDir); + } + } + + + console.log('Copy from ', service.originalSourceCodeDir, ' to ', tmpBuildDir); + + + ncp.limit = 5; // concurrent copies + + ncp(service.originalSourceCodeDir, tmpBuildDir, function (err) { + + if (err) { + return cb(err); + } + console.log('Successfully copied code to temp build dir'); + console.log('starting dependency restore', 'dotnet restore'); + + var restore = spawn('dotnet', ['restore'], { + cwd: tmpBuildDir // ensure binary compiles to target directory + }); + + var stderr = '', stdout = ''; + + restore.on('error', function (data) { + console.log('error', data); + cb(data); + }); + + + restore.on('exit', function (data) { + console.log('exit', data); + + console.log('starting compiler dotnet', 'dotnet build -c release -v minimal -o ', buildOutputDir); + + // command syntax: dotnet build -f 1.1 -c release -o -v minimal + var compiler = spawn('dotnet', ['build', '-c', 'release', '-v','minimal', '-o', buildOutputDir], { + cwd: tmpBuildDir // ensure binary compiles to target directory + }); + + var stderr = '', stdout = ''; + + compiler.on('error', function (data) { + console.log('error', data) + cb(data); + }); + + /* + vm.stdin.error + vm.exit + vm.stdout.end + vm.stderr + */ + + compiler.on('data', function (data) { + console.log('got data', data) + }); + + compiler.on('close', function (data) { + console.log('close', data) + //cb(null, 'close') + }); + + compiler.stdin.on('error', function (data) { + console.log('stdin.error', data); + // cb(null, 'close') + }); + + compiler.stdout.on('data', function (data) { + console.log('stdout', data); + stdout += data.toString(); + //cb(null, 'close') + }); + + compiler.stderr.on('data', function (data) { + // console.log('stderr', data); + stderr += data.toString(); + //cb(null, 'close') + }); + + compiler.on('exit', function (data) { + console.log('exit', data); + var result = { + tmpSourceFile: tmpBuildDir, + bin: buildOutputDir, + buildDir: tmpBuildDir, + originalCodeFilePath: service.originalCodeFilePath, + dotnetCsproj: service.dotnetCsproj, + stderr: stderr, + stdout: stdout, + exitCode: data + }; + cb(null, result); + }); + + }); + }); + + + +}; \ No newline at end of file diff --git a/lib/plugins/compile/compileServiceMappings.js b/lib/plugins/compile/compileServiceMappings.js index d0c5b6b..fd58521 100644 --- a/lib/plugins/compile/compileServiceMappings.js +++ b/lib/plugins/compile/compileServiceMappings.js @@ -3,5 +3,7 @@ module.exports = { "gcc": require('./compileServiceCode/gcc'), "go": require('./compileServiceCode/golang'), "rust": require('./compileServiceCode/rust'), - "r": require('./compileServiceCode/r') + "r": require('./compileServiceCode/r'), + "dotnet": require('./compileServiceCode/dotnet') + }; \ No newline at end of file diff --git a/lib/plugins/compile/index.js b/lib/plugins/compile/index.js index 4952010..b90568e 100644 --- a/lib/plugins/compile/index.js +++ b/lib/plugins/compile/index.js @@ -14,7 +14,6 @@ module.exports = function compile (config) { // if no releaseDir is specified, will default to ./microcule/release directory config.releaseDir = config.releaseDir || path.resolve(__dirname + '/../../../release'); - console.log('using compile config', config) config.errorHandler = config.errorHandler || function (err, next) { if (err.message === "Bad credentials") { @@ -49,28 +48,69 @@ module.exports = function compile (config) { throw new Error('invalid language choice: ' + _service.language); } - // create shasum1 of service source code contents - var sha = shasum(_service.code); + + var sha = ''; + if (_service.language === 'dotnet') { + // we want to checksum the code file and the project file to detect changes. + _service.originalCodeFilePath = config.service.originalCodeFilePath; + _service.originalSourceCodeDir = path.dirname(_service.originalCodeFilePath); + + fs.readdirSync(_service.originalSourceCodeDir).forEach(function(fileName){ + //console.log(fileName); + var ext = path.extname(fileName); + //console.log(ext); + if (ext === '.csproj'){ + _service.dotnetCsproj = fileName; + } + }); + if (!_service.dotnetCsproj) { + // TODO: throw an error here + console.log('error: *.csproj file not found in dir ', _service.originalSourceCodeDir); + } + + var csprojFilePath = _service.originalSourceCodeDir + "/" + _service.dotnetCsproj; + //console.log(csprojFilePath); + var csprojCode = fs.readFileSync(path.resolve(csprojFilePath).toString()); + sha = shasum(_service.code + csprojCode); + } + else { + // Default: create shasum1 of service source code contents + shasum(_service.code); + } + _service.sha1 = sha; - console.log('what is sha1', sha); + console.log('sha1: ', sha); + //console.log('##### shaum() #####'); + //console.dir(config); + return function compileMiddleware (req, res, next) { req.service = _service; - - // check if binary of same sha1 already exists ( has been previously compiled ) - // if compiled service already exists, simply continue with spawn and defined binary path - + var binLocation = _service.releaseDir + '/' + sha; + var tmpBuidDir = _service.buildDir + '/' + sha; + + // ### Langugae specific compile meta data overrides ### // java requires a fixed class name, so we must create a unique directory instead if (_service.language === 'java') { binLocation = _service.buildDir + '/' + sha + '/' + 'hook.class'; } + + if (_service.language === 'dotnet') { + binLocation = _service.releaseDir + '/dotnet/' + sha; + tmpBuildDir = _service.buildDir + '/dotnet/' + sha; + } + + // ### check if binary of same sha1 already exists ( has been previously compiled ) ### + // if compiled service already exists, simply continue with spawn and defined binary path + + // TODO: check that sha matches as well as language? potential issue here with same content files, but diffirent target languages // we will assume that if the binary file exists, it has completed it's build step and is ready to be run fs.stat(binLocation, function (err, _stat) { - console.log('back from stat', err, _stat); + console.log('back from stat! Result: ', err, _stat); if (err) { // could not find the file, attempt to compile it console.log('could not find file, so lets compile it'.red); @@ -85,6 +125,7 @@ module.exports = function compile (config) { if (err) { return res.end(err.message); } + if (result === 0) { // TODO: null result means no build status, create a new build status provider.set('/builds/' + sha, { status: 'building' }, function (err, result){ @@ -112,19 +153,27 @@ module.exports = function compile (config) { } else { // we find the file, attempt to execute it // if the stat returned ( a file ) then use that path instead of compiling a new one - console.log('using compiled version of service', binLocation); + console.log('using compiled version of code in ', binLocation); + + var result = { bin: binLocation, - buildDir: _service.buildDir + '/' + sha, + buildDir: tmpBuildDir, + tmpSourceFile: tmpBuildDir, sha1: sha, compiledFresh: false, foundCompiledCache: true, stderr: '', stdout: '' }; + + if (_service.language === 'dotnet') { + result.dotnetCsproj = _service.dotnetCsproj; + } + next(null, result); } }); - } -} \ No newline at end of file + }; +}; \ No newline at end of file diff --git a/lib/plugins/spawn/generateCommandLineArguments/dotnet/index.js b/lib/plugins/spawn/generateCommandLineArguments/dotnet/index.js new file mode 100644 index 0000000..3c1dfa6 --- /dev/null +++ b/lib/plugins/spawn/generateCommandLineArguments/dotnet/index.js @@ -0,0 +1,23 @@ +/* +This args array returned from here is used as paramters when spawning `dotnet run` +Just pass service and env back along with the `-p` dotnet run parameter. +For dotnet we don't want to pass the code as a string, that's for lame lanuages ;) + +Other languages been implemented such that the JSON is flattened here and passed as individual params. +That's a waste of time. We can use a JSON parser in the. + +May be there's a case for pulling out some key paramas here suchs as the querystring params collection. +*/ +module['exports'] = function generategccArguments(service, env) { + + var dotnetArgv = []; + + dotnetArgv = [ + 'run', + '-p', service.buildDir, + '--s', JSON.stringify(service), // important: two dashes `--` for params that are passed into the app. + '--e', JSON.stringify(env), + ]; + + return dotnetArgv; +} \ No newline at end of file diff --git a/lib/plugins/spawn/index.js b/lib/plugins/spawn/index.js index 052e6e2..6bc8ac8 100644 --- a/lib/plugins/spawn/index.js +++ b/lib/plugins/spawn/index.js @@ -18,6 +18,7 @@ var generateArguments = { go: require('./generateCommandLineArguments/golang'), bash: require('./generateCommandLineArguments/bash'), clisp: require('./generateCommandLineArguments/clisp'), + dotnet: require('./generateCommandLineArguments/dotnet'), lua: require('./generateCommandLineArguments/lua'), ocaml: require('./generateCommandLineArguments/ocaml'), perl: require('./generateCommandLineArguments/perl'), @@ -47,6 +48,8 @@ module['exports'] = function spawnService (service) { // so we want to make sure it only has properties that will seralize well / should be available to microservice scope var _service = {}; + _service.originalCodeFilePath = service.originalCodeFilePath; + // if a binary path has been passed in, assume we are spawning an already compiled application // since the application is already compiled, we don't need to know it's language or source code @@ -81,6 +84,9 @@ module['exports'] = function spawnService (service) { // probably not a good idea to attempt to confifigure compile plugin inside of spawnServiceMiddleware() handler var _compile; if (typeof compileService[_service.language] === "function") { + + //console.log('#### spawn._complile() ####'); + //console.log(_service); _compile = compile({ service: _service, releaseDir: config.releaseDir @@ -119,9 +125,10 @@ module['exports'] = function spawnService (service) { service.presenter = service.presenterSource || service.presenter; // if targetLanguage is a compiled / static langauge, we must first compile the source code - // console.log(_service, compileService) + //console.log( compileService) if (typeof compileService[_service.language] === "function") { - // console.log('found compiled service!', _service); + console.log('found compile service for '.yellow, _service.language); + _compile(input, output, function (err, _build) { // [x] service.bin // service.argv @@ -139,7 +146,9 @@ module['exports'] = function spawnService (service) { // instead of attempting to spawn the service, we need to pipe the error back to the client return output.json(_build); } - // console.log('attempting to spawn', service); + console.log('Compiler result: '.yellow); + //console.log('### spawnServiceMiddleware._compile() ###') + console.dir(_build); _service.bin = _build.bin; // Remark: Java is an edge case now, as its both compiled than interpreted if (_service.language === 'java') { @@ -154,6 +163,12 @@ module['exports'] = function spawnService (service) { _service.argv = [_build.tmpSourceFile]; //_service.cwd = '/Users/a/dev/stackvana/microcule/tmp/'; } + + if (_service.language === 'dotnet'){ + _service.bin = 'dotnet'; + _service.buildDir = _build.buildDir + '/' + _build.dotnetCsproj; //needed in commandlineArgs generator + _service.cwd = _build.bin; + } _spawnService(input, output); }); } else { @@ -162,7 +177,7 @@ module['exports'] = function spawnService (service) { function _spawnService (input, output) { - // console.log('running spawn service'.blue, input.url) + //console.log('running spawn service'.blue, input.url) // use passed in config if its defined, if not will default to ./config folder if (typeof service.config === "object") { config = service.config; @@ -201,6 +216,7 @@ module['exports'] = function spawnService (service) { // if so, we must compile / check the caching options for the compiled service code if (typeof transpileService[targetLanguage] === "function") { // service.code = service.code || ""; + var md5 = checksum(_service.code); if (typeof transpileCache[md5] === "undefined") { @@ -312,11 +328,11 @@ module['exports'] = function spawnService (service) { var vm; var binaries = { + "babel": "micro-node", "bash": "micro-bash", "clisp": "micro-clisp", "coffee-script": "micro-node", "coffee": "micro-node", - "babel": "micro-node", "es7": "micro-node", // legacy name, renamed to "babel" "lua": "micro-lua", "javascript": "micro-node", @@ -375,7 +391,8 @@ module['exports'] = function spawnService (service) { preprocessCommandLineArguments(); // process.cwd(), - // console.log('spawning', targetBinary, 'in', _service.cwd, 'with', binaryArgs) + //console.log('spawning'.red, targetBinary, 'in', _service.cwd, 'with', binaryArgs); + //console.log(targetBinary, binaryArgs); vm = spawn(targetBinary, binaryArgs, { stdio: ['pipe', 'pipe', 'pipe', 'pipe'], cwd: _service.cwd }); /* @@ -388,6 +405,9 @@ module['exports'] = function spawnService (service) { // see: https://github.com/mhart/epipebomb/blob/master/epipebomb.js // see: https://github.com/nodejs/node/issues/947 // see: https://github.com/nodejs/node/pull/9470 + + /Users/janaka.abeywardhana/code-projects/microcule/tmp/dotnet/a07f72f1aadf192732b74e3814ee40d4b05fd693/dotnet-hello.csproj + /Users/janaka.abeywardhana/code-projects/microcule/tmp/dotnet/a07f72f1aadf192732b74e3814ee40d4b05fd693/dotnet-hello.csprj } // if not specific EPIPE issue, log the error console.log(err.message); @@ -482,7 +502,8 @@ module['exports'] = function spawnService (service) { vm.stdout.on('end', function (data) { status.stdoutEnded = true; status.pipe3ended = true; - // console.log('vm.stdout.end', status); + //console.log(data); + //console.log('vm.stdout.end', status); if (!status.checkingRegistry && !status.ended && !status.erroring) { //status.ended = true; // Remark: The vm's STDOUT has ended ( spawned service has completed ), @@ -500,20 +521,20 @@ module['exports'] = function spawnService (service) { if (vm.stdin) { - /* - input.on('end', function(){ - if (!status.pipe3ended) { - pipe3.write(Buffer('input.end')); - pipe3.write(Buffer('\n')); - } - }); - - input.on('close', function(){ - if (!status.pipe3ended) { - pipe3.write(Buffer('input.close')); - pipe3.write(Buffer('\n')); - } - }); + + // input.on('end', function(){ + // if (!status.pipe3ended) { + // pipe3.write(Buffer('input.end')); + // pipe3.write(Buffer('\n')); + // } + // }); + + // input.on('close', function(){ + // if (!status.pipe3ended) { + // pipe3.write(Buffer('input.close')); + // pipe3.write(Buffer('\n')); + // } + // }); vm.stdin.on('end', function (data) { input.emit('end') @@ -522,11 +543,11 @@ module['exports'] = function spawnService (service) { vm.stdin.on('close', function (data) { input.emit('close') }); - */ + vm.stdin.on('error', function (data) { status.stdinError = true; - // console.log('vm.stdin.error', status, data); + console.log('vm.stdin.error', status, data); // do nothing with this error? // without this error handler, `run-remote-service` will experience an uncaught stream error, // this is bad, because we lose the error stack with the uncaught stream error @@ -588,12 +609,15 @@ module['exports'] = function spawnService (service) { // The service has ended but the VM end event may not have fired, we should attempt to end response endResponse(); } + }); if (vm.stdin) { input.pipe(vm.stdin); } + + } } diff --git a/lib/requireServiceSync.js b/lib/requireServiceSync.js index 3091283..a388cb5 100644 --- a/lib/requireServiceSync.js +++ b/lib/requireServiceSync.js @@ -7,7 +7,11 @@ function extToLang (ext) { return lang; } -// same as requireService, only with sync interface ( useful for requiring services as packages ) +// +// Desciption: This hydrates the `service` object. Same as requireService, only with sync interface ( useful for requiring services as packages ) +// Params: +// opts: object {path: string} fully qualified path to code being executed. Folder or file including ext. +// module['exports'] = function requireServiceSync (opts) { var service = {}; @@ -36,10 +40,11 @@ module['exports'] = function requireServiceSync (opts) { }; function loadService (p, type) { - +//console.log('in loadService()') var service = { name: p, - owner: "examples" + owner: "examples", + originalCodeFilePath: p }; var _service = { @@ -86,6 +91,7 @@ function loadService (p, type) { var extentions = { ".c": "gcc", ".coffee": "coffee-script", + ".cs": "dotnet", ".go": "go", ".java": "java", ".js": "javascript", @@ -140,5 +146,8 @@ function loadService (p, type) { } catch (err) { // console.log(err); } + + //console.log('##### inside requireServiceSync() ####'); + //console.dir(service); return service; } \ No newline at end of file diff --git a/package.json b/package.json index be9e886..ee6faf1 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,8 @@ "stream-buffers": "^3.0.1", "through2": "^2.0.1", "tree-kill": "^1.1.0", - "view": "1.0.0" + "view": "1.0.0", + "ncp":"^2.0.0" }, "devDependencies": { "basic-auth": "^1.1.0",