express-tsx
Advanced tools
Comparing version 4.0.1 to 4.0.2
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -55,3 +63,3 @@ const ts = require("typescript"); | ||
} | ||
this.compilerOptions = { ...this.compilerOptions, ...Compile.defaultCompilerOptions, ...compilerOptions, }; | ||
this.compilerOptions = Object.assign({}, this.compilerOptions, Compile.defaultCompilerOptions, compilerOptions); | ||
}; | ||
@@ -111,3 +119,3 @@ this.is_development = false; | ||
this.jsExpiredTime = 15 * 1 * 24 * 60 * 60; | ||
this.staticServer = async (req, res) => { | ||
this.staticServer = (req, res) => __awaiter(this, void 0, void 0, function* () { | ||
let url = Url.parse(req.url); | ||
@@ -142,3 +150,3 @@ let regx = Compile.regx; | ||
res.send(body); | ||
}; | ||
}); | ||
this.init(compilerOptions); | ||
@@ -145,0 +153,0 @@ this.is_development = is_development; |
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const requirejs = require("requirejs"); | ||
const preload_1 = require("./preload"); | ||
exports.browserInitPath = require.resolve('./browser.init'); | ||
exports.requirejsConfigPath = require.resolve('./requirejs.browser.config'); | ||
exports.html = async (file, data, view_data) => { | ||
const path = require("path"); | ||
exports.browserInitPath = path.join(__dirname, './browser.init.ts'); | ||
exports.requirejsConfigPath = path.join(__dirname, './requirejs.browser.config.ts'); | ||
exports.html = (file, data, view_data) => __awaiter(this, void 0, void 0, function* () { | ||
let compiler = data.res.app.compiler; | ||
@@ -47,3 +56,3 @@ compiler.getScriptVersion(file); //compile entry file | ||
`; | ||
}; | ||
}); | ||
//# sourceMappingURL=html.js.map |
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -17,15 +25,17 @@ const middleware_1 = require("./middleware"); | ||
*/ | ||
exports.render = async (file, data, next) => (async (file, data) => { | ||
let callback = data.callback; | ||
let view_data = new ViewData(data); | ||
if (typeof callback === 'string') { | ||
let json = JSON.stringify(view_data); | ||
if (!callback.length) { | ||
return json; | ||
exports.render = (file, data, next) => __awaiter(this, void 0, void 0, function* () { | ||
return ((file, data) => __awaiter(this, void 0, void 0, function* () { | ||
let callback = data.callback; | ||
let view_data = new ViewData(data); | ||
if (typeof callback === 'string') { | ||
let json = JSON.stringify(view_data); | ||
if (!callback.length) { | ||
return json; | ||
} | ||
return `${callback}(${json})`; | ||
} | ||
return `${callback}(${json})`; | ||
} | ||
file = typescript_1.sys.resolvePath(file); | ||
return _1.html(file, data, view_data); | ||
})(file, data).then((res) => next(null, res), (err) => next(err)); | ||
file = typescript_1.sys.resolvePath(file); | ||
return _1.html(file, data, view_data); | ||
}))(file, data).then((res) => next(null, res), (err) => next(err)); | ||
}); | ||
//# sourceMappingURL=render.js.map |
@@ -1,2 +0,2 @@ | ||
requirejs.config({ "waitSeconds": 7, "baseUrl": "/media/shynome/workspace/express-tsx/node_modules/mocha/bin/", "paths": { "react": "//cdn.bootcss.com/react/15.6.1/react.js#", "react-dom": "//cdn.bootcss.com/react/15.6.1/react-dom.js#", "requirejs": "//cdn.bootcss.com/require.js/2.3.3/require.min.js#", "css": "//cdn.bootcss.com/require-css/0.1.10/css.min.js#", "es5-shim": "//cdn.bootcss.com/es5-shim/4.5.9/es5-shim.min.js#", "es6-shim": "//cdn.bootcss.com/es6-shim/0.35.3/es6-shim.min.js" }, "bundles": {}, "pkgs": {}, "shim": { "react": { "deps": ["es6-shim", "es5-shim"] } }, "config": {}, "waitSecond": 30 }); | ||
requirejs.config({ "waitSeconds": 7, "baseUrl": "/media/shynome/workspace/sys/node/lib/node_modules/mocha/bin/", "paths": { "react": "//cdn.bootcss.com/react/15.6.1/react.js#", "react-dom": "//cdn.bootcss.com/react/15.6.1/react-dom.js#", "requirejs": "//cdn.bootcss.com/require.js/2.3.3/require.min.js#", "css": "//cdn.bootcss.com/require-css/0.1.10/css.min.js#", "es5-shim": "//cdn.bootcss.com/es5-shim/4.5.9/es5-shim.min.js#", "es6-shim": "//cdn.bootcss.com/es6-shim/0.35.3/es6-shim.min.js" }, "bundles": {}, "pkgs": {}, "shim": { "react": { "deps": ["es6-shim", "es5-shim"] } }, "config": {}, "waitSecond": 30 }); | ||
//# sourceMappingURL=requirejs.browser.config.js.map |
{ | ||
"name": "express-tsx", | ||
"version": "4.0.1", | ||
"version": "4.0.2", | ||
"description": "express view engine", | ||
@@ -28,3 +28,3 @@ "main": "dist/index.js", | ||
"scripts": { | ||
"test": "mocha test", | ||
"test": "mocha test/index", | ||
"build": "gulp build", | ||
@@ -31,0 +31,0 @@ "postbuild": "npm run test", |
import requirejs = require('requirejs') | ||
import { data,ViewData } from "./render"; | ||
import { preload } from './preload' | ||
export const browserInitPath = require.resolve('./browser.init') | ||
export const requirejsConfigPath = require.resolve('./requirejs.browser.config') | ||
import path = require('path') | ||
export const browserInitPath = path.join(__dirname,'./browser.init.ts') | ||
export const requirejsConfigPath = path.join(__dirname,'./requirejs.browser.config.ts') | ||
export let html = async(file:string,data:data,view_data:ViewData):Promise<string>=>{ | ||
@@ -7,0 +8,0 @@ let compiler = data.res.app.compiler |
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"target": "esnext", | ||
"target": "es6", | ||
"noImplicitAny": false, | ||
@@ -6,0 +6,0 @@ "sourceMap": true, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
49829
760
1