@teamscale/javascript-instrumenter 0.0.1-beta.59 → 0.0.1-beta.60
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/package.json +28 -28
- package/dist/vaccine.js +1 -1
- package/package.json +29 -29
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teamscale/javascript-instrumenter",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.60",
|
|
4
4
|
"description": "JavaScript coverage instrumenter with coverage forwarding to a collector process",
|
|
5
5
|
"main": "dist/src/main.js",
|
|
6
6
|
"bin": "dist/src/main.js",
|
|
@@ -23,44 +23,44 @@
|
|
|
23
23
|
"dist/**/*"
|
|
24
24
|
],
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@babel/core": "^7.
|
|
27
|
-
"@babel/plugin-transform-modules-commonjs": "^7.
|
|
28
|
-
"@babel/preset-env": "^7.
|
|
29
|
-
"@types/argparse": "^2.0.
|
|
30
|
-
"@types/async": "^3.2.
|
|
31
|
-
"@types/babel__generator": "^7.6.
|
|
32
|
-
"@types/babel__traverse": "^7.20.
|
|
33
|
-
"@types/bunyan": "^1.8.
|
|
34
|
-
"@types/convert-source-map": "^2.0.
|
|
26
|
+
"@babel/core": "^7.23.2",
|
|
27
|
+
"@babel/plugin-transform-modules-commonjs": "^7.23.0",
|
|
28
|
+
"@babel/preset-env": "^7.23.2",
|
|
29
|
+
"@types/argparse": "^2.0.12",
|
|
30
|
+
"@types/async": "^3.2.22",
|
|
31
|
+
"@types/babel__generator": "^7.6.6",
|
|
32
|
+
"@types/babel__traverse": "^7.20.3",
|
|
33
|
+
"@types/bunyan": "^1.8.10",
|
|
34
|
+
"@types/convert-source-map": "^2.0.2",
|
|
35
35
|
"@types/glob": "^8.1.0",
|
|
36
|
-
"@types/istanbul-lib-instrument": "^1.7.
|
|
37
|
-
"@types/jest": "^29.5.
|
|
38
|
-
"@types/node": "^20.
|
|
39
|
-
"@types/ws": "^8.5.
|
|
40
|
-
"babel-jest": "^29.
|
|
41
|
-
"esbuild": "^0.
|
|
36
|
+
"@types/istanbul-lib-instrument": "^1.7.6",
|
|
37
|
+
"@types/jest": "^29.5.6",
|
|
38
|
+
"@types/node": "^20.8.6",
|
|
39
|
+
"@types/ws": "^8.5.7",
|
|
40
|
+
"babel-jest": "^29.7.0",
|
|
41
|
+
"esbuild": "^0.19.5",
|
|
42
42
|
"esbuild-plugin-inline-worker": "^0.1.1",
|
|
43
|
-
"jest": "^29.
|
|
44
|
-
"rimraf": "^5.0.
|
|
43
|
+
"jest": "^29.7.0",
|
|
44
|
+
"rimraf": "^5.0.5",
|
|
45
45
|
"ts-jest": "^29.1.1",
|
|
46
46
|
"ts-node": "^10.9.1",
|
|
47
|
-
"tslib": "^2.6.
|
|
48
|
-
"typescript": "^5.
|
|
47
|
+
"tslib": "^2.6.2",
|
|
48
|
+
"typescript": "^5.2.2"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@babel/generator": "^7.
|
|
52
|
-
"@babel/parser": "^7.
|
|
53
|
-
"@babel/traverse": "^7.
|
|
54
|
-
"@babel/types": "^7.
|
|
55
|
-
"@cqse/commons": "
|
|
56
|
-
"@types/micromatch": "^4.0.
|
|
51
|
+
"@babel/generator": "^7.23.0",
|
|
52
|
+
"@babel/parser": "^7.23.0",
|
|
53
|
+
"@babel/traverse": "^7.23.2",
|
|
54
|
+
"@babel/types": "^7.23.0",
|
|
55
|
+
"@cqse/commons": "0.0.1-beta.59",
|
|
56
|
+
"@types/micromatch": "^4.0.3",
|
|
57
57
|
"argparse": "^2.0.1",
|
|
58
58
|
"async": "^3.2.4",
|
|
59
59
|
"bunyan": "^1.8.15",
|
|
60
60
|
"convert-source-map": "^2.0.0",
|
|
61
61
|
"foreground-child": "^3.1.1",
|
|
62
|
-
"glob": "^10.3.
|
|
63
|
-
"istanbul-lib-instrument": "^
|
|
62
|
+
"glob": "^10.3.10",
|
|
63
|
+
"istanbul-lib-instrument": "^6.0.1",
|
|
64
64
|
"micromatch": "4.0.5",
|
|
65
65
|
"mkdirp": "^3.0.1",
|
|
66
66
|
"source-map": "0.7.4",
|
package/dist/vaccine.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{function d(e){let n=new Blob([e],{type:"text/javascript"}),t=URL.createObjectURL(n),r=new Worker(t);return URL.revokeObjectURL(t),r}function f(){return d('var r=class{constructor(e){this.cachedMessages=[];this.url=e,this.socket=this.createSocket()}createSocket(){let e=new WebSocket(this.url);return e.onopen=()=>this.onopen(),e.onclose=()=>this.onclose(),e}onclose(){this.socket=this.createSocket()}onopen(){console.log("Connection to Coverage Collector established."),this.cachedMessages.forEach(e=>this.socket.send(e)),this.cachedMessages=[]}send(e){this.socket.readyState===WebSocket.OPEN?this.socket.send(e):(this.cachedMessages.push(e),this.cachedMessages.length%500===0&&console.log(`More than ${this.cachedMessages.length} messages are queued to be sent.`))}};var C=20,m=1e3,d=class{constructor(e,t){this.milliseconds=e;this.onCountedToZero=t;this.timerHandle=null}restartCountdown(){this.stopCountdown(),this.timerHandle=self.setTimeout(()=>{this.stopCountdown(),this.onCountedToZero()},this.milliseconds)}stopCountdown(){this.timerHandle!==null&&(self.clearTimeout(this.timerHandle),this.timerHandle=null)}},a=class{constructor(e){this.socket=e,this.cachedCoveredRanges=new Map,this.numberOfCachedPositions=0,this.flushCountdown=new d(m,()=>this.flush())}addRange(e,t){if(!t.start.line||!t.end.line)return;let o=this.cachedCoveredRanges.get(e);o||(o=new Set,this.cachedCoveredRanges.set(e,o)),o.add(t),this.numberOfCachedPositions+=1,this.flushCountdown.restartCountdown(),this.numberOfCachedPositions>=C&&this.flush()}flush(){this.numberOfCachedPositions!==0&&(this.flushCountdown.stopCountdown(),this.cachedCoveredRanges.forEach((e,t)=>{let o=Array.from(e).map(n=>`${n.start.line}:${n.start.column}:${n.end.line}:${n.end.column}`);this.socket.send(
|
|
1
|
+
"use strict";(()=>{function d(e){let n=new Blob([e],{type:"text/javascript"}),t=URL.createObjectURL(n),r=new Worker(t);return URL.revokeObjectURL(t),r}function f(){return d('var r=class{constructor(e){this.cachedMessages=[];this.url=e,this.socket=this.createSocket()}createSocket(){let e=new WebSocket(this.url);return e.onopen=()=>this.onopen(),e.onclose=()=>this.onclose(),e}onclose(){this.socket=this.createSocket()}onopen(){console.log("Connection to Coverage Collector established."),this.cachedMessages.forEach(e=>this.socket.send(e)),this.cachedMessages=[]}send(e){this.socket.readyState===WebSocket.OPEN?this.socket.send(e):(this.cachedMessages.push(e),this.cachedMessages.length%500===0&&console.log(`More than ${this.cachedMessages.length} messages are queued to be sent.`))}};var C=20,m=1e3,d=class{constructor(e,t){this.milliseconds=e;this.onCountedToZero=t;this.timerHandle=null}restartCountdown(){this.stopCountdown(),this.timerHandle=self.setTimeout(()=>{this.stopCountdown(),this.onCountedToZero()},this.milliseconds)}stopCountdown(){this.timerHandle!==null&&(self.clearTimeout(this.timerHandle),this.timerHandle=null)}},a=class{constructor(e){this.socket=e,this.cachedCoveredRanges=new Map,this.numberOfCachedPositions=0,this.flushCountdown=new d(m,()=>this.flush())}addRange(e,t){if(!t.start.line||!t.end.line)return;let o=this.cachedCoveredRanges.get(e);o||(o=new Set,this.cachedCoveredRanges.set(e,o)),o.add(t),this.numberOfCachedPositions+=1,this.flushCountdown.restartCountdown(),this.numberOfCachedPositions>=C&&this.flush()}flush(){this.numberOfCachedPositions!==0&&(this.flushCountdown.stopCountdown(),this.cachedCoveredRanges.forEach((e,t)=>{let o=Array.from(e).map(n=>`${n.start.line}:${n.start.column}:${n.end.line}:${n.end.column}`);this.socket.send(`c ${t} ${o.join(" ")}`),e.clear()}),this.cachedCoveredRanges.clear(),this.numberOfCachedPositions=0)}};console.log("Starting coverage forwarding worker.");var u=new r("$REPORT_TO_URL/socket"),h=new a(u),f=new Map;onmessage=s=>{if(Array.isArray(s.data))p(s.data);else{let e=s.data;if(e.startsWith("s"))u.send(e);else if(e.startsWith("i")){let t=JSON.parse(e.substring(2));f.set(t.hash,t),console.info(`Received coverage mapping information for "${t.hash}".`)}else e==="unload"?h.flush():console.error(`No handler for message: ${e}`)}};function p(s){var n;let e=s[0],t=s[1],o=f.get(e);if(!o){console.log(`No coverage mapping information for ${e} available!`);return}for(let[c,i]of t.branches.entries()){let l=(n=o.branchMap[c])==null?void 0:n.locations[i];l&&h.addRange(e,l)}for(let c of t.statements){let i=o.statementMap[c];i&&h.addRange(e,i)}}\n')}function u(){return h()}function h(){return window}function g(e,n){let t=u()[e];return t||(t=n,u()[e]=t),t}function m(e,n){let t=new Map;function r(s){let o=t.get(s);return o||(o={branches:new Map,statements:new Set},t.set(s,o),o)}function l(s,o,b){r(s).branches.set(o,b)}function a(s,o){r(s).statements.add(o)}function i(){n(t),t.clear()}return setInterval(()=>i(),e),{putBranchCoverage:l,putStatementCoverage:a,flush:i}}var v=g("__TS_AGENT",{});function c(){return v._$BcWorker}function w(e){return v._$BcWorker=e,e}var p=m(250,e=>{for(let n of e.entries())c().postMessage(n)});u()._$stmtCov=p.putStatementCoverage;u()._$brCov=p.putBranchCoverage;var C=new Set;u()._$registerCoverageObject=function(e){let n=e.hash;if(C.has(n)){console.log(`Coverage interceptor added twice for ${n}. This seems to be a bug in the instrumentation.`);return}else C.add(n);if(!c()){let t=w(new f);(function(){let l=()=>{p.flush(),t.postMessage("unload")},a=function(s,o){o&&o.addEventListener(s,l,{capture:!0})},i=h();a("blur",i),a("unload",i),a("visibilitychange",i),a("beforeunload",i)})()}(function(){c().postMessage(`i ${JSON.stringify(e)}`);let r=g("sentMaps",new Set);e.inputSourceMap&&(r.has(e.path)||(c().postMessage(`s ${n}:${JSON.stringify(e.inputSourceMap)}`),r.add(e.path)))})()};})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teamscale/javascript-instrumenter",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.60",
|
|
4
4
|
"description": "JavaScript coverage instrumenter with coverage forwarding to a collector process",
|
|
5
5
|
"main": "dist/src/main.js",
|
|
6
6
|
"bin": "dist/src/main.js",
|
|
@@ -15,50 +15,50 @@
|
|
|
15
15
|
"dist/**/*"
|
|
16
16
|
],
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@babel/core": "^7.
|
|
19
|
-
"@babel/plugin-transform-modules-commonjs": "^7.
|
|
20
|
-
"@babel/preset-env": "^7.
|
|
21
|
-
"@types/argparse": "^2.0.
|
|
22
|
-
"@types/async": "^3.2.
|
|
23
|
-
"@types/babel__generator": "^7.6.
|
|
24
|
-
"@types/babel__traverse": "^7.20.
|
|
25
|
-
"@types/bunyan": "^1.8.
|
|
26
|
-
"@types/convert-source-map": "^2.0.
|
|
18
|
+
"@babel/core": "^7.23.2",
|
|
19
|
+
"@babel/plugin-transform-modules-commonjs": "^7.23.0",
|
|
20
|
+
"@babel/preset-env": "^7.23.2",
|
|
21
|
+
"@types/argparse": "^2.0.12",
|
|
22
|
+
"@types/async": "^3.2.22",
|
|
23
|
+
"@types/babel__generator": "^7.6.6",
|
|
24
|
+
"@types/babel__traverse": "^7.20.3",
|
|
25
|
+
"@types/bunyan": "^1.8.10",
|
|
26
|
+
"@types/convert-source-map": "^2.0.2",
|
|
27
27
|
"@types/glob": "^8.1.0",
|
|
28
|
-
"@types/istanbul-lib-instrument": "^1.7.
|
|
29
|
-
"@types/jest": "^29.5.
|
|
30
|
-
"@types/node": "^20.
|
|
31
|
-
"@types/ws": "^8.5.
|
|
32
|
-
"babel-jest": "^29.
|
|
33
|
-
"esbuild": "^0.
|
|
28
|
+
"@types/istanbul-lib-instrument": "^1.7.6",
|
|
29
|
+
"@types/jest": "^29.5.6",
|
|
30
|
+
"@types/node": "^20.8.6",
|
|
31
|
+
"@types/ws": "^8.5.7",
|
|
32
|
+
"babel-jest": "^29.7.0",
|
|
33
|
+
"esbuild": "^0.19.5",
|
|
34
34
|
"esbuild-plugin-inline-worker": "^0.1.1",
|
|
35
|
-
"jest": "^29.
|
|
36
|
-
"rimraf": "^5.0.
|
|
35
|
+
"jest": "^29.7.0",
|
|
36
|
+
"rimraf": "^5.0.5",
|
|
37
37
|
"ts-jest": "^29.1.1",
|
|
38
38
|
"ts-node": "^10.9.1",
|
|
39
|
-
"tslib": "^2.6.
|
|
40
|
-
"typescript": "^5.
|
|
39
|
+
"tslib": "^2.6.2",
|
|
40
|
+
"typescript": "^5.2.2"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@babel/generator": "^7.
|
|
44
|
-
"@babel/parser": "^7.
|
|
45
|
-
"@babel/traverse": "^7.
|
|
46
|
-
"@babel/types": "^7.
|
|
47
|
-
"@
|
|
43
|
+
"@babel/generator": "^7.23.0",
|
|
44
|
+
"@babel/parser": "^7.23.0",
|
|
45
|
+
"@babel/traverse": "^7.23.2",
|
|
46
|
+
"@babel/types": "^7.23.0",
|
|
47
|
+
"@cqse/commons": "0.0.1-beta.59",
|
|
48
|
+
"@types/micromatch": "^4.0.3",
|
|
48
49
|
"argparse": "^2.0.1",
|
|
49
50
|
"async": "^3.2.4",
|
|
50
51
|
"bunyan": "^1.8.15",
|
|
51
52
|
"convert-source-map": "^2.0.0",
|
|
52
53
|
"foreground-child": "^3.1.1",
|
|
53
|
-
"glob": "^10.3.
|
|
54
|
-
"istanbul-lib-instrument": "^
|
|
54
|
+
"glob": "^10.3.10",
|
|
55
|
+
"istanbul-lib-instrument": "^6.0.1",
|
|
55
56
|
"micromatch": "4.0.5",
|
|
56
57
|
"mkdirp": "^3.0.1",
|
|
57
58
|
"source-map": "0.7.4",
|
|
58
59
|
"typescript-optional": "^2.0.1",
|
|
59
60
|
"unload": "^2.4.1",
|
|
60
|
-
"web-worker": "^1.2.0"
|
|
61
|
-
"@cqse/commons": "0.0.1-beta.59"
|
|
61
|
+
"web-worker": "^1.2.0"
|
|
62
62
|
},
|
|
63
63
|
"publishConfig": {
|
|
64
64
|
"access": "public"
|