esbuild-helpers 1.0.0-next.1 → 2.0.0
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/README.md +1 -2
- package/dist/addIndex.d.ts +22 -22
- package/dist/addIndex.js +56 -57
- package/dist/addIndex.js.map +1 -1
- package/dist/builder.d.ts +3 -3
- package/dist/builder.js +233 -234
- package/dist/builder.js.map +1 -1
- package/dist/client.d.ts +3 -3
- package/dist/client.js +47 -48
- package/dist/client.js.map +1 -1
- package/dist/copy.d.ts +2 -2
- package/dist/copy.js +82 -83
- package/dist/copy.js.map +1 -1
- package/dist/electron.d.ts +3 -3
- package/dist/electron.js +47 -48
- package/dist/electron.js.map +1 -1
- package/dist/events.d.ts +3 -3
- package/dist/events.js +27 -28
- package/dist/events.js.map +1 -1
- package/dist/exported.d.ts +11 -11
- package/dist/exported.js +25 -25
- package/dist/interfaces.d.ts +46 -46
- package/dist/interfaces.js +2 -2
- package/dist/log.d.ts +4 -4
- package/dist/log.js +16 -17
- package/dist/log.js.map +1 -1
- package/dist/makeAllPackagesExternalPlugin.d.ts +4 -4
- package/dist/makeAllPackagesExternalPlugin.js +11 -11
- package/dist/nodejs.d.ts +3 -3
- package/dist/nodejs.js +48 -49
- package/dist/nodejs.js.map +1 -1
- package/dist/postCSSplugin.d.ts +4 -4
- package/dist/postCSSplugin.js +102 -103
- package/dist/postCSSplugin.js.map +1 -1
- package/dist/runElectronApp.d.ts +2 -3
- package/dist/runElectronApp.js +32 -33
- package/dist/runElectronApp.js.map +1 -1
- package/dist/runNodeApp.d.ts +2 -3
- package/dist/runNodeApp.js +23 -24
- package/dist/runNodeApp.js.map +1 -1
- package/dist/single.d.ts +3 -3
- package/dist/single.js +47 -48
- package/dist/single.js.map +1 -1
- package/dist/typechecker/debugPrint.d.ts +1 -1
- package/dist/typechecker/debugPrint.js +11 -12
- package/dist/typechecker/debugPrint.js.map +1 -1
- package/dist/typechecker/getGlobalDiagnostics.d.ts +3 -3
- package/dist/typechecker/getGlobalDiagnostics.js +20 -21
- package/dist/typechecker/getGlobalDiagnostics.js.map +1 -1
- package/dist/typechecker/getOptionsDiagnostics.d.ts +3 -3
- package/dist/typechecker/getOptionsDiagnostics.js +20 -21
- package/dist/typechecker/getOptionsDiagnostics.js.map +1 -1
- package/dist/typechecker/getPath.d.ts +2 -2
- package/dist/typechecker/getPath.js +32 -33
- package/dist/typechecker/getPath.js.map +1 -1
- package/dist/typechecker/getSemanticDiagnostics.d.ts +3 -3
- package/dist/typechecker/getSemanticDiagnostics.js +20 -21
- package/dist/typechecker/getSemanticDiagnostics.js.map +1 -1
- package/dist/typechecker/getSyntacticDiagnostics.d.ts +3 -3
- package/dist/typechecker/getSyntacticDiagnostics.js +20 -21
- package/dist/typechecker/getSyntacticDiagnostics.js.map +1 -1
- package/dist/typechecker/index.d.ts +20 -20
- package/dist/typechecker/index.js +168 -168
- package/dist/typechecker/index.js.map +1 -1
- package/dist/typechecker/inspectCode.d.ts +3 -3
- package/dist/typechecker/inspectCode.js +54 -55
- package/dist/typechecker/inspectCode.js.map +1 -1
- package/dist/typechecker/interfaces.d.ts +51 -51
- package/dist/typechecker/interfaces.js +14 -14
- package/dist/typechecker/interfaces.js.map +1 -1
- package/dist/typechecker/logger.d.ts +28 -28
- package/dist/typechecker/logger.js +41 -41
- package/dist/typechecker/printResult.d.ts +2 -2
- package/dist/typechecker/printResult.js +126 -127
- package/dist/typechecker/printResult.js.map +1 -1
- package/dist/typechecker/printSettings.d.ts +2 -2
- package/dist/typechecker/printSettings.js +20 -21
- package/dist/typechecker/printSettings.js.map +1 -1
- package/dist/typechecker/processTsDiagnostics.d.ts +2 -2
- package/dist/typechecker/processTsDiagnostics.js +48 -49
- package/dist/typechecker/processTsDiagnostics.js.map +1 -1
- package/dist/typechecker/register.json.d.ts +1 -1
- package/dist/typechecker/register.json.js +16 -16
- package/dist/typechecker/register.json.js.map +1 -1
- package/dist/typechecker/throwIfErrors.d.ts +2 -2
- package/dist/typechecker/throwIfErrors.js +18 -19
- package/dist/typechecker/throwIfErrors.js.map +1 -1
- package/dist/typechecker/watchSrc.d.ts +2 -2
- package/dist/typechecker/watchSrc.js +79 -80
- package/dist/typechecker/watchSrc.js.map +1 -1
- package/dist/typechecker/worker.d.ts +1 -1
- package/dist/typechecker/worker.js +69 -69
- package/dist/typechecker/worker.js.map +1 -1
- package/dist/webDevServer.d.ts +1 -1
- package/dist/webDevServer.js +39 -40
- package/dist/webDevServer.js.map +1 -1
- package/dist/websocketServer.d.ts +9 -9
- package/dist/websocketServer.js +35 -36
- package/dist/websocketServer.js.map +1 -1
- package/package.json +19 -20
- package/test/package-lock.json +3179 -1929
- package/test/package.json +19 -21
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var fs_1 = require("fs");
|
|
4
|
-
// This will just override our require for *.json files and use
|
|
5
|
-
// JSON to parse.
|
|
6
|
-
require.extensions['.json'] = function (module, filename) {
|
|
7
|
-
var content = (0, fs_1.readFileSync)(filename, 'utf8');
|
|
8
|
-
try {
|
|
9
|
-
// regex from https://stackoverflow.com/questions/40685262/read-json-file-ignoring-custom-comments (thank you :-))
|
|
10
|
-
module.exports = JSON.parse(content.replace(/\\"|"(?:\\"|[^"])*"|(\/\/.*|\/\*[\s\S]*?\*\/)/g, function (m, g) { return g ? "" : m; }));
|
|
11
|
-
}
|
|
12
|
-
catch (err) {
|
|
13
|
-
err.message = filename + ': ' + err.message;
|
|
14
|
-
throw err;
|
|
15
|
-
}
|
|
16
|
-
};
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var fs_1 = require("fs");
|
|
4
|
+
// This will just override our require for *.json files and use
|
|
5
|
+
// JSON to parse.
|
|
6
|
+
require.extensions['.json'] = function (module, filename) {
|
|
7
|
+
var content = (0, fs_1.readFileSync)(filename, 'utf8');
|
|
8
|
+
try {
|
|
9
|
+
// regex from https://stackoverflow.com/questions/40685262/read-json-file-ignoring-custom-comments (thank you :-))
|
|
10
|
+
module.exports = JSON.parse(content.replace(/\\"|"(?:\\"|[^"])*"|(\/\/.*|\/\*[\s\S]*?\*\/)/g, function (m, g) { return g ? "" : m; }));
|
|
11
|
+
}
|
|
12
|
+
catch (err) {
|
|
13
|
+
err.message = filename + ': ' + err.message;
|
|
14
|
+
throw err;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
17
|
//# sourceMappingURL=register.json.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.json.js","sourceRoot":"","sources":["../../src/typechecker/register.json.ts"],"names":[],"mappings":";;AAAA,yBAAkC;AAElC,+DAA+D;AAC/D,iBAAiB;AACjB,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,UAAS,MAAM,EAAE,QAAQ;IACnD,IAAM,OAAO,GAAG,IAAA,iBAAY,EAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC/C,IAAI;
|
|
1
|
+
{"version":3,"file":"register.json.js","sourceRoot":"","sources":["../../src/typechecker/register.json.ts"],"names":[],"mappings":";;AAAA,yBAAkC;AAElC,+DAA+D;AAC/D,iBAAiB;AACjB,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,UAAS,MAAM,EAAE,QAAQ;IACnD,IAAM,OAAO,GAAG,IAAA,iBAAY,EAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC/C,IAAI,CAAC;QACD,mHAAmH;QACnH,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,gDAAgD,EAAE,UAAC,CAAC,EAAE,CAAC,IAAK,OAAA,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAV,CAAU,CAAC,CAAC,CAAC;IACzH,CAAC;IAAC,OAAO,GAAO,EAAE,CAAC;QACf,GAAG,CAAC,OAAO,GAAG,QAAQ,GAAG,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC;QAC5C,MAAM,GAAG,CAAC;IACd,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ITypeCheckerOptions, IResults } from './interfaces';
|
|
2
|
-
export declare function throwIfError(options: ITypeCheckerOptions, errors: IResults): void;
|
|
1
|
+
import { ITypeCheckerOptions, IResults } from './interfaces';
|
|
2
|
+
export declare function throwIfError(options: ITypeCheckerOptions, errors: IResults): void;
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.throwIfError =
|
|
4
|
-
var printResult_1 = require("./printResult");
|
|
5
|
-
var logger_1 = require("./logger");
|
|
6
|
-
function throwIfError(options, errors) {
|
|
7
|
-
switch (true) {
|
|
8
|
-
// if throwError is set then callback and quit
|
|
9
|
-
case options.throwOnGlobal && errors.globalErrors.length > 0:
|
|
10
|
-
case options.throwOnOptions && errors.optionsErrors.length > 0:
|
|
11
|
-
case options.throwOnSemantic && errors.semanticErrors.length > 0:
|
|
12
|
-
case options.throwOnSyntactic && errors.syntacticErrors.length > 0:
|
|
13
|
-
logger_1.Logger.info("".concat(logger_1.C_Black + logger_1.C_BgYellow, " WARNING ").concat(logger_1.C_Reset + logger_1.C_Yellow, " Typechecker throw on error activated- quitting>"), logger_1.C_Reset);
|
|
14
|
-
(0, printResult_1.printResult)(options, errors);
|
|
15
|
-
process.exit(1);
|
|
16
|
-
break;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
exports.throwIfError = throwIfError;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.throwIfError = throwIfError;
|
|
4
|
+
var printResult_1 = require("./printResult");
|
|
5
|
+
var logger_1 = require("./logger");
|
|
6
|
+
function throwIfError(options, errors) {
|
|
7
|
+
switch (true) {
|
|
8
|
+
// if throwError is set then callback and quit
|
|
9
|
+
case options.throwOnGlobal && errors.globalErrors.length > 0:
|
|
10
|
+
case options.throwOnOptions && errors.optionsErrors.length > 0:
|
|
11
|
+
case options.throwOnSemantic && errors.semanticErrors.length > 0:
|
|
12
|
+
case options.throwOnSyntactic && errors.syntacticErrors.length > 0:
|
|
13
|
+
logger_1.Logger.info("".concat(logger_1.C_Black + logger_1.C_BgYellow, " WARNING ").concat(logger_1.C_Reset + logger_1.C_Yellow, " Typechecker throw on error activated- quitting>"), logger_1.C_Reset);
|
|
14
|
+
(0, printResult_1.printResult)(options, errors);
|
|
15
|
+
process.exit(1);
|
|
16
|
+
break;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
20
19
|
//# sourceMappingURL=throwIfErrors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"throwIfErrors.js","sourceRoot":"","sources":["../../src/typechecker/throwIfErrors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"throwIfErrors.js","sourceRoot":"","sources":["../../src/typechecker/throwIfErrors.ts"],"names":[],"mappings":";;AAIA,oCAkBC;AArBD,6CAA4C;AAC5C,mCAA0E;AAE1E,SAAgB,YAAY,CAAC,OAA4B,EAAE,MAAgB;IACvE,QAAQ,IAAI,EAAE,CAAC;QACX,8CAA8C;QAC9C,KAAK,OAAO,CAAC,aAAa,IAAI,MAAM,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC;QAC7D,KAAK,OAAO,CAAC,cAAc,IAAI,MAAM,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC;QAC/D,KAAK,OAAO,CAAC,eAAe,IAAI,MAAM,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC;QACjE,KAAK,OAAO,CAAC,gBAAgB,IAAI,MAAM,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC;YAC9D,eAAM,CAAC,IAAI,CACP,UAAG,gBAAO,GAAG,mBAAU,sBACnB,gBAAO,GAAG,iBAAQ,qDAC4B,EAClD,gBAAO,CACV,CAAC;YAEF,IAAA,yBAAW,EAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YAC7B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAChB,MAAM;IACd,CAAC;AACL,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ITypeCheckerOptions } from "./interfaces";
|
|
2
|
-
export declare function watchSrc(pathToWatch: string, options: ITypeCheckerOptions, callback: Function): void;
|
|
1
|
+
import { ITypeCheckerOptions } from "./interfaces";
|
|
2
|
+
export declare function watchSrc(pathToWatch: string, options: ITypeCheckerOptions, callback: Function): void;
|
|
@@ -1,81 +1,80 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.watchSrc =
|
|
27
|
-
var chokidar = __importStar(require("chokidar"));
|
|
28
|
-
var getPath_1 = require("./getPath");
|
|
29
|
-
var debugPrint_1 = require("./debugPrint");
|
|
30
|
-
var logger_1 = require("./logger");
|
|
31
|
-
var watchTimeout;
|
|
32
|
-
function watchSrc(pathToWatch, options, callback) {
|
|
33
|
-
(0, debugPrint_1.debugPrint)("watchSrc" + pathToWatch);
|
|
34
|
-
var basePath;
|
|
35
|
-
if (Array.isArray(pathToWatch)) {
|
|
36
|
-
basePath = pathToWatch.map(function (p) { return (0, getPath_1.getPath)(p, options); });
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
basePath = (0, getPath_1.getPath)(pathToWatch, options);
|
|
40
|
-
}
|
|
41
|
-
//let basePath = getPath(pathToWatch, options);
|
|
42
|
-
var watch = chokidar.watch(basePath);
|
|
43
|
-
// todo-> move into thread
|
|
44
|
-
// tell user what path we are watching
|
|
45
|
-
if (options.print_watchStarted) {
|
|
46
|
-
logger_1.Logger.info("".concat(logger_1.C_Yellow, "\nTypechecker watch mode activated: ").concat(logger_1.C_Reset));
|
|
47
|
-
}
|
|
48
|
-
var ready = false;
|
|
49
|
-
watch.on("ready", function (f /*, stat: any*/) {
|
|
50
|
-
ready = true;
|
|
51
|
-
});
|
|
52
|
-
// on created file event
|
|
53
|
-
watch.on("add", function (f /*, stat: any*/) {
|
|
54
|
-
if (ready) {
|
|
55
|
-
logger_1.Logger.info("".concat(logger_1.C_Yellow, "\nFile created: ").concat(logger_1.C_Gray).concat(f));
|
|
56
|
-
callback();
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
// on changed file event
|
|
60
|
-
watch.on("change", function (f /*, curr: any, prev: any*/) {
|
|
61
|
-
// tell user about event
|
|
62
|
-
logger_1.Logger.info("".concat(logger_1.C_Yellow, "\nFile changed: ").concat(logger_1.C_Gray).concat(f));
|
|
63
|
-
// have inside timeout, so we only run once when multiple files are saved
|
|
64
|
-
clearTimeout(watchTimeout);
|
|
65
|
-
watchTimeout = setTimeout(function () {
|
|
66
|
-
callback();
|
|
67
|
-
}, 100);
|
|
68
|
-
});
|
|
69
|
-
watch.on("unlink", function (f /*, stat: any*/) {
|
|
70
|
-
// tell user about event
|
|
71
|
-
logger_1.Logger.info("".concat(logger_1.C_Yellow, "\nFile removed: ").concat(logger_1.C_Gray).concat(f));
|
|
72
|
-
logger_1.Logger.info("Calling typechecker", logger_1.C_Reset);
|
|
73
|
-
// have inside timeout, so we only run once when multiple files are saved
|
|
74
|
-
clearTimeout(watchTimeout);
|
|
75
|
-
watchTimeout = setTimeout(function () {
|
|
76
|
-
callback();
|
|
77
|
-
}, 100);
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
exports.watchSrc = watchSrc;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.watchSrc = watchSrc;
|
|
27
|
+
var chokidar = __importStar(require("chokidar"));
|
|
28
|
+
var getPath_1 = require("./getPath");
|
|
29
|
+
var debugPrint_1 = require("./debugPrint");
|
|
30
|
+
var logger_1 = require("./logger");
|
|
31
|
+
var watchTimeout;
|
|
32
|
+
function watchSrc(pathToWatch, options, callback) {
|
|
33
|
+
(0, debugPrint_1.debugPrint)("watchSrc" + pathToWatch);
|
|
34
|
+
var basePath;
|
|
35
|
+
if (Array.isArray(pathToWatch)) {
|
|
36
|
+
basePath = pathToWatch.map(function (p) { return (0, getPath_1.getPath)(p, options); });
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
basePath = (0, getPath_1.getPath)(pathToWatch, options);
|
|
40
|
+
}
|
|
41
|
+
//let basePath = getPath(pathToWatch, options);
|
|
42
|
+
var watch = chokidar.watch(basePath);
|
|
43
|
+
// todo-> move into thread
|
|
44
|
+
// tell user what path we are watching
|
|
45
|
+
if (options.print_watchStarted) {
|
|
46
|
+
logger_1.Logger.info("".concat(logger_1.C_Yellow, "\nTypechecker watch mode activated: ").concat(logger_1.C_Reset));
|
|
47
|
+
}
|
|
48
|
+
var ready = false;
|
|
49
|
+
watch.on("ready", function (f /*, stat: any*/) {
|
|
50
|
+
ready = true;
|
|
51
|
+
});
|
|
52
|
+
// on created file event
|
|
53
|
+
watch.on("add", function (f /*, stat: any*/) {
|
|
54
|
+
if (ready) {
|
|
55
|
+
logger_1.Logger.info("".concat(logger_1.C_Yellow, "\nFile created: ").concat(logger_1.C_Gray).concat(f));
|
|
56
|
+
callback();
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
// on changed file event
|
|
60
|
+
watch.on("change", function (f /*, curr: any, prev: any*/) {
|
|
61
|
+
// tell user about event
|
|
62
|
+
logger_1.Logger.info("".concat(logger_1.C_Yellow, "\nFile changed: ").concat(logger_1.C_Gray).concat(f));
|
|
63
|
+
// have inside timeout, so we only run once when multiple files are saved
|
|
64
|
+
clearTimeout(watchTimeout);
|
|
65
|
+
watchTimeout = setTimeout(function () {
|
|
66
|
+
callback();
|
|
67
|
+
}, 100);
|
|
68
|
+
});
|
|
69
|
+
watch.on("unlink", function (f /*, stat: any*/) {
|
|
70
|
+
// tell user about event
|
|
71
|
+
logger_1.Logger.info("".concat(logger_1.C_Yellow, "\nFile removed: ").concat(logger_1.C_Gray).concat(f));
|
|
72
|
+
logger_1.Logger.info("Calling typechecker", logger_1.C_Reset);
|
|
73
|
+
// have inside timeout, so we only run once when multiple files are saved
|
|
74
|
+
clearTimeout(watchTimeout);
|
|
75
|
+
watchTimeout = setTimeout(function () {
|
|
76
|
+
callback();
|
|
77
|
+
}, 100);
|
|
78
|
+
});
|
|
79
|
+
}
|
|
81
80
|
//# sourceMappingURL=watchSrc.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watchSrc.js","sourceRoot":"","sources":["../../src/typechecker/watchSrc.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"watchSrc.js","sourceRoot":"","sources":["../../src/typechecker/watchSrc.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAQA,4BA2DC;AAlED,iDAAqC;AACrC,qCAAoC;AACpC,2CAA0C;AAC1C,mCAA6D;AAE7D,IAAI,YAAiB,CAAC;AAEtB,SAAgB,QAAQ,CACtB,WAAmB,EACnB,OAA4B,EAC5B,QAAkB;IAElB,IAAA,uBAAU,EAAC,UAAU,GAAG,WAAW,CAAC,CAAC;IACrC,IAAI,QAA2B,CAAC;IAChC,IAAI,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;QAC/B,QAAQ,GA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C,CAAC;IAEH,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,UAAC,CAAM,CAAC,eAAe;QACxC,wBAAwB;QACxB,eAAM,CAAC,IAAI,CAAC,UAAG,iBAAQ,6BAAmB,eAAM,SAAG,CAAC,CAAE,CAAC,CAAC;QACxD,eAAM,CAAC,IAAI,CAAC,qBAAqB,EAAE,gBAAO,CAAC,CAAC;QAE5C,yEAAyE;QACzE,YAAY,CAAC,YAAY,CAAC,CAAC;QAC3B,YAAY,GAAG,UAAU,CAAC;YACxB,QAAQ,EAAE,CAAC;QACb,CAAC,EAAE,GAAG,CAAC,CAAC;IACV,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var interfaces_1 = require("./interfaces");
|
|
4
|
-
var inspectCode_1 = require("./inspectCode");
|
|
5
|
-
var printResult_1 = require("./printResult");
|
|
6
|
-
var watchSrc_1 = require("./watchSrc");
|
|
7
|
-
var printSettings_1 = require("./printSettings");
|
|
8
|
-
var debugPrint_1 = require("./debugPrint");
|
|
9
|
-
var lastResult;
|
|
10
|
-
var printErrorTotal;
|
|
11
|
-
// listen for messages
|
|
12
|
-
process.on('message', function (msg) {
|
|
13
|
-
(0, debugPrint_1.debugPrint)("worker message recived ".concat(msg.type));
|
|
14
|
-
switch (msg.type) {
|
|
15
|
-
// tell checker to inspect code
|
|
16
|
-
case interfaces_1.WorkerCommand.inspectCode:
|
|
17
|
-
(0, debugPrint_1.debugPrint)('worker inspectCode');
|
|
18
|
-
if (msg.options) {
|
|
19
|
-
lastResult = (0, inspectCode_1.inspectCode)(msg.options, lastResult && lastResult.oldProgram);
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
throw new Error('You tried to inspect code without ts/lint options');
|
|
23
|
-
}
|
|
24
|
-
break;
|
|
25
|
-
// tell checker to inspect code
|
|
26
|
-
case interfaces_1.WorkerCommand.inspectCodeAndPrint:
|
|
27
|
-
(0, debugPrint_1.debugPrint)('worker inspectCodeAndPrint');
|
|
28
|
-
if (msg.options) {
|
|
29
|
-
lastResult = (0, inspectCode_1.inspectCode)(msg.options, lastResult && lastResult.oldProgram);
|
|
30
|
-
printErrorTotal = (0, printResult_1.printResult)(msg.options, lastResult);
|
|
31
|
-
printErrorTotal = printErrorTotal;
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
throw new Error('You tried to inspect code without ts/lint options');
|
|
35
|
-
}
|
|
36
|
-
break;
|
|
37
|
-
case interfaces_1.WorkerCommand.printResult:
|
|
38
|
-
(0, debugPrint_1.debugPrint)('worker printResult');
|
|
39
|
-
if (msg.options && lastResult) {
|
|
40
|
-
printErrorTotal = (0, printResult_1.printResult)(msg.options, lastResult);
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
throw new Error('You tried to print code without ts/lint options or without having inspected code');
|
|
44
|
-
}
|
|
45
|
-
break;
|
|
46
|
-
case interfaces_1.WorkerCommand.printSettings:
|
|
47
|
-
(0, debugPrint_1.debugPrint)('worker printSettings');
|
|
48
|
-
if (msg.options) {
|
|
49
|
-
(0, printSettings_1.printSettings)(msg.options);
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
throw new Error('You tried to print settings without ts/lint options or without having inspected code');
|
|
53
|
-
}
|
|
54
|
-
break;
|
|
55
|
-
case interfaces_1.WorkerCommand.watch:
|
|
56
|
-
(0, debugPrint_1.debugPrint)('worker watch');
|
|
57
|
-
if (msg.options) {
|
|
58
|
-
(0, watchSrc_1.watchSrc)(msg.pathToWatch, msg.options, function () {
|
|
59
|
-
lastResult = (0, inspectCode_1.inspectCode)(msg.options, lastResult && lastResult.oldProgram);
|
|
60
|
-
printErrorTotal = (0, printResult_1.printResult)(msg.options, lastResult);
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
throw new Error('You tried to print code without ts/lint options or without having inspected code');
|
|
65
|
-
}
|
|
66
|
-
break;
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
(0, debugPrint_1.debugPrint)('worker started');
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var interfaces_1 = require("./interfaces");
|
|
4
|
+
var inspectCode_1 = require("./inspectCode");
|
|
5
|
+
var printResult_1 = require("./printResult");
|
|
6
|
+
var watchSrc_1 = require("./watchSrc");
|
|
7
|
+
var printSettings_1 = require("./printSettings");
|
|
8
|
+
var debugPrint_1 = require("./debugPrint");
|
|
9
|
+
var lastResult;
|
|
10
|
+
var printErrorTotal;
|
|
11
|
+
// listen for messages
|
|
12
|
+
process.on('message', function (msg) {
|
|
13
|
+
(0, debugPrint_1.debugPrint)("worker message recived ".concat(msg.type));
|
|
14
|
+
switch (msg.type) {
|
|
15
|
+
// tell checker to inspect code
|
|
16
|
+
case interfaces_1.WorkerCommand.inspectCode:
|
|
17
|
+
(0, debugPrint_1.debugPrint)('worker inspectCode');
|
|
18
|
+
if (msg.options) {
|
|
19
|
+
lastResult = (0, inspectCode_1.inspectCode)(msg.options, lastResult && lastResult.oldProgram);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
throw new Error('You tried to inspect code without ts/lint options');
|
|
23
|
+
}
|
|
24
|
+
break;
|
|
25
|
+
// tell checker to inspect code
|
|
26
|
+
case interfaces_1.WorkerCommand.inspectCodeAndPrint:
|
|
27
|
+
(0, debugPrint_1.debugPrint)('worker inspectCodeAndPrint');
|
|
28
|
+
if (msg.options) {
|
|
29
|
+
lastResult = (0, inspectCode_1.inspectCode)(msg.options, lastResult && lastResult.oldProgram);
|
|
30
|
+
printErrorTotal = (0, printResult_1.printResult)(msg.options, lastResult);
|
|
31
|
+
printErrorTotal = printErrorTotal;
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
throw new Error('You tried to inspect code without ts/lint options');
|
|
35
|
+
}
|
|
36
|
+
break;
|
|
37
|
+
case interfaces_1.WorkerCommand.printResult:
|
|
38
|
+
(0, debugPrint_1.debugPrint)('worker printResult');
|
|
39
|
+
if (msg.options && lastResult) {
|
|
40
|
+
printErrorTotal = (0, printResult_1.printResult)(msg.options, lastResult);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
throw new Error('You tried to print code without ts/lint options or without having inspected code');
|
|
44
|
+
}
|
|
45
|
+
break;
|
|
46
|
+
case interfaces_1.WorkerCommand.printSettings:
|
|
47
|
+
(0, debugPrint_1.debugPrint)('worker printSettings');
|
|
48
|
+
if (msg.options) {
|
|
49
|
+
(0, printSettings_1.printSettings)(msg.options);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
throw new Error('You tried to print settings without ts/lint options or without having inspected code');
|
|
53
|
+
}
|
|
54
|
+
break;
|
|
55
|
+
case interfaces_1.WorkerCommand.watch:
|
|
56
|
+
(0, debugPrint_1.debugPrint)('worker watch');
|
|
57
|
+
if (msg.options) {
|
|
58
|
+
(0, watchSrc_1.watchSrc)(msg.pathToWatch, msg.options, function () {
|
|
59
|
+
lastResult = (0, inspectCode_1.inspectCode)(msg.options, lastResult && lastResult.oldProgram);
|
|
60
|
+
printErrorTotal = (0, printResult_1.printResult)(msg.options, lastResult);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
throw new Error('You tried to print code without ts/lint options or without having inspected code');
|
|
65
|
+
}
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
(0, debugPrint_1.debugPrint)('worker started');
|
|
70
70
|
//# sourceMappingURL=worker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.js","sourceRoot":"","sources":["../../src/typechecker/worker.ts"],"names":[],"mappings":";;AAAA,2CAAuE;AACvE,6CAA4C;AAC5C,6CAA4C;AAC5C,uCAAsC;AACtC,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CAAC;gBACJ,MAAM,IAAI,KAAK,CACX,kFAAkF,CACrF,CAAC;YACN,CAAC;YACD,MAAM;IACd,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,IAAA,uBAAU,EAAC,gBAAgB,CAAC,CAAC"}
|
package/dist/webDevServer.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function startDevServer(port: number, distFolder: string, publicFolders: string[], host: string): void;
|
|
1
|
+
export declare function startDevServer(port: number, distFolder: string, publicFolders: string[], host: string): void;
|
package/dist/webDevServer.js
CHANGED
|
@@ -1,41 +1,40 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.startDevServer =
|
|
7
|
-
var express_1 = __importDefault(require("express"));
|
|
8
|
-
var zlib_1 = require("zlib");
|
|
9
|
-
var log_1 = require("./log");
|
|
10
|
-
var compression;
|
|
11
|
-
try {
|
|
12
|
-
compression = require("compression");
|
|
13
|
-
}
|
|
14
|
-
catch (err) { }
|
|
15
|
-
function startDevServer(port, distFolder, publicFolders, host) {
|
|
16
|
-
var app = (0, express_1.default)();
|
|
17
|
-
if (compression) {
|
|
18
|
-
app.use(compression({
|
|
19
|
-
threshold: 1,
|
|
20
|
-
flush: zlib_1.constants.Z_SYNC_FLUSH,
|
|
21
|
-
}));
|
|
22
|
-
}
|
|
23
|
-
if (Array.isArray(publicFolders)) {
|
|
24
|
-
publicFolders.forEach(function (folder) {
|
|
25
|
-
app.use(express_1.default.static(folder, {
|
|
26
|
-
etag: false,
|
|
27
|
-
maxAge: "5",
|
|
28
|
-
}));
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
app.use(express_1.default.static(distFolder, {
|
|
32
|
-
etag: false,
|
|
33
|
-
maxAge: "5",
|
|
34
|
-
}));
|
|
35
|
-
app.listen(port, function () {
|
|
36
|
-
(0, log_1.log)("DEVSERVER", "http://".concat(host || "localhost", ":") + port);
|
|
37
|
-
(0, log_1.log)("DEVSERVER", "path: ".concat(distFolder, ":"));
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
exports.startDevServer = startDevServer;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.startDevServer = startDevServer;
|
|
7
|
+
var express_1 = __importDefault(require("express"));
|
|
8
|
+
var zlib_1 = require("zlib");
|
|
9
|
+
var log_1 = require("./log");
|
|
10
|
+
var compression;
|
|
11
|
+
try {
|
|
12
|
+
compression = require("compression");
|
|
13
|
+
}
|
|
14
|
+
catch (err) { }
|
|
15
|
+
function startDevServer(port, distFolder, publicFolders, host) {
|
|
16
|
+
var app = (0, express_1.default)();
|
|
17
|
+
if (compression) {
|
|
18
|
+
app.use(compression({
|
|
19
|
+
threshold: 1,
|
|
20
|
+
flush: zlib_1.constants.Z_SYNC_FLUSH,
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
if (Array.isArray(publicFolders)) {
|
|
24
|
+
publicFolders.forEach(function (folder) {
|
|
25
|
+
app.use(express_1.default.static(folder, {
|
|
26
|
+
etag: false,
|
|
27
|
+
maxAge: "5",
|
|
28
|
+
}));
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
app.use(express_1.default.static(distFolder, {
|
|
32
|
+
etag: false,
|
|
33
|
+
maxAge: "5",
|
|
34
|
+
}));
|
|
35
|
+
app.listen(port, function () {
|
|
36
|
+
(0, log_1.log)("DEVSERVER", "http://".concat(host || "localhost", ":") + port);
|
|
37
|
+
(0, log_1.log)("DEVSERVER", "path: ".concat(distFolder, ":"));
|
|
38
|
+
});
|
|
39
|
+
}
|
|
41
40
|
//# sourceMappingURL=webDevServer.js.map
|
package/dist/webDevServer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webDevServer.js","sourceRoot":"","sources":["../src/webDevServer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"webDevServer.js","sourceRoot":"","sources":["../src/webDevServer.ts"],"names":[],"mappings":";;;;;AASA,wCAuCC;AAhDD,oDAA8B;AAC9B,6BAAiC;AACjC,6BAA4B;AAE5B,IAAI,WAAgB,CAAC;AACrB,IAAI,CAAC;IACH,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AACvC,CAAC;AAAC,OAAO,GAAG,EAAE,CAAC,CAAA,CAAC;AAEhB,SAAgB,cAAc,CAC5B,IAAY,EACZ,UAAkB,EAClB,aAAuB,EACvB,IAAY;IAEZ,IAAM,GAAG,GAAG,IAAA,iBAAO,GAAE,CAAC;IAEtB,IAAI,WAAW,EAAE,CAAC;QAChB,GAAG,CAAC,GAAG,CACL,WAAW,CAAC;YACV,SAAS,EAAE,CAAC;YACZ,KAAK,EAAE,gBAAS,CAAC,YAAY;SAC9B,CAAC,CACH,CAAC;IACJ,CAAC;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC;QACjC,aAAa,CAAC,OAAO,CAAC,UAAC,MAAM;YAC3B,GAAG,CAAC,GAAG,CACL,iBAAO,CAAC,MAAM,CAAC,MAAM,EAAE;gBACrB,IAAI,EAAE,KAAK;gBACX,MAAM,EAAE,GAAG;aACZ,CAAC,CACH,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;IAED,GAAG,CAAC,GAAG,CACL,iBAAO,CAAC,MAAM,CAAC,UAAU,EAAE;QACzB,IAAI,EAAE,KAAK;QACX,MAAM,EAAE,GAAG;KACZ,CAAC,CACH,CAAC;IAEF,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE;QACf,IAAA,SAAG,EAAC,WAAW,EAAE,iBAAU,IAAI,IAAI,WAAW,MAAG,GAAG,IAAI,CAAC,CAAC;QAC1D,IAAA,SAAG,EAAC,WAAW,EAAE,gBAAS,UAAU,MAAG,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Creates web socket server
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Start server
|
|
6
|
-
* @param port
|
|
7
|
-
*/
|
|
8
|
-
export declare function startWebsocketServer(port: number): void;
|
|
9
|
-
export declare function callWebsocketClient(msg: string): void;
|
|
1
|
+
/**
|
|
2
|
+
* Creates web socket server
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Start server
|
|
6
|
+
* @param port
|
|
7
|
+
*/
|
|
8
|
+
export declare function startWebsocketServer(port: number): void;
|
|
9
|
+
export declare function callWebsocketClient(msg: string): void;
|
package/dist/websocketServer.js
CHANGED
|
@@ -1,37 +1,36 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Creates web socket server
|
|
4
|
-
*/
|
|
5
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
|
-
};
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.
|
|
10
|
-
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
*
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
webSocketServerInstance.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function callWebsocketClient(msg) {
|
|
31
|
-
(0, log_1.log)("WEBSOCKET", "client update call");
|
|
32
|
-
Array.from(connections).forEach(function (wsConnection) {
|
|
33
|
-
wsConnection.send(msg);
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
exports.callWebsocketClient = callWebsocketClient;
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Creates web socket server
|
|
4
|
+
*/
|
|
5
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.startWebsocketServer = startWebsocketServer;
|
|
10
|
+
exports.callWebsocketClient = callWebsocketClient;
|
|
11
|
+
var ws_1 = __importDefault(require("ws"));
|
|
12
|
+
var log_1 = require("./log");
|
|
13
|
+
var webSocketServerInstance = null;
|
|
14
|
+
var connections = new Set();
|
|
15
|
+
/**
|
|
16
|
+
* Start server
|
|
17
|
+
* @param port
|
|
18
|
+
*/
|
|
19
|
+
function startWebsocketServer(port) {
|
|
20
|
+
webSocketServerInstance = new ws_1.default.Server({ port: port });
|
|
21
|
+
webSocketServerInstance.on("connection", function connection(wsConnection) {
|
|
22
|
+
(0, log_1.log)("WEBSOCKET", "client connected");
|
|
23
|
+
connections.add(wsConnection);
|
|
24
|
+
});
|
|
25
|
+
webSocketServerInstance.on("close", function close(wsConnection) {
|
|
26
|
+
(0, log_1.log)("WEBSOCKET", "client disconnected");
|
|
27
|
+
connections.delete(wsConnection);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function callWebsocketClient(msg) {
|
|
31
|
+
(0, log_1.log)("WEBSOCKET", "client update call");
|
|
32
|
+
Array.from(connections).forEach(function (wsConnection) {
|
|
33
|
+
wsConnection.send(msg);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
37
36
|
//# sourceMappingURL=websocketServer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"websocketServer.js","sourceRoot":"","sources":["../src/websocketServer.ts"],"names":[],"mappings":";AAAA;;GAEG
|
|
1
|
+
{"version":3,"file":"websocketServer.js","sourceRoot":"","sources":["../src/websocketServer.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;AAcH,oDAYC;AAED,kDAKC;AA/BD,0CAA2B;AAC3B,6BAA4B;AAG5B,IAAI,uBAAuB,GAAG,IAAI,CAAC;AACnC,IAAM,WAAW,GAAG,IAAI,GAAG,EAAE,CAAC;AAG9B;;;GAGG;AACH,SAAgB,oBAAoB,CAAC,IAAY;IAC/C,uBAAuB,GAAG,IAAI,YAAS,CAAC,MAAM,CAAC,EAAE,IAAI,MAAA,EAAE,CAAC,CAAC;IAEzD,uBAAuB,CAAC,EAAE,CAAC,YAAY,EAAE,SAAS,UAAU,CAAC,YAAY;QACvE,IAAA,SAAG,EAAC,WAAW,EAAE,kBAAkB,CAAC,CAAC;QACrC,WAAW,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;IAEH,uBAAuB,CAAC,EAAE,CAAC,OAAO,EAAE,SAAS,KAAK,CAAC,YAAgB;QACjE,IAAA,SAAG,EAAC,WAAW,EAAE,qBAAqB,CAAC,CAAC;QACxC,WAAW,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,mBAAmB,CAAC,GAAW;IAC7C,IAAA,SAAG,EAAC,WAAW,EAAE,oBAAoB,CAAC,CAAC;IACvC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,UAAC,YAAiB;QAChD,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC;AACL,CAAC"}
|