mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-22 17:47:53 +00:00
Update aspnet-prerendering to use TS 2.0 and @types
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
"description": "Helpers for server-side rendering of JavaScript applications in ASP.NET Core projects. Works in conjunction with the Microsoft.AspNetCore.SpaServices NuGet package.",
|
"description": "Helpers for server-side rendering of JavaScript applications in ASP.NET Core projects. Works in conjunction with the Microsoft.AspNetCore.SpaServices NuGet package.",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepublish": "rimraf *.d.ts && tsd update && tsc && echo 'Finished building NPM package \"aspnet-prerendering\"'",
|
"prepublish": "rimraf *.d.ts && tsc && echo 'Finished building NPM package \"aspnet-prerendering\"'",
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
},
|
},
|
||||||
"author": "Microsoft",
|
"author": "Microsoft",
|
||||||
@@ -21,6 +21,8 @@
|
|||||||
"es6-promise": "^3.1.2"
|
"es6-promise": "^3.1.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@types/node": "^6.0.42",
|
||||||
|
"@types/whatwg-fetch": "0.0.31",
|
||||||
"rimraf": "^2.5.4",
|
"rimraf": "^2.5.4",
|
||||||
"typescript": "^2.0.0"
|
"typescript": "^2.0.0"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ function findBootFunc(applicationBasePath: string, bootModule: BootModuleInfo, c
|
|||||||
|
|
||||||
function bindPromiseContinuationsToDomain(promise: Promise<any>, domainInstance: domain.Domain) {
|
function bindPromiseContinuationsToDomain(promise: Promise<any>, domainInstance: domain.Domain) {
|
||||||
const originalThen = promise.then;
|
const originalThen = promise.then;
|
||||||
promise.then = function then(resolve, reject) {
|
promise.then = (function then(resolve, reject) {
|
||||||
if (typeof resolve === 'function') {
|
if (typeof resolve === 'function') {
|
||||||
resolve = domainInstance.bind(resolve);
|
resolve = domainInstance.bind(resolve);
|
||||||
}
|
}
|
||||||
@@ -184,5 +184,5 @@ function bindPromiseContinuationsToDomain(promise: Promise<any>, domainInstance:
|
|||||||
}
|
}
|
||||||
|
|
||||||
return originalThen.call(this, resolve, reject);
|
return originalThen.call(this, resolve, reject);
|
||||||
};
|
}) as any;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,12 @@
|
|||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"target": "es5",
|
"target": "es5",
|
||||||
"declaration": true,
|
"declaration": true,
|
||||||
"outDir": "."
|
"outDir": ".",
|
||||||
|
"lib": ["es2015", "dom"]
|
||||||
},
|
},
|
||||||
|
"files": [
|
||||||
|
"src/index.ts"
|
||||||
|
],
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules"
|
"node_modules"
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
"version": "v4",
|
|
||||||
"repo": "borisyankov/DefinitelyTyped",
|
|
||||||
"ref": "master",
|
|
||||||
"path": "typings",
|
|
||||||
"bundle": "typings/tsd.d.ts",
|
|
||||||
"installed": {
|
|
||||||
"node/node.d.ts": {
|
|
||||||
"commit": "0144ad5a74053f2292424847259c4c8e1d0fecaa"
|
|
||||||
},
|
|
||||||
"es6-promise/es6-promise.d.ts": {
|
|
||||||
"commit": "0144ad5a74053f2292424847259c4c8e1d0fecaa"
|
|
||||||
},
|
|
||||||
"whatwg-fetch/whatwg-fetch.d.ts": {
|
|
||||||
"commit": "dade4414712ce84e3c63393f1aae407e9e7e6af7"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user