tsds-web-test-runner 1.5.8 → 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/dist/cjs/command.js +40 -40
- package/dist/cjs/command.js.map +1 -1
- package/dist/esm/command.mjs +14 -17
- package/dist/esm/command.mjs.map +1 -1
- package/package.json +3 -7
package/dist/cjs/command.js
CHANGED
|
@@ -14,36 +14,35 @@ var _getoptscompat = /*#__PURE__*/ _interop_require_default(require("getopts-com
|
|
|
14
14
|
var _queuecb = /*#__PURE__*/ _interop_require_default(require("queue-cb"));
|
|
15
15
|
var _resolve = /*#__PURE__*/ _interop_require_default(require("resolve"));
|
|
16
16
|
var _tsdslib = require("tsds-lib");
|
|
17
|
-
function _define_property(obj, key, value) {
|
|
18
|
-
if (key in obj) {
|
|
19
|
-
Object.defineProperty(obj, key, {
|
|
20
|
-
value: value,
|
|
21
|
-
enumerable: true,
|
|
22
|
-
configurable: true,
|
|
23
|
-
writable: true
|
|
24
|
-
});
|
|
25
|
-
} else {
|
|
26
|
-
obj[key] = value;
|
|
27
|
-
}
|
|
28
|
-
return obj;
|
|
29
|
-
}
|
|
30
17
|
function _interop_require_default(obj) {
|
|
31
18
|
return obj && obj.__esModule ? obj : {
|
|
32
19
|
default: obj
|
|
33
20
|
};
|
|
34
21
|
}
|
|
35
|
-
function
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
22
|
+
function _object_without_properties(source, excluded) {
|
|
23
|
+
if (source == null) return {};
|
|
24
|
+
var target = _object_without_properties_loose(source, excluded);
|
|
25
|
+
var key, i;
|
|
26
|
+
if (Object.getOwnPropertySymbols) {
|
|
27
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
28
|
+
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
29
|
+
key = sourceSymbolKeys[i];
|
|
30
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
31
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
32
|
+
target[key] = source[key];
|
|
43
33
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
34
|
+
}
|
|
35
|
+
return target;
|
|
36
|
+
}
|
|
37
|
+
function _object_without_properties_loose(source, excluded) {
|
|
38
|
+
if (source == null) return {};
|
|
39
|
+
var target = {};
|
|
40
|
+
var sourceKeys = Object.keys(source);
|
|
41
|
+
var key, i;
|
|
42
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
43
|
+
key = sourceKeys[i];
|
|
44
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
45
|
+
target[key] = source[key];
|
|
47
46
|
}
|
|
48
47
|
return target;
|
|
49
48
|
}
|
|
@@ -54,34 +53,35 @@ var wtr = (0, _tsdslib.binPath)(_resolve.default.sync('@web/test-runner/package.
|
|
|
54
53
|
basedir: __dirname
|
|
55
54
|
}), 'web-test-runner');
|
|
56
55
|
var config = _path.default.resolve((0, _tsdslib.packageRoot)(__dirname), 'dist', 'esm', 'wtr.config.mjs');
|
|
57
|
-
function worker(
|
|
58
|
-
var cwd =
|
|
59
|
-
var
|
|
56
|
+
function worker(args, options, cb) {
|
|
57
|
+
var cwd = options.cwd || process.cwd();
|
|
58
|
+
var _getopts = (0, _getoptscompat.default)(args, {
|
|
60
59
|
stopEarly: true,
|
|
61
60
|
alias: {
|
|
62
61
|
config: 'c'
|
|
63
62
|
}
|
|
64
|
-
})
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
var args = [
|
|
63
|
+
}), _ = _getopts._, opts = _object_without_properties(_getopts, [
|
|
64
|
+
"_"
|
|
65
|
+
]);
|
|
66
|
+
var spawnArgs = [
|
|
69
67
|
wtr
|
|
70
68
|
];
|
|
71
|
-
Array.prototype.push.apply(
|
|
72
|
-
|
|
73
|
-
config
|
|
74
|
-
|
|
75
|
-
Array.prototype.push.apply(
|
|
69
|
+
if (!opts.config) Array.prototype.push.apply(spawnArgs, [
|
|
70
|
+
'--config',
|
|
71
|
+
config
|
|
72
|
+
]);
|
|
73
|
+
Array.prototype.push.apply(spawnArgs, args);
|
|
74
|
+
if (_.length === 0) Array.prototype.push.apply(spawnArgs, [
|
|
76
75
|
'test/**/*.test.{ts,tsx,jsx,mjs}'
|
|
77
76
|
]);
|
|
78
|
-
(0, _tsdslib.link)((0, _tsdslib.installPath)(options), function(
|
|
77
|
+
(0, _tsdslib.link)(cwd, (0, _tsdslib.installPath)(options), function(err, restore) {
|
|
78
|
+
if (err) return cb(err);
|
|
79
79
|
var queue = new _queuecb.default(1);
|
|
80
|
-
queue.defer(_tsdslib.spawn.bind(null,
|
|
80
|
+
queue.defer(_tsdslib.spawn.bind(null, spawnArgs[0], spawnArgs.slice(1), {
|
|
81
81
|
cwd: cwd
|
|
82
82
|
}));
|
|
83
83
|
queue.await(function(err) {
|
|
84
|
-
restore
|
|
84
|
+
(0, _tsdslib.unlink)(restore, function(err2) {
|
|
85
85
|
cb(err || err2);
|
|
86
86
|
});
|
|
87
87
|
});
|
package/dist/cjs/command.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["command.ts"],"sourcesContent":["import path from 'path';\nimport url from 'url';\nimport getopts from 'getopts-compat';\nimport Queue from 'queue-cb';\nimport resolve from 'resolve';\nimport { binPath, installPath, link,
|
|
1
|
+
{"version":3,"sources":["command.ts"],"sourcesContent":["import path from 'path';\nimport url from 'url';\nimport getopts from 'getopts-compat';\nimport Queue from 'queue-cb';\nimport resolve from 'resolve';\nimport { binPath, installPath, link, packageRoot, spawn, unlink, wrapWorker } from 'tsds-lib';\n\nconst __dirname = path.dirname(typeof __filename !== 'undefined' ? __filename : url.fileURLToPath(import.meta.url));\nconst major = +process.versions.node.split('.')[0];\nconst workerWrapper = wrapWorker(path.join(packageRoot(__dirname), 'dist', 'cjs', 'command.js'));\nconst wtr = binPath(resolve.sync('@web/test-runner/package.json', { basedir: __dirname }), 'web-test-runner');\nconst config = path.resolve(packageRoot(__dirname), 'dist', 'esm', 'wtr.config.mjs');\n\nfunction worker(args, options, cb) {\n const cwd = options.cwd || process.cwd();\n const { _, ...opts } = getopts(args, { stopEarly: true, alias: { config: 'c' } });\n const spawnArgs = [wtr];\n if (!opts.config) Array.prototype.push.apply(spawnArgs, ['--config', config]);\n Array.prototype.push.apply(spawnArgs, args);\n if (_.length === 0) Array.prototype.push.apply(spawnArgs, ['test/**/*.test.{ts,tsx,jsx,mjs}']);\n\n link(cwd, installPath(options), (err, restore) => {\n if (err) return cb(err);\n\n const queue = new Queue(1);\n queue.defer(spawn.bind(null, spawnArgs[0], spawnArgs.slice(1), { cwd }));\n queue.await((err) => {\n unlink(restore, (err2) => {\n cb(err || err2);\n });\n });\n });\n}\n\nexport default function testBrowser(args, options, cb) {\n major < 14 ? workerWrapper('stable', args, options, cb) : worker(args, options, cb);\n}\n"],"names":["testBrowser","__dirname","path","dirname","__filename","url","fileURLToPath","major","process","versions","node","split","workerWrapper","wrapWorker","join","packageRoot","wtr","binPath","resolve","sync","basedir","config","worker","args","options","cb","cwd","getopts","stopEarly","alias","_","opts","spawnArgs","Array","prototype","push","apply","length","link","installPath","err","restore","queue","Queue","defer","spawn","bind","slice","await","unlink","err2"],"mappings":";;;;+BAkCA;;;eAAwBA;;;2DAlCP;0DACD;oEACI;8DACF;8DACE;uBAC+D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEnF,IAAMC,YAAYC,aAAI,CAACC,OAAO,CAAC,OAAOC,eAAe,cAAcA,aAAaC,YAAG,CAACC,aAAa,CAAC;AAClG,IAAMC,QAAQ,CAACC,QAAQC,QAAQ,CAACC,IAAI,CAACC,KAAK,CAAC,IAAI,CAAC,EAAE;AAClD,IAAMC,gBAAgBC,IAAAA,mBAAU,EAACX,aAAI,CAACY,IAAI,CAACC,IAAAA,oBAAW,EAACd,YAAY,QAAQ,OAAO;AAClF,IAAMe,MAAMC,IAAAA,gBAAO,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MAAMC,SAASC;AAClF"}
|
package/dist/esm/command.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import url from 'url';
|
|
|
3
3
|
import getopts from 'getopts-compat';
|
|
4
4
|
import Queue from 'queue-cb';
|
|
5
5
|
import resolve from 'resolve';
|
|
6
|
-
import { binPath, installPath, link,
|
|
6
|
+
import { binPath, installPath, link, packageRoot, spawn, unlink, wrapWorker } from 'tsds-lib';
|
|
7
7
|
const __dirname = path.dirname(typeof __filename !== 'undefined' ? __filename : url.fileURLToPath(import.meta.url));
|
|
8
8
|
const major = +process.versions.node.split('.')[0];
|
|
9
9
|
const workerWrapper = wrapWorker(path.join(packageRoot(__dirname), 'dist', 'cjs', 'command.js'));
|
|
@@ -11,36 +11,33 @@ const wtr = binPath(resolve.sync('@web/test-runner/package.json', {
|
|
|
11
11
|
basedir: __dirname
|
|
12
12
|
}), 'web-test-runner');
|
|
13
13
|
const config = path.resolve(packageRoot(__dirname), 'dist', 'esm', 'wtr.config.mjs');
|
|
14
|
-
function worker(
|
|
15
|
-
const cwd =
|
|
16
|
-
|
|
14
|
+
function worker(args, options, cb) {
|
|
15
|
+
const cwd = options.cwd || process.cwd();
|
|
16
|
+
const { _, ...opts } = getopts(args, {
|
|
17
17
|
stopEarly: true,
|
|
18
18
|
alias: {
|
|
19
19
|
config: 'c'
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
|
-
|
|
23
|
-
options = {
|
|
24
|
-
...options
|
|
25
|
-
};
|
|
26
|
-
options.cwd = undefined;
|
|
27
|
-
const args = [
|
|
22
|
+
const spawnArgs = [
|
|
28
23
|
wtr
|
|
29
24
|
];
|
|
30
|
-
Array.prototype.push.apply(
|
|
31
|
-
|
|
25
|
+
if (!opts.config) Array.prototype.push.apply(spawnArgs, [
|
|
26
|
+
'--config',
|
|
32
27
|
config
|
|
33
|
-
|
|
34
|
-
Array.prototype.push.apply(
|
|
28
|
+
]);
|
|
29
|
+
Array.prototype.push.apply(spawnArgs, args);
|
|
30
|
+
if (_.length === 0) Array.prototype.push.apply(spawnArgs, [
|
|
35
31
|
'test/**/*.test.{ts,tsx,jsx,mjs}'
|
|
36
32
|
]);
|
|
37
|
-
link(installPath(options), (
|
|
33
|
+
link(cwd, installPath(options), (err, restore)=>{
|
|
34
|
+
if (err) return cb(err);
|
|
38
35
|
const queue = new Queue(1);
|
|
39
|
-
queue.defer(spawn.bind(null,
|
|
36
|
+
queue.defer(spawn.bind(null, spawnArgs[0], spawnArgs.slice(1), {
|
|
40
37
|
cwd
|
|
41
38
|
}));
|
|
42
39
|
queue.await((err)=>{
|
|
43
|
-
restore(
|
|
40
|
+
unlink(restore, (err2)=>{
|
|
44
41
|
cb(err || err2);
|
|
45
42
|
});
|
|
46
43
|
});
|
package/dist/esm/command.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["command.ts"],"sourcesContent":["import path from 'path';\nimport url from 'url';\nimport getopts from 'getopts-compat';\nimport Queue from 'queue-cb';\nimport resolve from 'resolve';\nimport { binPath, installPath, link,
|
|
1
|
+
{"version":3,"sources":["command.ts"],"sourcesContent":["import path from 'path';\nimport url from 'url';\nimport getopts from 'getopts-compat';\nimport Queue from 'queue-cb';\nimport resolve from 'resolve';\nimport { binPath, installPath, link, packageRoot, spawn, unlink, wrapWorker } from 'tsds-lib';\n\nconst __dirname = path.dirname(typeof __filename !== 'undefined' ? __filename : url.fileURLToPath(import.meta.url));\nconst major = +process.versions.node.split('.')[0];\nconst workerWrapper = wrapWorker(path.join(packageRoot(__dirname), 'dist', 'cjs', 'command.js'));\nconst wtr = binPath(resolve.sync('@web/test-runner/package.json', { basedir: __dirname }), 'web-test-runner');\nconst config = path.resolve(packageRoot(__dirname), 'dist', 'esm', 'wtr.config.mjs');\n\nfunction worker(args, options, cb) {\n const cwd = options.cwd || process.cwd();\n const { _, ...opts } = getopts(args, { stopEarly: true, alias: { config: 'c' } });\n const spawnArgs = [wtr];\n if (!opts.config) Array.prototype.push.apply(spawnArgs, ['--config', config]);\n Array.prototype.push.apply(spawnArgs, args);\n if (_.length === 0) Array.prototype.push.apply(spawnArgs, ['test/**/*.test.{ts,tsx,jsx,mjs}']);\n\n link(cwd, installPath(options), (err, restore) => {\n if (err) return cb(err);\n\n const queue = new Queue(1);\n queue.defer(spawn.bind(null, spawnArgs[0], spawnArgs.slice(1), { cwd }));\n queue.await((err) => {\n unlink(restore, (err2) => {\n cb(err || err2);\n });\n });\n });\n}\n\nexport default function testBrowser(args, options, cb) {\n major < 14 ? workerWrapper('stable', args, options, cb) : worker(args, options, cb);\n}\n"],"names":["path","url","getopts","Queue","resolve","binPath","installPath","link","packageRoot","spawn","unlink","wrapWorker","__dirname","dirname","__filename","fileURLToPath","major","process","versions","node","split","workerWrapper","join","wtr","sync","basedir","config","worker","args","options","cb","cwd","_","opts","stopEarly","alias","spawnArgs","Array","prototype","push","apply","length","err","restore","queue","defer","bind","slice","await","err2","testBrowser"],"mappings":"AAAA,OAAOA,UAAU,OAAO;AACxB,OAAOC,SAAS,MAAM;AACtB,OAAOC,aAAa,iBAAiB;AACrC,OAAOC,WAAW,WAAW;AAC7B,OAAOC,aAAa,UAAU;AAC9B,SAASC,OAAO,EAAEC,WAAW,EAAEC,IAAI,EAAEC,WAAW,EAAEC,KAAK,EAAEC,MAAM,EAAEC,UAAU,QAAQ,WAAW;AAE9F,MAAMC,YAAYZ,KAAKa,OAAO,CAAC,OAAOC,eAAe,cAAcA,aAAab,IAAIc,aAAa,CAAC,YAAYd,GAAG;AACjH,MAAMe,QAAQ,CAACC,QAAQC,QAAQ,CAACC,IAAI,CAACC,KAAK,CAAC,IAAI,CAAC,EAAE;AAClD,MAAMC,gBAAgBV,WAAWX,KAAKsB,IAAI,CAACd,YAAYI,YAAY,QAAQ,OAAO;AAClF,MAAMW,MAAMlB,QAAQD,QAAQoB,IAAI,CAAC,iCAAiC;IAAEC,SAASb;AAAU,IAAI;AAC3F,MAAMc,SAAS1B,KAAKI,OAAO,CAACI,YAAYI,YAAY,QAAQ,OAAO;AAEnE,SAASe,OAAOC,IAAI,EAAEC,OAAO,EAAEC,EAAE;IAC/B,MAAMC,MAAMF,QAAQE,GAAG,IAAId,QAAQc,GAAG;IACtC,MAAM,EAAEC,CAAC,EAAE,GAAGC,MAAM,GAAG/B,QAAQ0B,MAAM;QAAEM,WAAW;QAAMC,OAAO;YAAET,QAAQ;QAAI;IAAE;IAC/E,MAAMU,YAAY;QAACb;KAAI;IACvB,IAAI,CAACU,KAAKP,MAAM,EAAEW,MAAMC,SAAS,CAACC,IAAI,CAACC,KAAK,CAACJ,WAAW;QAAC;QAAYV;KAAO;IAC5EW,MAAMC,SAAS,CAACC,IAAI,CAACC,KAAK,CAACJ,WAAWR;IACtC,IAAII,EAAES,MAAM,KAAK,GAAGJ,MAAMC,SAAS,CAACC,IAAI,CAACC,KAAK,CAACJ,WAAW;QAAC;KAAkC;IAE7F7B,KAAKwB,KAAKzB,YAAYuB,UAAU,CAACa,KAAKC;QACpC,IAAID,KAAK,OAAOZ,GAAGY;QAEnB,MAAME,QAAQ,IAAIzC,MAAM;QACxByC,MAAMC,KAAK,CAACpC,MAAMqC,IAAI,CAAC,MAAMV,SAAS,CAAC,EAAE,EAAEA,UAAUW,KAAK,CAAC,IAAI;YAAEhB;QAAI;QACrEa,MAAMI,KAAK,CAAC,CAACN;YACXhC,OAAOiC,SAAS,CAACM;gBACfnB,GAAGY,OAAOO;YACZ;QACF;IACF;AACF;AAEA,eAAe,SAASC,YAAYtB,IAAI,EAAEC,OAAO,EAAEC,EAAE;IACnDd,QAAQ,KAAKK,cAAc,UAAUO,MAAMC,SAASC,MAAMH,OAAOC,MAAMC,SAASC;AAClF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tsds-web-test-runner",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "Development stack for TypeScript libraries",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"c8",
|
|
@@ -29,10 +29,6 @@
|
|
|
29
29
|
"main": "dist/cjs/index.js",
|
|
30
30
|
"module": "dist/esm/index.mjs",
|
|
31
31
|
"types": "dist/types/index.d.ts",
|
|
32
|
-
"bin": {
|
|
33
|
-
"tsds test:browser": "bin/cli.cjs",
|
|
34
|
-
"tsds-web-test-runner": "bin/cli.cjs"
|
|
35
|
-
},
|
|
36
32
|
"files": [
|
|
37
33
|
"dist",
|
|
38
34
|
"assets",
|
|
@@ -56,7 +52,7 @@
|
|
|
56
52
|
"getopts-compat": "^2.2.5",
|
|
57
53
|
"queue-cb": "^1.4.4",
|
|
58
54
|
"resolve": "^1.22.10",
|
|
59
|
-
"tsds-lib": "^1.
|
|
55
|
+
"tsds-lib": "^1.6.0",
|
|
60
56
|
"webpack-merge": "^6.0.1"
|
|
61
57
|
},
|
|
62
58
|
"devDependencies": {
|
|
@@ -72,5 +68,5 @@
|
|
|
72
68
|
"tsds": {
|
|
73
69
|
"source": "src/index.ts"
|
|
74
70
|
},
|
|
75
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "2be88a7dc0bf79560db46877f36d0a260e24b028"
|
|
76
72
|
}
|