diff --git a/openvidu-browser/src/main/resources/.gitignore b/openvidu-browser/src/main/resources/.gitignore index 5e760f68..16932162 100644 --- a/openvidu-browser/src/main/resources/.gitignore +++ b/openvidu-browser/src/main/resources/.gitignore @@ -1,2 +1,4 @@ /node_modules/ /yarn.lock +/npm-debug.log +/lib/ diff --git a/openvidu-browser/src/main/resources/package.json b/openvidu-browser/src/main/resources/package.json index f112f9a2..1052ff6d 100644 --- a/openvidu-browser/src/main/resources/package.json +++ b/openvidu-browser/src/main/resources/package.json @@ -1,11 +1,13 @@ { - "name": "openvidu", - "version": "0.0.1", + "name": "openvidu-browser", + "version": "0.0.2", "description": "OpenVidu Browser", - "main": "OpenVidu.js", + "main": "lib/index.js", + "types": "lib/index.d.ts", "scripts": { "browserify": "cd ts && watchify Main.ts -p [ tsify ] --exclude kurento-browser-extensions --debug -o ../static/js/OpenVidu.js -v", - "test": "echo \"Error: no test specified\" && exit 1" + "test": "echo \"Error: no test specified\" && exit 1", + "prepublish": "cd ts && tsc" }, "author": "", "license": "Apache-2.0", diff --git a/openvidu-browser/src/main/resources/ts/index.ts b/openvidu-browser/src/main/resources/ts/index.ts new file mode 100644 index 00000000..3d1f7c23 --- /dev/null +++ b/openvidu-browser/src/main/resources/ts/index.ts @@ -0,0 +1,4 @@ +export * from './OpenVidu'; +export * from './Participant'; +export * from './Stream'; +export * from './Session'; diff --git a/openvidu-browser/src/main/resources/ts/tsconfig.json b/openvidu-browser/src/main/resources/ts/tsconfig.json index 2c944371..898c6068 100644 --- a/openvidu-browser/src/main/resources/ts/tsconfig.json +++ b/openvidu-browser/src/main/resources/ts/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "declaration": true, "target": "es5", "module": "commonjs", //"noImplicitAny": true, @@ -17,7 +18,7 @@ "forceConsistentCasingInFileNames": true, "allowSyntheticDefaultImports": true, "strictNullChecks": true, - "outFile": "../ts_js/OpenVidu.js", + "outDir": "../lib", "emitBOM": false, "preserveConstEnums": true, "sourceMap": true