@temporalio/nyc-test-coverage 1.5.1 → 1.6.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/lib/index.d.ts +2 -3
- package/lib/index.js +16 -10
- package/lib/index.js.map +1 -1
- package/lib/loader.d.ts +3 -0
- package/lib/loader.js +39 -0
- package/lib/loader.js.map +1 -0
- package/package.json +11 -7
- package/src/index.ts +13 -11
- package/src/loader.ts +23 -0
package/lib/index.d.ts
CHANGED
|
@@ -36,10 +36,9 @@ export declare class WorkflowCoverage {
|
|
|
36
36
|
*/
|
|
37
37
|
get sinks(): InjectedSinks<CoverageSinks>;
|
|
38
38
|
/**
|
|
39
|
-
* Modify the given Worker config to auto instrument
|
|
40
|
-
* code using istanbul-instrumenter-loader
|
|
39
|
+
* Modify the given Worker config to auto instrument Workflows
|
|
41
40
|
*/
|
|
42
|
-
addInstrumenterRule(
|
|
41
|
+
addInstrumenterRule(config: WebpackConfigType): WebpackConfigType;
|
|
43
42
|
/**
|
|
44
43
|
* Merge this WorkflowCoverage's coverage map into the global coverage
|
|
45
44
|
* map data `global.__coverage__`.
|
package/lib/index.js
CHANGED
|
@@ -22,8 +22,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
25
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
29
|
exports.WorkflowCoverage = void 0;
|
|
30
|
+
const path_1 = __importDefault(require("path"));
|
|
27
31
|
const libCoverage = __importStar(require("istanbul-lib-coverage"));
|
|
28
32
|
class WorkflowCoverage {
|
|
29
33
|
constructor() {
|
|
@@ -45,7 +49,6 @@ class WorkflowCoverage {
|
|
|
45
49
|
if (!this.hasCoverageGlobal()) {
|
|
46
50
|
return workerOptions;
|
|
47
51
|
}
|
|
48
|
-
const workflowsPath = workerOptions.workflowsPath;
|
|
49
52
|
return {
|
|
50
53
|
...workerOptions,
|
|
51
54
|
interceptors: {
|
|
@@ -59,7 +62,7 @@ class WorkflowCoverage {
|
|
|
59
62
|
bundlerOptions: {
|
|
60
63
|
...workerOptions.bundlerOptions,
|
|
61
64
|
webpackConfigHook: (config) => {
|
|
62
|
-
config = this.addInstrumenterRule(
|
|
65
|
+
config = this.addInstrumenterRule(config);
|
|
63
66
|
const existingWebpackConfigHook = workerOptions?.bundlerOptions?.webpackConfigHook;
|
|
64
67
|
if (existingWebpackConfigHook !== undefined) {
|
|
65
68
|
return existingWebpackConfigHook(config);
|
|
@@ -81,12 +84,11 @@ class WorkflowCoverage {
|
|
|
81
84
|
if (!this.hasCoverageGlobal()) {
|
|
82
85
|
return bundleOptions;
|
|
83
86
|
}
|
|
84
|
-
const workflowsPath = bundleOptions.workflowsPath;
|
|
85
87
|
return {
|
|
86
88
|
...bundleOptions,
|
|
87
89
|
workflowInterceptorModules: [...(bundleOptions.workflowInterceptorModules || []), this.interceptorModule],
|
|
88
90
|
webpackConfigHook: (config) => {
|
|
89
|
-
config = this.addInstrumenterRule(
|
|
91
|
+
config = this.addInstrumenterRule(config);
|
|
90
92
|
const existingWebpackConfigHook = bundleOptions.webpackConfigHook;
|
|
91
93
|
if (existingWebpackConfigHook !== undefined) {
|
|
92
94
|
return existingWebpackConfigHook(config);
|
|
@@ -136,20 +138,24 @@ class WorkflowCoverage {
|
|
|
136
138
|
};
|
|
137
139
|
}
|
|
138
140
|
/**
|
|
139
|
-
* Modify the given Worker config to auto instrument
|
|
140
|
-
* code using istanbul-instrumenter-loader
|
|
141
|
+
* Modify the given Worker config to auto instrument Workflows
|
|
141
142
|
*/
|
|
142
|
-
addInstrumenterRule(
|
|
143
|
+
addInstrumenterRule(config) {
|
|
143
144
|
if (!this.hasCoverageGlobal()) {
|
|
144
145
|
return config;
|
|
145
146
|
}
|
|
146
147
|
const newRule = {
|
|
147
148
|
use: {
|
|
148
|
-
loader: require.resolve('
|
|
149
|
-
options: { esModules: true },
|
|
149
|
+
loader: require.resolve('./loader'),
|
|
150
150
|
},
|
|
151
151
|
enforce: 'post',
|
|
152
|
-
|
|
152
|
+
test: /\.js$/,
|
|
153
|
+
exclude: [
|
|
154
|
+
/\/node_modules\//,
|
|
155
|
+
path_1.default.dirname(require.resolve('@temporalio/common')),
|
|
156
|
+
path_1.default.dirname(require.resolve('@temporalio/workflow')),
|
|
157
|
+
path_1.default.dirname(require.resolve('@temporalio/nyc-test-coverage')),
|
|
158
|
+
],
|
|
153
159
|
};
|
|
154
160
|
return {
|
|
155
161
|
...config,
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAwB;AACxB,mEAAqD;AAOrD,MAAa,gBAAgB;IAA7B;QACE,gBAAW,GAAG,WAAW,CAAC,iBAAiB,EAAE,CAAC;IA2LhD,CAAC;IAzLC,kEAAkE;IAClE,sDAAsD;IAC9C,iBAAiB;QACvB,OAAO,cAAc,IAAI,MAAM,CAAC;IAClC,CAAC;IAED;;;OAGG;IACH,oBAAoB,CAClB,aAA6F;QAE7F,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE;YAChC,MAAM,IAAI,SAAS,CAAC,6EAA6E,CAAC,CAAC;SACpG;QAED,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,EAAE;YAC7B,OAAO,aAAa,CAAC;SACtB;QAED,OAAO;YACL,GAAG,aAAa;YAChB,YAAY,EAAE;gBACZ,GAAG,aAAa,CAAC,YAAY;gBAC7B,eAAe,EAAE,CAAC,GAAG,CAAC,aAAa,EAAE,YAAY,EAAE,eAAe,IA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F,CAAC;QAEF,OAAO;YACL,GAAG,MAAM;YACT,MAAM,EAAE;gBACN,GAAG,MAAM,EAAE,MAAM;gBACjB,KAAK,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,EAAE,CAAC,EAAE,OAAO,CAAC;aACnD;SACF,CAAC;IACJ,CAAC;IAED;;;OAGG;IACH,uBAAuB;QACrB,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,EAAE;YAC7B,OAAO;SACR;QAED,sDAAsD;QACtD,aAAa;QACb,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QAE5C,MAAM,eAAe,GAAgC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,MAAM,CAC5F,CAAC,GAAgC,EAAE,IAAI,EAAE,EAAE;YACzC,MAAM,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAA6B,CAAC;YAE7E,GAAG,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,IAAI,CAAC;YAC9B,OAAO,GAAG,CAAC;QACb,CAAC,EACD,EAAE,CACH,CAAC;QAEF,aAAa;QACb,MAAM,CAAC,YAAY,GAAG,eAAe,CAAC;IACxC,CAAC;CACF;AA5LD,4CA4LC"}
|
package/lib/loader.d.ts
ADDED
package/lib/loader.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
const istanbul_lib_instrument_1 = require("istanbul-lib-instrument");
|
|
27
|
+
const convert = __importStar(require("convert-source-map"));
|
|
28
|
+
const instrumentWithIstanbulLoader = function (source, sourceMap) {
|
|
29
|
+
const srcMap = sourceMap ?? convert.fromSource(source)?.sourcemap;
|
|
30
|
+
const instrumenter = (0, istanbul_lib_instrument_1.createInstrumenter)({
|
|
31
|
+
esModules: true,
|
|
32
|
+
produceSourceMap: true,
|
|
33
|
+
});
|
|
34
|
+
instrumenter.instrument(source, this.resourcePath, (error, instrumentedSource) => {
|
|
35
|
+
this.callback(error, instrumentedSource, instrumenter.lastSourceMap());
|
|
36
|
+
}, srcMap);
|
|
37
|
+
};
|
|
38
|
+
exports.default = instrumentWithIstanbulLoader;
|
|
39
|
+
//# sourceMappingURL=loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qEAA6D;AAC7D,4DAA8C;AAG9C,MAAM,4BAA4B,GAA6B,UAAU,MAAM,EAAE,SAAS;IACxF,MAAM,MAAM,GAAG,SAAS,IAAI,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC;IAElE,MAAM,YAAY,GAAG,IAAA,4CAAkB,EAAC;QACtC,SAAS,EAAE,IAAI;QACf,gBAAgB,EAAE,IAAI;KACvB,CAAC,CAAC;IAEH,YAAY,CAAC,UAAU,CACrB,MAAM,EACN,IAAI,CAAC,YAAY,EACjB,CAAC,KAAK,EAAE,kBAAkB,EAAE,EAAE;QAC5B,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,kBAAkB,EAAE,YAAY,CAAC,aAAa,EAAS,CAAC,CAAC;IAChF,CAAC,EACD,MAAa,CACd,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,4BAA4B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@temporalio/nyc-test-coverage",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "Temporal.io SDK code coverage integration",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"temporal",
|
|
@@ -21,16 +21,20 @@
|
|
|
21
21
|
"src"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@temporalio/worker": "
|
|
25
|
-
"@temporalio/workflow": "
|
|
26
|
-
"
|
|
27
|
-
"istanbul-lib-coverage": "^3.2.0"
|
|
24
|
+
"@temporalio/worker": "1.6.0",
|
|
25
|
+
"@temporalio/workflow": "1.6.0",
|
|
26
|
+
"convert-source-map": "^2.0.0",
|
|
27
|
+
"istanbul-lib-coverage": "^3.2.0",
|
|
28
|
+
"istanbul-lib-instrument": "^5.2.1"
|
|
28
29
|
},
|
|
29
30
|
"devDependencies": {
|
|
30
|
-
"@types/
|
|
31
|
+
"@types/convert-source-map": "^2.0.0",
|
|
32
|
+
"@types/istanbul-lib-coverage": "^2.0.4",
|
|
33
|
+
"@types/istanbul-lib-instrument": "^1.7.4",
|
|
34
|
+
"@types/webpack": "^5.28.0"
|
|
31
35
|
},
|
|
32
36
|
"publishConfig": {
|
|
33
37
|
"access": "public"
|
|
34
38
|
},
|
|
35
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "49c6b1341daef2b94a0a989d515cbf97b8b02fa7"
|
|
36
40
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import path from 'path';
|
|
1
2
|
import * as libCoverage from 'istanbul-lib-coverage';
|
|
2
3
|
import { InjectedSinks, BundleOptions, WorkerOptions } from '@temporalio/worker';
|
|
3
4
|
import { CoverageSinks } from './sinks';
|
|
@@ -29,8 +30,6 @@ export class WorkflowCoverage {
|
|
|
29
30
|
return workerOptions;
|
|
30
31
|
}
|
|
31
32
|
|
|
32
|
-
const workflowsPath = workerOptions.workflowsPath;
|
|
33
|
-
|
|
34
33
|
return {
|
|
35
34
|
...workerOptions,
|
|
36
35
|
interceptors: {
|
|
@@ -44,7 +43,7 @@ export class WorkflowCoverage {
|
|
|
44
43
|
bundlerOptions: {
|
|
45
44
|
...workerOptions.bundlerOptions,
|
|
46
45
|
webpackConfigHook: (config: WebpackConfigType) => {
|
|
47
|
-
config = this.addInstrumenterRule(
|
|
46
|
+
config = this.addInstrumenterRule(config);
|
|
48
47
|
|
|
49
48
|
const existingWebpackConfigHook = workerOptions?.bundlerOptions?.webpackConfigHook;
|
|
50
49
|
if (existingWebpackConfigHook !== undefined) {
|
|
@@ -73,12 +72,11 @@ export class WorkflowCoverage {
|
|
|
73
72
|
return bundleOptions;
|
|
74
73
|
}
|
|
75
74
|
|
|
76
|
-
const workflowsPath = bundleOptions.workflowsPath;
|
|
77
75
|
return {
|
|
78
76
|
...bundleOptions,
|
|
79
77
|
workflowInterceptorModules: [...(bundleOptions.workflowInterceptorModules || []), this.interceptorModule],
|
|
80
78
|
webpackConfigHook: (config: WebpackConfigType) => {
|
|
81
|
-
config = this.addInstrumenterRule(
|
|
79
|
+
config = this.addInstrumenterRule(config);
|
|
82
80
|
|
|
83
81
|
const existingWebpackConfigHook = bundleOptions.webpackConfigHook;
|
|
84
82
|
if (existingWebpackConfigHook !== undefined) {
|
|
@@ -140,21 +138,25 @@ export class WorkflowCoverage {
|
|
|
140
138
|
}
|
|
141
139
|
|
|
142
140
|
/**
|
|
143
|
-
* Modify the given Worker config to auto instrument
|
|
144
|
-
* code using istanbul-instrumenter-loader
|
|
141
|
+
* Modify the given Worker config to auto instrument Workflows
|
|
145
142
|
*/
|
|
146
|
-
addInstrumenterRule(
|
|
143
|
+
addInstrumenterRule(config: WebpackConfigType): WebpackConfigType {
|
|
147
144
|
if (!this.hasCoverageGlobal()) {
|
|
148
145
|
return config;
|
|
149
146
|
}
|
|
150
147
|
|
|
151
148
|
const newRule = {
|
|
152
149
|
use: {
|
|
153
|
-
loader: require.resolve('
|
|
154
|
-
options: { esModules: true },
|
|
150
|
+
loader: require.resolve('./loader'),
|
|
155
151
|
},
|
|
156
152
|
enforce: 'post' as const,
|
|
157
|
-
|
|
153
|
+
test: /\.js$/,
|
|
154
|
+
exclude: [
|
|
155
|
+
/\/node_modules\//,
|
|
156
|
+
path.dirname(require.resolve('@temporalio/common')),
|
|
157
|
+
path.dirname(require.resolve('@temporalio/workflow')),
|
|
158
|
+
path.dirname(require.resolve('@temporalio/nyc-test-coverage')),
|
|
159
|
+
],
|
|
158
160
|
};
|
|
159
161
|
|
|
160
162
|
return {
|
package/src/loader.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createInstrumenter } from 'istanbul-lib-instrument';
|
|
2
|
+
import * as convert from 'convert-source-map';
|
|
3
|
+
import type { LoaderDefinitionFunction } from 'webpack';
|
|
4
|
+
|
|
5
|
+
const instrumentWithIstanbulLoader: LoaderDefinitionFunction = function (source, sourceMap): void {
|
|
6
|
+
const srcMap = sourceMap ?? convert.fromSource(source)?.sourcemap;
|
|
7
|
+
|
|
8
|
+
const instrumenter = createInstrumenter({
|
|
9
|
+
esModules: true,
|
|
10
|
+
produceSourceMap: true,
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
instrumenter.instrument(
|
|
14
|
+
source,
|
|
15
|
+
this.resourcePath,
|
|
16
|
+
(error, instrumentedSource) => {
|
|
17
|
+
this.callback(error, instrumentedSource, instrumenter.lastSourceMap() as any);
|
|
18
|
+
},
|
|
19
|
+
srcMap as any
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default instrumentWithIstanbulLoader;
|