Fix SignalR TS client build on macOS (#9230)

This commit is contained in:
Stephen Halter 2019-04-13 01:14:57 -07:00 коммит произвёл GitHub
Родитель e04c79bd3d
Коммит 28970a3e93
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
10 изменённых файлов: 1192 добавлений и 453 удалений

Просмотреть файл

@ -5,8 +5,8 @@
"description": "",
"main": "index.js",
"dependencies": {
"@aspnet/signalr": "link:../signalr",
"@aspnet/signalr-protocol-msgpack": "link:../signalr-protocol-msgpack",
"@aspnet/signalr": "file:../signalr",
"@aspnet/signalr-protocol-msgpack": "file:../signalr-protocol-msgpack",
"msgpack5": "^4.0.2"
},
"devDependencies": {
@ -32,22 +32,23 @@
"karma-summary-reporter": "^1.5.0",
"rxjs": "^6.3.3",
"ts-node": "^4.1.0",
"typescript": "^3.0.1",
"typescript": "^2.7.1",
"ws": " ^6.0.0"
},
"scripts": {
"preclean": "cd .. && npm run build",
"clean": "node ../common/node_modules/rimraf/bin.js ./wwwroot/dist ./obj/js",
"build": "npm run clean && npm run build:lint && npm run build:webpack",
"prebuild": "npm run clean && npm install",
"build": "npm run build:lint && npm run build:webpack",
"build:lint": "node ../common/node_modules/tslint/bin/tslint -c ../tslint.json -p ./tsconfig.json",
"build:webpack": "node ../common/node_modules/webpack-cli/bin/cli.js",
"build:parent": "cd .. && npm run build",
"pretest": "npm run build:parent && npm run build && dotnet build --no-restore FunctionalTests.csproj",
"pretest": "npm run build && dotnet build FunctionalTests.csproj",
"test": "tsc --noEmit && npm run test:local --",
"test:inner": "npm run build && dotnet build FunctionalTests.csproj && npm run test:local --",
"test:local": "ts-node --project ./scripts/tsconfig.json ./scripts/run-tests.ts",
"test:local": "npm run pretest && ts-node --project ./scripts/tsconfig.json ./scripts/run-tests.ts",
"test:all": "npm run pretest && ts-node --project ./scripts/tsconfig.json ./scripts/run-tests.ts --all-browsers",
"test:sauce": "ts-node --project ./scripts/tsconfig.json ./scripts/run-tests.ts --sauce",
"sauce": "npm run pretest && npm run test:sauce"
"test:sauce": "npm run pretest && ts-node --project ./scripts/tsconfig.json ./scripts/run-tests.ts --sauce",
"sauce": "npm run test:sauce"
},
"author": "",
"license": "Apache-2.0"

Просмотреть файл

@ -50,7 +50,7 @@ function getConnectionBuilder(transportType?: HttpTransportType, url?: string, o
describe("hubConnection", () => {
eachTransportAndProtocol((transportType, protocol) => {
describe("using " + protocol.name + " over " + HttpTransportType[transportType] + " transport", async () => {
describe("using " + protocol.name + " over " + HttpTransportType[transportType] + " transport", () => {
it("can invoke server method and receive result", (done) => {
const message = "你好,世界!";

Просмотреть файл

@ -2,13 +2,17 @@
# yarn lockfile v1
"@aspnet/signalr-protocol-msgpack@link:../signalr-protocol-msgpack":
version "0.0.0"
uid ""
"@aspnet/signalr-protocol-msgpack@file:../signalr-protocol-msgpack":
version "3.0.0-preview4-t000"
dependencies:
msgpack5 "^4.0.2"
"@aspnet/signalr@link:../signalr":
version "0.0.0"
uid ""
"@aspnet/signalr@file:../signalr":
version "3.0.0-preview4-t000"
dependencies:
eventsource "^1.0.7"
request "^2.88.0"
ws "^6.0.0"
"@types/bluebird@*":
version "3.5.23"
@ -2672,10 +2676,10 @@ type-is@~1.6.16:
media-typer "0.3.0"
mime-types "~2.1.18"
typescript@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.0.1.tgz#43738f29585d3a87575520a4b93ab6026ef11fdb"
integrity sha512-zQIMOmC+372pC/CCVLqnQ0zSBiY7HHodU7mpQdjiZddek4GMj31I3dUJ7gAs9o65X7mnRma6OokOkc6f9jjfBg==
typescript@^2.7.1:
version "2.9.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.9.2.tgz#1cbf61d05d6b96269244eb6a3bce4bd914e0f00c"
integrity sha512-Gr4p6nFNaoufRIY4NMdpQRNmgxVIGMs4Fcu/ujdYk3nAZqk7supzBE9idmvfZIlH/Cuj//dvi+019qEue9lV0w==
ultron@~1.1.0:
version "1.1.1"

Просмотреть файл

@ -13,7 +13,7 @@
"@types/jest": "^23.3.2",
"@types/node": "^8.5.2",
"@types/webpack": "^4.4.0",
"jest": "^23.6.0",
"jest": "^24.1.0",
"jest-junit": "^5.1.0",
"rimraf": "^2.6.2",
"ts-jest": "^22.4.6",

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -11,15 +11,17 @@
"test": "spec"
},
"scripts": {
"preclean": "cd ../common && npm install",
"clean": "node ../common/node_modules/rimraf/bin.js ./dist",
"build": "npm run clean && npm run build:lint && npm run build:esm && npm run build:cjs && npm run build:browser && npm run build:uglify",
"prebuild": "npm run clean && npm install",
"build": "npm run build:lint && npm run build:esm && npm run build:cjs && npm run build:browser && npm run build:uglify",
"build:lint": "node ../common/node_modules/tslint/bin/tslint -c ../tslint.json -p ./tsconfig.json",
"build:esm": "node ../common/node_modules/typescript/bin/tsc --project ./tsconfig.json --module es2015 --outDir ./dist/esm -d",
"build:cjs": "node ../common/node_modules/typescript/bin/tsc --project ./tsconfig.json --module commonjs --outDir ./dist/cjs",
"build:browser": "node ../common/node_modules/webpack-cli/bin/cli.js",
"build:uglify": "node ../common/node_modules/uglify-js/bin/uglifyjs --source-map \"url='signalr-protocol-msgpack.min.js.map',content='./dist/browser/signalr-protocol-msgpack.js.map'\" --comments -o ./dist/browser/signalr-protocol-msgpack.min.js ./dist/browser/signalr-protocol-msgpack.js",
"prepack": "node ../build/embed-version.js",
"test": "echo \"Run 'npm test' in the 'clients\\ts' folder to test this package\" && exit 1"
"test": "echo \"Run 'npm test' in the 'clients/ts' folder to test this package\" && exit 1"
},
"keywords": [
"signalr",
@ -27,14 +29,14 @@
],
"repository": {
"type": "git",
"url": "git+https://github.com/aspnet/SignalR.git"
"url": "git+https://github.com/aspnet/AspNetCore.git"
},
"author": "Microsoft",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/aspnet/SignalR/issues"
"url": "https://github.com/aspnet/AspNetCore/issues"
},
"homepage": "https://github.com/aspnet/SignalR#readme",
"homepage": "https://github.com/aspnet/AspNetCore/tree/master/src/SignalR#readme",
"files": [
"dist/**/*",
"src/**/*"

Просмотреть файл

@ -11,8 +11,10 @@
"test": "spec"
},
"scripts": {
"preclean": "cd ../common && npm install",
"clean": "node ../common/node_modules/rimraf/bin.js ./dist",
"build": "npm run clean && npm run build:lint && npm run build:esm && npm run build:cjs && npm run build:browser && npm run build:webworker && npm run build:uglify",
"prebuild": "npm run clean && npm install",
"build": "npm run build:lint && npm run build:esm && npm run build:cjs && npm run build:browser && npm run build:webworker && npm run build:uglify",
"build:lint": "node ../common/node_modules/tslint/bin/tslint -c ../tslint.json -p ./tsconfig.json",
"build:esm": "node ../common/node_modules/typescript/bin/tsc --project ./tsconfig.json --module es2015 --outDir ./dist/esm -d && node ./build/process-dts.js",
"build:cjs": "node ../common/node_modules/typescript/bin/tsc --project ./tsconfig.json --module commonjs --outDir ./dist/cjs",
@ -22,8 +24,12 @@
"build:uglify:browser": "node ../common/node_modules/uglify-js/bin/uglifyjs --source-map \"url='signalr.min.js.map',content='./dist/browser/signalr.js.map'\" --comments -o ./dist/browser/signalr.min.js ./dist/browser/signalr.js",
"build:uglify:webworker": "node ../common/node_modules/uglify-js/bin/uglifyjs --source-map \"url='signalr.min.js.map',content='./dist/webworker/signalr.js.map'\" --comments -o ./dist/webworker/signalr.min.js ./dist/webworker/signalr.js",
"prepack": "node ../build/embed-version.js",
"test": "echo \"Run 'npm test' in the 'clients\\ts' folder to test this package\" && exit 1"
"test": "echo \"Run 'npm test' in the 'clients/ts' folder to test this package\" && exit 1"
},
"keywords": [
"signalr",
"aspnetcore"
],
"repository": {
"type": "git",
"url": "git+https://github.com/aspnet/AspNetCore.git"

Просмотреть файл

@ -187,7 +187,13 @@ export class HubConnection {
await handshakePromise;
// It's important to check the stopDuringStartError instead of just relying on the handshakePromise
// being rejected on close, because this continuation can run after both the handshake completed successfully
// and the connection was closed.
if (this.stopDuringStartError) {
// It's important to throw instead of returning a rejected promise, because we don't want to allow any state
// transitions to occur between now and the calling code observing the exceptions. Returning a rejected promise
// will cause the calling continuation to get scheduled to run later.
throw this.stopDuringStartError;
}
} catch (e) {

Просмотреть файл

@ -3,9 +3,7 @@
// Not exported from index
export interface EventSourceConstructor {
new(url: string, eventSourceInitDict?: EventSourceInit): EventSource;
}
export type EventSourceConstructor = new(url: string, eventSourceInitDict?: EventSourceInit) => EventSource;
export interface WebSocketConstructor {
new(url: string, protocols?: string | string[], options?: any): WebSocket;

Просмотреть файл

@ -14,6 +14,7 @@
"noUnusedParameters": true,
"suppressImplicitAnyIndexErrors": true,
"noEmitOnError": true,
"skipLibCheck": true,
"stripInternal": true,
"strict": true,
"lib": [ "es5", "es2015.promise", "es2015.iterable", "dom" ],