@teamscale/javascript-instrumenter 0.1.0-beta.6 → 0.1.0-beta.7

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamscale/javascript-instrumenter",
3
- "version": "0.1.0-beta.6",
3
+ "version": "0.1.0-beta.7",
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,10 +23,10 @@
23
23
  "dist/**/*"
24
24
  ],
25
25
  "devDependencies": {
26
- "@babel/core": "^7.23.9",
26
+ "@babel/core": "^7.24.0",
27
27
  "@babel/plugin-transform-modules-commonjs": "^7.23.3",
28
- "@babel/preset-env": "^7.23.9",
29
- "@types/argparse": "^2.0.14",
28
+ "@babel/preset-env": "^7.24.0",
29
+ "@types/argparse": "^2.0.15",
30
30
  "@types/async": "^3.2.24",
31
31
  "@types/babel__generator": "^7.6.8",
32
32
  "@types/babel__traverse": "^7.20.5",
@@ -35,25 +35,25 @@
35
35
  "@types/glob": "^8.1.0",
36
36
  "@types/istanbul-lib-instrument": "^1.7.7",
37
37
  "@types/jest": "^29.5.12",
38
- "@types/node": "^20.11.19",
38
+ "@types/node": "^20.11.28",
39
39
  "@types/ws": "^8.5.10",
40
40
  "babel-jest": "^29.7.0",
41
- "esbuild": "^0.20.1",
41
+ "esbuild": "^0.20.2",
42
42
  "esbuild-plugin-inline-worker": "^0.1.1",
43
43
  "jest": "^29.7.0",
44
44
  "rimraf": "^5.0.5",
45
45
  "ts-jest": "^29.1.2",
46
46
  "ts-node": "^10.9.2",
47
47
  "tslib": "^2.6.2",
48
- "typescript": "^5.3.3"
48
+ "typescript": "^5.4.2"
49
49
  },
50
50
  "dependencies": {
51
- "@cqse/commons": "0.1.0-beta.5",
51
+ "@cqse/commons": "0.1.0-beta.6",
52
52
  "@teamscale/lib-instrument": "workspace:../lib-instrument",
53
53
  "@babel/generator": "^7.23.6",
54
- "@babel/parser": "^7.23.9",
55
- "@babel/traverse": "^7.23.9",
56
- "@babel/types": "^7.23.9",
54
+ "@babel/parser": "^7.24.0",
55
+ "@babel/traverse": "^7.24.0",
56
+ "@babel/types": "^7.24.0",
57
57
  "@types/micromatch": "^4.0.6",
58
58
  "argparse": "^2.0.1",
59
59
  "async": "^3.2.5",
package/dist/src/App.d.ts CHANGED
@@ -10,6 +10,13 @@ export declare class App {
10
10
  * Parses the command line options and the instrumentation accordingly.
11
11
  */
12
12
  static run(): Promise<TaskResult>;
13
+ /**
14
+ * Parses the command-line arguments.
15
+ *
16
+ * @param args Optional. For testing. If given, uses this as the arguments to parse and does not exit the process on errors.
17
+ * If not given, uses the NodeJS process's arguments and exits on errors.
18
+ */
19
+ static parseCommandLine(args?: string[]): ConfigurationParameters;
13
20
  /**
14
21
  * Sometimes we get inputs from shell environments where the strings are
15
22
  * still quoted. We remove those here.
@@ -1 +1 @@
1
- {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../src/App.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGtE,OAAO,EAAE,uBAAuB,EAAe,MAAM,4BAA4B,CAAC;AAKlF,OAAO,MAAM,MAAM,QAAQ,CAAC;AAG5B;;GAEG;AACH,qBAAa,GAAG;IACf;;;OAGG;WACiB,GAAG,IAAI,OAAO,CAAC,UAAU,CAAC;IAe9C;;;OAGG;WACW,iBAAiB,CAAC,MAAM,EAAE,uBAAuB,GAAG,IAAI;IAwCtE;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,WAAW;IA0D1B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,WAAW;IA+B1B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAI/B;;;;;OAKG;WACW,qBAAqB,CAAC,MAAM,EAAE,uBAAuB,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAS1G,OAAO,CAAC,MAAM,CAAC,yBAAyB;IAIxC,OAAO,CAAC,MAAM,CAAC,kBAAkB;CAajC"}
1
+ {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../src/App.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGtE,OAAO,EAAE,uBAAuB,EAAe,MAAM,4BAA4B,CAAC;AAKlF,OAAO,MAAM,MAAM,QAAQ,CAAC;AAG5B;;GAEG;AACH,qBAAa,GAAG;IACf;;;OAGG;WACiB,GAAG,IAAI,OAAO,CAAC,UAAU,CAAC;IAY9C;;;;;OAKG;WACW,gBAAgB,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,uBAAuB;IAKxE;;;OAGG;WACW,iBAAiB,CAAC,MAAM,EAAE,uBAAuB,GAAG,IAAI;IAwCtE;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,WAAW;IA0D1B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,WAAW;IA+B1B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAI/B;;;;;OAKG;WACW,qBAAqB,CAAC,MAAM,EAAE,uBAAuB,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAS1G,OAAO,CAAC,MAAM,CAAC,yBAAyB;IAIxC,OAAO,CAAC,MAAM,CAAC,kBAAkB;CAajC"}
package/dist/src/App.js CHANGED
@@ -45,10 +45,7 @@ class App {
45
45
  * Parses the command line options and the instrumentation accordingly.
46
46
  */
47
47
  static async run() {
48
- // Parsing of command line arguments:
49
- // Build the configuration object from the command line arguments.
50
- const parser = this.buildParser();
51
- const config = parser.parse_args();
48
+ const config = this.parseCommandLine();
52
49
  // Build the logger
53
50
  const logger = this.buildLogger(config);
54
51
  logger.trace('Retrieved arguments', process.argv);
@@ -56,6 +53,16 @@ class App {
56
53
  // Run the instrumenter with the given configuration.
57
54
  return this.runForConfigArguments(config, logger);
58
55
  }
56
+ /**
57
+ * Parses the command-line arguments.
58
+ *
59
+ * @param args Optional. For testing. If given, uses this as the arguments to parse and does not exit the process on errors.
60
+ * If not given, uses the NodeJS process's arguments and exits on errors.
61
+ */
62
+ static parseCommandLine(args) {
63
+ const parser = this.buildParser();
64
+ return parser.parse_args(args);
65
+ }
59
66
  /**
60
67
  * Sometimes we get inputs from shell environments where the strings are
61
68
  * still quoted. We remove those here.
@@ -105,7 +112,7 @@ class App {
105
112
  */
106
113
  static buildParser() {
107
114
  const parser = new argparse_1.ArgumentParser({
108
- description: 'Instrumenter of the Teamscale JavaScript Profiler'
115
+ description: 'Instrumenter of the Teamscale JavaScript Profiler',
109
116
  });
110
117
  parser.add_argument('-v', '--version', { action: 'version', version: package_json_1.version });
111
118
  parser.add_argument('-i', '--in-place', {
@@ -7,7 +7,7 @@ export type ConfigurationParameters = {
7
7
  to?: string;
8
8
  source_map?: string;
9
9
  collector: string;
10
- collector_pattern?: string;
10
+ relative_collector?: string;
11
11
  include_origin?: string[];
12
12
  exclude_origin?: string[];
13
13
  exclude_bundle?: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"TaskBuilder.d.ts","sourceRoot":"","sources":["../../../src/instrumenter/TaskBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,mBAAmB,EAGnB,kBAAkB,EAGlB,MAAM,QAAQ,CAAC;AAOhB,2DAA2D;AAC3D,MAAM,MAAM,uBAAuB,GAAG;IACrC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAElB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;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E,MAAM,EAAE,GAAG,SAAS,GAAG,IAAI;IAKpE,kHAAkH;IAClH,8BAA8B,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,SAAS,GAAG,IAAI;IAKpE,qHAAqH;IACrH,wBAAwB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,SAAS,GAAG,IAAI;IAK9D,yBAAyB;IACzB,UAAU,CAAC,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,iBAAiB,CAAC,EAAE,kBAAkB,GAAG,IAAI;IAKlG;;;;OAIG;IACH,aAAa,CAAC,MAAM,EAAE,uBAAuB,GAAG,IAAI;IAqCpD;;;;;;;OAOG;IACH,OAAO,CAAC,4CAA4C;IAgCpD;;;;;;OAMG;IACH,OAAO,CAAC,0BAA0B;IASlC;;OAEG;IACI,KAAK,IAAI,mBAAmB;CAUnC"}
@@ -91,7 +91,7 @@ class TaskBuilder {
91
91
  const sourceMap = config.source_map;
92
92
  this.dumpOriginsFile = config.dump_origins_to;
93
93
  this.dumpMatchedOriginsFile = config.dump_origin_matches_to;
94
- this.setCollectorFromCommandLine(config.collector, config.collector_pattern);
94
+ this.setCollectorFromCommandLine(config.collector, config.relative_collector);
95
95
  this.setOriginSourceIncludePatterns(config.include_origin);
96
96
  this.setOriginSourceExcludePatterns(config.exclude_origin);
97
97
  this.setBundleExcludePatterns(config.exclude_bundle);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamscale/javascript-instrumenter",
3
- "version": "0.1.0-beta.6",
3
+ "version": "0.1.0-beta.7",
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,10 +15,10 @@
15
15
  "dist/**/*"
16
16
  ],
17
17
  "devDependencies": {
18
- "@babel/core": "^7.23.9",
18
+ "@babel/core": "^7.24.0",
19
19
  "@babel/plugin-transform-modules-commonjs": "^7.23.3",
20
- "@babel/preset-env": "^7.23.9",
21
- "@types/argparse": "^2.0.14",
20
+ "@babel/preset-env": "^7.24.0",
21
+ "@types/argparse": "^2.0.15",
22
22
  "@types/async": "^3.2.24",
23
23
  "@types/babel__generator": "^7.6.8",
24
24
  "@types/babel__traverse": "^7.20.5",
@@ -27,24 +27,24 @@
27
27
  "@types/glob": "^8.1.0",
28
28
  "@types/istanbul-lib-instrument": "^1.7.7",
29
29
  "@types/jest": "^29.5.12",
30
- "@types/node": "^20.11.19",
30
+ "@types/node": "^20.11.28",
31
31
  "@types/ws": "^8.5.10",
32
32
  "babel-jest": "^29.7.0",
33
- "esbuild": "^0.20.1",
33
+ "esbuild": "^0.20.2",
34
34
  "esbuild-plugin-inline-worker": "^0.1.1",
35
35
  "jest": "^29.7.0",
36
36
  "rimraf": "^5.0.5",
37
37
  "ts-jest": "^29.1.2",
38
38
  "ts-node": "^10.9.2",
39
39
  "tslib": "^2.6.2",
40
- "typescript": "^5.3.3"
40
+ "typescript": "^5.4.2"
41
41
  },
42
42
  "dependencies": {
43
- "@cqse/commons": "0.1.0-beta.5",
43
+ "@cqse/commons": "0.1.0-beta.6",
44
44
  "@babel/generator": "^7.23.6",
45
- "@babel/parser": "^7.23.9",
46
- "@babel/traverse": "^7.23.9",
47
- "@babel/types": "^7.23.9",
45
+ "@babel/parser": "^7.24.0",
46
+ "@babel/traverse": "^7.24.0",
47
+ "@babel/types": "^7.24.0",
48
48
  "@types/micromatch": "^4.0.6",
49
49
  "argparse": "^2.0.1",
50
50
  "async": "^3.2.5",
@@ -58,7 +58,7 @@
58
58
  "typescript-optional": "^2.0.1",
59
59
  "unload": "^2.4.1",
60
60
  "web-worker": "^1.3.0",
61
- "@teamscale/lib-instrument": "0.1.0-beta.6"
61
+ "@teamscale/lib-instrument": "0.1.0-beta.7"
62
62
  },
63
63
  "publishConfig": {
64
64
  "access": "public"