Comparing version 0.1.214 to 0.1.215
@@ -55,8 +55,9 @@ #!/usr/bin/env node | ||
devDependencies: { | ||
'grunt': '~0.4.1', | ||
'grunt': '1.0.1', | ||
'grunt-ts': '5.5.1', | ||
'grunt-file-append': '0.0.4', | ||
'grunt-text-replace': '~0.3.11', | ||
'time-grunt': '~0.1.1', | ||
'load-grunt-tasks': '~0.2.0', | ||
'grunt-cli': '1.2.0', | ||
'grunt-file-append': '0.0.6', | ||
'grunt-text-replace': '0.4.0', | ||
'time-grunt': '1.3.0', | ||
'load-grunt-tasks': '3.5.0', | ||
'grunt-contrib-concat': '1.0.1', | ||
@@ -91,3 +92,28 @@ 'grunt-contrib-clean': '1.0.0' | ||
}); | ||
// | ||
//$ raion generate:metadata | ||
cmd = program.command('generate:metadata'); | ||
cmd.unknownOption = NOOP; | ||
cmd.action(function () { | ||
var spawn = require('child_process').spawn; | ||
var node = process.platform == 'win32' ? 'node.exe' : 'node'; | ||
var filePath = path.join(__dirname, 'framework', 'bin', 'metadata.js'); | ||
if (fs.existsSync(filePath)) { | ||
return console.log('Error: Incorrect command path.'); | ||
} | ||
var app = spawn(node, ['framework/bin/metadata.js']); | ||
app.stdout.on('data', function (data) { | ||
util.print(data); | ||
}); | ||
app.stderr.on('data', function (data) { | ||
util.print(data); | ||
}); | ||
app.on('close', function (code) { | ||
util.print('child process exited with code ' + code); | ||
process.exit(); | ||
}); | ||
}); | ||
// // $ tfw start | ||
@@ -94,0 +120,0 @@ // cmd = program.command('start'); |
@@ -0,2 +1,11 @@ | ||
/// <reference path="../lib/express.d.ts" /> | ||
/// <reference path="../lib/node.d.ts" /> | ||
/// <reference path="../lib/lodash.d.ts" /> | ||
declare var fs: NodeJS.FS.FSStatic; | ||
declare var _: LoDash.LoDashStatic; | ||
declare var Path: NodeJS.Path; | ||
declare module Raion { | ||
@@ -12,2 +21,3 @@ interface IApplication { | ||
private express; | ||
private route; | ||
constructor(root: string); | ||
@@ -58,7 +68,2 @@ start(): void; | ||
declare var fs: NodeJS.FS.FSStatic; | ||
declare var _: LoDash.LoDashStatic; | ||
declare var Path: NodeJS.Path; | ||
declare module Raion { | ||
@@ -69,6 +74,3 @@ function trim(text: string, char: string): string; | ||
/// <reference path="../lib/express.d.ts" /> | ||
/// <reference path="../lib/lodash.d.ts" /> | ||
declare module Raion { | ||
@@ -122,2 +124,3 @@ interface IRoute { | ||
protected patterns: {}; | ||
constructor(); | ||
get(uri: string, action?: {} | Function | string): void; | ||
@@ -124,0 +127,0 @@ protected addRoute(methods: Array<string> | string, uri: string, action?: {} | Function | string): Route; |
@@ -0,1 +1,6 @@ | ||
var fs = require('fs'); | ||
var _ = require('lodash'); | ||
var Path = require('path'); | ||
var Raion; | ||
@@ -8,2 +13,3 @@ (function (Raion) { | ||
this.env = (new Raion.Env(root)).getInstance(); | ||
this.route = new Raion.Router(); | ||
} | ||
@@ -14,3 +20,3 @@ Application.prototype.start = function () { | ||
Application.prototype.router = function (callback) { | ||
callback.call(this.router); | ||
callback.call(this.route); | ||
}; | ||
@@ -141,6 +147,2 @@ Application.prototype.runExpress = function () { | ||
var fs = require('fs'); | ||
var _ = require('lodash'); | ||
var Path = require('path'); | ||
var Raion; | ||
@@ -160,3 +162,2 @@ (function (Raion) { | ||
var Raion; | ||
@@ -257,5 +258,9 @@ (function (Raion) { | ||
this.routes = null; | ||
this.groupStack = []; | ||
this.patterns = {}; | ||
this.routes = new Raion.RouteCollection(); | ||
} | ||
Router.prototype.get = function (uri, action) { | ||
if (action === void 0) { action = null; } | ||
this.addRoute(['GET', 'HEAD'], uri, action); | ||
}; | ||
@@ -262,0 +267,0 @@ Router.prototype.addRoute = function (methods, uri, action) { |
@@ -51,3 +51,3 @@ module.exports = function (grunt) { | ||
grunt.registerTask('default', [ 'ts:build', 'file_append:app' ]); | ||
grunt.registerTask('default', ['ts:build', 'concat:declaration', 'concat:js', 'file_append:raion', 'clean']); | ||
}; |
{ | ||
"name": "raion", | ||
"version": "0.1.214", | ||
"version": "0.1.215", | ||
"description": "Node JS MVC framework on typescript", | ||
@@ -30,8 +30,9 @@ "main": "index.js", | ||
"devDependencies": { | ||
"grunt": "~0.4.1", | ||
"grunt": "1.0.1", | ||
"grunt-ts": "5.5.1", | ||
"grunt-file-append": "0.0.4", | ||
"grunt-text-replace": "~0.3.11", | ||
"time-grunt": "~0.1.1", | ||
"load-grunt-tasks": "~0.2.0", | ||
"grunt-cli": "1.2.0", | ||
"grunt-file-append": "0.0.6", | ||
"grunt-text-replace": "0.4.0", | ||
"time-grunt": "1.3.0", | ||
"load-grunt-tasks": "3.5.0", | ||
"grunt-contrib-concat": "1.0.1", | ||
@@ -38,0 +39,0 @@ "grunt-contrib-clean": "1.0.0" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
395521
34
8946
9
3