timing-provider-server 3.0.2 → 3.0.3
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/build/es2020/app.js +2 -2
- package/build/es2020/app.js.map +1 -1
- package/build/node/app.js +2 -2
- package/package.json +14 -8
- package/src/app.ts +2 -2
package/build/es2020/app.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { generateUniqueNumber } from 'fast-unique-numbers';
|
|
3
3
|
import { argv } from 'process';
|
|
4
|
-
import
|
|
4
|
+
import { WebSocketServer } from 'ws';
|
|
5
5
|
import yargs from 'yargs';
|
|
6
6
|
(async () => {
|
|
7
7
|
const commandLineArguments = yargs(argv.slice(2))
|
|
@@ -17,7 +17,7 @@ import yargs from 'yargs';
|
|
|
17
17
|
}
|
|
18
18
|
const { port } = commandLineArguments;
|
|
19
19
|
const activeConnections = new Map();
|
|
20
|
-
const server = new
|
|
20
|
+
const server = new WebSocketServer({ port });
|
|
21
21
|
server.on('connection', (connection) => {
|
|
22
22
|
const id = generateUniqueNumber(activeConnections);
|
|
23
23
|
const sendMessage = (message) => connection.send(JSON.stringify(message));
|
package/build/es2020/app.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.js","sourceRoot":"","sources":["../../src/app.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"app.js","sourceRoot":"","sources":["../../src/app.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,IAAI,CAAC;AACrC,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AAE,EAAE,EAAE,OAAO,EAAE,aAAa,CAAC,OAAO,EAAE,CAAC,CAAC;aACrF;QACL,CAAC,CAAC,CAAC;QAEH,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;QAE3D,KAAK,MAAM,gBAAgB,IAAI,iBAAiB,EAAE;YAC9C,IAAI,gBAAgB,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE;gBAC5B,MAAM,KAAK,GAAG,CAAC,EAAE,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACzD,MAAM,IAAI,GAAG,SAAS,CAAC;gBAEvB,WAAW,CAAC,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;gBACzG,gBAAgB,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;aACzF;SACJ;IACL,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,EAAE,CAAC"}
|
package/build/node/app.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { generateUniqueNumber } from 'fast-unique-numbers';
|
|
3
3
|
import { argv } from 'process';
|
|
4
|
-
import
|
|
4
|
+
import { WebSocketServer } from 'ws';
|
|
5
5
|
import yargs from 'yargs';
|
|
6
6
|
|
|
7
7
|
(async () => {
|
|
@@ -19,7 +19,7 @@ import yargs from 'yargs';
|
|
|
19
19
|
port
|
|
20
20
|
} = commandLineArguments;
|
|
21
21
|
const activeConnections = new Map();
|
|
22
|
-
const server = new
|
|
22
|
+
const server = new WebSocketServer({
|
|
23
23
|
port
|
|
24
24
|
});
|
|
25
25
|
server.on('connection', connection => {
|
package/package.json
CHANGED
|
@@ -11,23 +11,29 @@
|
|
|
11
11
|
"path": "cz-conventional-changelog"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
|
+
"contributors": [
|
|
15
|
+
{
|
|
16
|
+
"email": "marcus.schreiter@meso.design",
|
|
17
|
+
"name": "Marcus Schreiter"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
14
20
|
"dependencies": {
|
|
15
21
|
"fast-unique-numbers": "^6.0.9",
|
|
16
22
|
"tslib": "^2.3.1",
|
|
17
|
-
"typescript": "^4.
|
|
18
|
-
"ws": "^8.
|
|
23
|
+
"typescript": "^4.5.2",
|
|
24
|
+
"ws": "^8.3.0",
|
|
19
25
|
"yargs": "^17.2.1"
|
|
20
26
|
},
|
|
21
27
|
"description": "A command line tool to spin up a server which can be used with the timing-provider.",
|
|
22
28
|
"devDependencies": {
|
|
23
29
|
"@babel/cli": "^7.16.0",
|
|
24
30
|
"@babel/core": "^7.16.0",
|
|
25
|
-
"@babel/preset-env": "^7.16.
|
|
31
|
+
"@babel/preset-env": "^7.16.4",
|
|
26
32
|
"@babel/register": "^7.16.0",
|
|
27
|
-
"@commitlint/cli": "^
|
|
28
|
-
"@commitlint/config-angular": "^
|
|
33
|
+
"@commitlint/cli": "^15.0.0",
|
|
34
|
+
"@commitlint/config-angular": "^15.0.0",
|
|
29
35
|
"@types/ws": "^8.2.0",
|
|
30
|
-
"@types/yargs": "^17.0.
|
|
36
|
+
"@types/yargs": "^17.0.7",
|
|
31
37
|
"chai": "^4.3.4",
|
|
32
38
|
"commitizen": "^4.2.4",
|
|
33
39
|
"cz-conventional-changelog": "^3.3.0",
|
|
@@ -36,7 +42,7 @@
|
|
|
36
42
|
"husky": "^7.0.4",
|
|
37
43
|
"mocha": "^9.1.3",
|
|
38
44
|
"prettier": "^2.4.1",
|
|
39
|
-
"pretty-quick": "^3.1.
|
|
45
|
+
"pretty-quick": "^3.1.2",
|
|
40
46
|
"rimraf": "^3.0.2",
|
|
41
47
|
"sinon": "^12.0.1",
|
|
42
48
|
"sinon-chai": "^3.7.0",
|
|
@@ -81,5 +87,5 @@
|
|
|
81
87
|
"test:unit": "if [ \"$TYPE\" = \"\" -o \"$TYPE\" = \"unit\" ]; then mocha --bail --parallel --recursive --require config/mocha/config-unit.js test/unit; fi"
|
|
82
88
|
},
|
|
83
89
|
"type": "module",
|
|
84
|
-
"version": "3.0.
|
|
90
|
+
"version": "3.0.3"
|
|
85
91
|
}
|
package/src/app.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { generateUniqueNumber } from 'fast-unique-numbers';
|
|
4
4
|
import { argv } from 'process';
|
|
5
|
-
import
|
|
5
|
+
import { WebSocketServer } from 'ws';
|
|
6
6
|
import yargs from 'yargs';
|
|
7
7
|
import { ICommandLineArguments } from './interfaces';
|
|
8
8
|
|
|
@@ -22,7 +22,7 @@ import { ICommandLineArguments } from './interfaces';
|
|
|
22
22
|
|
|
23
23
|
const { port } = commandLineArguments;
|
|
24
24
|
const activeConnections = new Map<number, (message: object) => void>();
|
|
25
|
-
const server = new
|
|
25
|
+
const server = new WebSocketServer({ port });
|
|
26
26
|
|
|
27
27
|
server.on('connection', (connection) => {
|
|
28
28
|
const id = generateUniqueNumber(activeConnections);
|