Skip to content

Commit a25ec23

Browse files
author
Umed Khudoiberdiev
committed
updated dependencies, fixed issues with non global metadata storage
1 parent 9aa1e11 commit a25ec23

File tree

7 files changed

+44
-63
lines changed

7 files changed

+44
-63
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
build/
22
node_modules/
3-
typings/
43
coverage/
54
npm-debug.log

gulpfile.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

gulpfile.ts

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import "es6-shim";
21
import {Gulpclass, Task, SequenceTask, MergedTask} from "gulpclass";
32

43
const gulp = require("gulp");
@@ -36,7 +35,7 @@ export class Gulpfile {
3635
*/
3736
@Task()
3837
compile() {
39-
return gulp.src("*.js", { read: false })
38+
return gulp.src("package.json", { read: false })
4039
.pipe(shell(["tsc"]));
4140
}
4241

@@ -49,7 +48,7 @@ export class Gulpfile {
4948
*/
5049
@Task()
5150
npmPublish() {
52-
return gulp.src("*.js", { read: false })
51+
return gulp.src("package.json", { read: false })
5352
.pipe(shell([
5453
"cd ./build/package && npm publish"
5554
]));
@@ -61,9 +60,9 @@ export class Gulpfile {
6160
@MergedTask()
6261
packageCompile() {
6362
const tsProject = ts.createProject("tsconfig.json");
64-
const tsResult = gulp.src(["./src/**/*.ts", "./typings/**/*.ts"])
63+
const tsResult = gulp.src(["./src/**/*.ts"])
6564
.pipe(sourcemaps.init())
66-
.pipe(ts(tsProject));
65+
.pipe(tsProject());
6766

6867
return [
6968
tsResult.dts.pipe(gulp.dest("./build/package")),
@@ -113,15 +112,6 @@ export class Gulpfile {
113112
.pipe(gulp.dest("./build/package"));
114113
}
115114

116-
/**
117-
* This task will copy typings.json file to the build package.
118-
*/
119-
@Task()
120-
copyTypingsFile() {
121-
return gulp.src("./typings.json")
122-
.pipe(gulp.dest("./build/package"));
123-
}
124-
125115
/**
126116
* Creates a package that can be published to npm.
127117
*/
@@ -132,7 +122,7 @@ export class Gulpfile {
132122
"packageCompile",
133123
"packageMoveCompiledFiles",
134124
"packageClearCompileDirectory",
135-
["packagePreparePackageFile", "packageReadmeFile", "copyTypingsFile"]
125+
["packagePreparePackageFile", "packageReadmeFile"]
136126
];
137127
}
138128

@@ -167,7 +157,7 @@ export class Gulpfile {
167157
*/
168158
@Task()
169159
coveragePre() {
170-
return gulp.src(["./build/es5/src/**/*.js"])
160+
return gulp.src(["./build/compiled/src/**/*.js"])
171161
.pipe(istanbul())
172162
.pipe(istanbul.hookRequire());
173163
}
@@ -181,7 +171,7 @@ export class Gulpfile {
181171
chai.use(require("sinon-chai"));
182172
chai.use(require("chai-as-promised"));
183173

184-
return gulp.src(["./build/es5/test/functional/**/*.js"])
174+
return gulp.src(["./build/compiled/test/functional/**/*.js"])
185175
.pipe(mocha())
186176
.pipe(istanbul.writeReports());
187177
}

package.json

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "socket-controllers",
33
"private": true,
4-
"version": "0.0.2",
4+
"version": "0.0.3",
55
"description": "Use class-based controllers to handle websocket events",
66
"license": "MIT",
77
"readmeFilename": "README.md",
@@ -26,38 +26,41 @@
2626
"socket-controllers"
2727
],
2828
"dependencies": {
29-
"class-transformer": "^0.1.1",
30-
"reflect-metadata": "^0.1.8",
31-
"socket.io": "^1.4.8"
29+
"class-transformer": "^0.1.6",
30+
"reflect-metadata": "^0.1.10",
31+
"socket.io": "^2.0.1"
3232
},
3333
"devDependencies": {
34+
"@types/chai": "^3.5.2",
35+
"@types/mocha": "^2.2.41",
36+
"@types/node": "^7.0.18",
37+
"@types/sinon": "^2.2.1",
3438
"chai": "^3.4.1",
35-
"chai-as-promised": "^5.3.0",
36-
"chakram": "^1.4.0",
37-
"del": "^2.2.1",
38-
"es6-shim": "^0.35.1",
39-
"express": "^4.14.0",
39+
"chai-as-promised": "^6.0.0",
40+
"chakram": "^1.5.0",
41+
"del": "^2.2.2",
42+
"express": "^4.15.2",
4043
"gulp": "^3.9.1",
41-
"gulp-istanbul": "^1.0.0",
42-
"gulp-mocha": "^2.2.0",
44+
"gulp-istanbul": "^1.1.1",
45+
"gulp-mocha": "^4.3.1",
4346
"gulp-replace": "^0.5.4",
44-
"gulp-shell": "^0.5.0",
45-
"gulp-sourcemaps": "^1.6.0",
46-
"gulp-tslint": "^6.0.1",
47-
"gulp-typescript": "^2.13.6",
48-
"gulpclass": "^0.1.1",
49-
"mocha": "^3.0.0",
50-
"multer": "^1.1.0",
51-
"remap-istanbul": "^0.6.4",
52-
"request": "^2.74.0",
53-
"sinon": "^1.17.4",
54-
"sinon-chai": "^2.8.0",
55-
"socket.io-client": "^1.4.8",
56-
"tslint": "^3.13.0",
57-
"tslint-stylish": "^2.1.0-beta",
58-
"typedi": "^0.4.2",
59-
"typescript": "^1.8.10",
60-
"typings": "^1.3.1"
47+
"gulp-shell": "^0.6.3",
48+
"gulp-sourcemaps": "^2.6.0",
49+
"gulp-tslint": "^8.0.0",
50+
"gulp-typescript": "^3.1.6",
51+
"gulpclass": "^0.1.2",
52+
"mocha": "^3.3.0",
53+
"multer": "^1.3.0",
54+
"remap-istanbul": "^0.9.5",
55+
"request": "^2.81.0",
56+
"sinon": "^2.2.0",
57+
"sinon-chai": "^2.10.0",
58+
"socket.io-client": "^2.0.1",
59+
"ts-node": "^3.0.4",
60+
"tslint": "^5.2.0",
61+
"tslint-stylish": "^2.1.0",
62+
"typedi": "^0.5.2",
63+
"typescript": "^2.3.2"
6164
},
6265
"scripts": {
6366
"test": "gulp tests"

src/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import {MetadataArgsStorage} from "./metadata-builder/MetadataArgsStorage";
22
import {importClassesFromDirectories} from "./util/DirectoryExportedClassesLoader";
33
import {SocketControllerExecutor} from "./SocketControllerExecutor";
4-
import {getFromContainer} from "./container";
54
import {SocketControllersOptions} from "./SocketControllersOptions";
65

76
// -------------------------------------------------------------------------
@@ -56,7 +55,10 @@ function createExecutor(io: any, options: SocketControllersOptions): void {
5655
* Gets the metadata arguments storage.
5756
*/
5857
export function defaultMetadataArgsStorage(): MetadataArgsStorage {
59-
return getFromContainer(MetadataArgsStorage);
58+
if (!(global as any).socketControllersMetadataArgsStorage)
59+
(global as any).socketControllersMetadataArgsStorage = new MetadataArgsStorage();
60+
61+
return (global as any).socketControllersMetadataArgsStorage;
6062
}
6163

6264
// -------------------------------------------------------------------------

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"version": "1.8.0",
32
"compilerOptions": {
4-
"outDir": "build/es5",
3+
"outDir": "build/compiled",
54
"target": "es5",
65
"module": "commonjs",
76
"moduleResolution": "node",
7+
"lib": ["es6"],
88
"emitDecoratorMetadata": true,
99
"experimentalDecorators": true,
1010
"sourceMap": true,

typings.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)