trucoshi 0.2.17 → 0.2.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -0
- package/dist/index.js +14 -0
- package/package.json +6 -6
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -14,5 +14,19 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
const classes_1 = require("./server/classes");
|
|
18
|
+
const trucoshiEvents_1 = require("./server/middlewares/trucoshiEvents");
|
|
19
|
+
exports.default = () => {
|
|
20
|
+
const PORT = process.env.NODE_PORT || 4001;
|
|
21
|
+
const ORIGIN = process.env.NODE_ORIGIN || "http://localhost:3000";
|
|
22
|
+
const server = (0, classes_1.SocketServer)((0, classes_1.Trucoshi)(), Number(PORT), [ORIGIN]);
|
|
23
|
+
server.listen((io) => {
|
|
24
|
+
console.log("Listening on", PORT, " from origin at", ORIGIN);
|
|
25
|
+
io.use((0, trucoshiEvents_1.trucoshiEvents)(server));
|
|
26
|
+
io.on("connection", (socket) => {
|
|
27
|
+
console.log("New socket", socket.id);
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
};
|
|
17
31
|
__exportStar(require("./lib"), exports);
|
|
18
32
|
__exportStar(require("./types"), exports);
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trucoshi",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.18",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"start": "node ./dist/trucoshi.js",
|
|
8
|
-
"prepublishOnly": "yarn test && yarn build",
|
|
9
7
|
"dev": "nodemon",
|
|
10
|
-
"
|
|
11
|
-
"
|
|
8
|
+
"start": "node ./bin/trucoshi-server",
|
|
9
|
+
"build": "yarn run rimraf ./dist && yarn run tsc --project .",
|
|
10
|
+
"prepublishOnly": "yarn test && yarn build",
|
|
12
11
|
"test": "yarn run ts-mocha --exit ./test/**/*.ts",
|
|
13
|
-
"
|
|
12
|
+
"test:autoplay": "yarn run ts-node src/test/autoplay",
|
|
13
|
+
"test:play": "yarn run ts-node src/test/play"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@types/chai": "^4.3.4",
|