Creating npm package for ts client

This commit is contained in:
moozzyk 2017-02-14 08:47:17 -08:00
parent a0dae7cb0e
commit cc7f835e1d
8 changed files with 19 additions and 8 deletions

1
.gitignore vendored
View File

@ -40,3 +40,4 @@ site.min.css
.idea/
.vscode/
signalr-client/
dist/

2
.npmignore Normal file
View File

@ -0,0 +1,2 @@
*
!dist/**/*

View File

@ -1,8 +1,9 @@
{
"name": "signalr-core",
"version": "1.0.0",
"name": "signalr-client",
"version": "0.1.0-alpha",
"description": "ASP.NET Core SignalR",
"main": "index.js",
"main": "dist/src/index.js",
"typings": "dist/src/index.d.ts",
"directories": {
"test": "test"
},

View File

@ -22,7 +22,7 @@ gulp.task('browserify-client', ['compile-ts-client'], () => {
return browserify(clientOutDir + '/HubConnection.js', {standalone: 'signalR'})
.bundle()
.pipe(source('signalr-client.js'))
.pipe(gulp.dest(clientOutDir + '/../signalr-client-bundle'));
.pipe(gulp.dest(clientOutDir + '/../browser'));
});
gulp.task('build-ts-client', ['clean', 'compile-ts-client', 'browserify-client']);
@ -32,7 +32,7 @@ gulp.task('bundle-client', ['build-ts-client'], () => {
console.log('Use \'--bundleOutDir\' option to specify the target file for the bundled client.');
}
else {
return gulp.src(clientOutDir + '/../signalr-client-bundle/signalr-client.js')
return gulp.src(clientOutDir + '/../browser/signalr-client.js')
.pipe(gulp.dest(argv.bundleOutDir));
}
});

View File

@ -0,0 +1,6 @@
export * from "./Common"
export * from "./Connection"
export * from "./HttpClient"
export * from "./HubConnection"
export * from "./Transports"

View File

@ -9,7 +9,8 @@
"removeComments": false,
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true,
"outDir": "../../artifacts/lib/signalr-client-modules"
"outDir": "../../dist/src",
"declaration": true
},
"include": [
"./**/*",

View File

@ -1,5 +1,5 @@
{
"spec_dir": "artifacts/test/Microsoft.AspNetCore.Client.SignalR.TS.Tests",
"spec_dir": "dist/test",
"spec_files": [
"./**/*[sS]pec.js"
]

View File

@ -9,7 +9,7 @@
"removeComments": false,
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true,
"outDir": "../../artifacts/test/Microsoft.AspNetCore.Client.SignalR.TS.Tests/"
"outDir": "../../dist/test"
},
"include": [
"./**/*",