@donmahallem/lerna2codecov 0.1.3 → 0.1.6
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/index.js +54 -52
- package/dist/cjs/index.js.map +1 -1
- package/dist/cli/cli.js +123 -121
- package/dist/cli/cli.js.map +1 -1
- package/dist/esm/index.js +54 -52
- package/dist/esm/index.js.map +1 -1
- package/dist/types/cli.d.ts +1 -1
- package/dist/types/codecov-config.d.ts +13 -13
- package/dist/types/index.d.ts +2 -2
- package/dist/types/update-command.d.ts +8 -8
- package/dist/types/update-config.d.ts +12 -12
- package/dist/types/update.d.ts +6 -6
- package/package.json +4 -4
package/dist/esm/index.js
CHANGED
|
@@ -7238,7 +7238,7 @@ function getChalk(options) {
|
|
|
7238
7238
|
}
|
|
7239
7239
|
|
|
7240
7240
|
function highlight(code, options = {}) {
|
|
7241
|
-
if (shouldHighlight(options)) {
|
|
7241
|
+
if (code !== "" && shouldHighlight(options)) {
|
|
7242
7242
|
const chalk = getChalk(options);
|
|
7243
7243
|
const defs = getDefs$1(chalk);
|
|
7244
7244
|
return highlightTokens(defs, code);
|
|
@@ -7710,7 +7710,9 @@ const processOk = function (process) {
|
|
|
7710
7710
|
// some kind of non-node environment, just no-op
|
|
7711
7711
|
/* istanbul ignore if */
|
|
7712
7712
|
if (!processOk(process$1)) {
|
|
7713
|
-
signalExit.exports = function () {
|
|
7713
|
+
signalExit.exports = function () {
|
|
7714
|
+
return function () {}
|
|
7715
|
+
};
|
|
7714
7716
|
} else {
|
|
7715
7717
|
var assert = require$$5$1;
|
|
7716
7718
|
var signals = signals$1.exports;
|
|
@@ -7743,7 +7745,7 @@ if (!processOk(process$1)) {
|
|
|
7743
7745
|
signalExit.exports = function (cb, opts) {
|
|
7744
7746
|
/* istanbul ignore if */
|
|
7745
7747
|
if (!processOk(commonjsGlobal.process)) {
|
|
7746
|
-
return
|
|
7748
|
+
return function () {}
|
|
7747
7749
|
}
|
|
7748
7750
|
assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler');
|
|
7749
7751
|
|
|
@@ -10445,57 +10447,57 @@ class Package {
|
|
|
10445
10447
|
|
|
10446
10448
|
var Package_1 = Package;
|
|
10447
10449
|
|
|
10448
|
-
/*
|
|
10449
|
-
* Package @donmahallem/lerna2codecov
|
|
10450
|
-
* Source https://github.com/donmahallem/js-libs/tree/master/packages/lerna2codecov
|
|
10451
|
-
*/
|
|
10452
|
-
/**
|
|
10453
|
-
* Removes potential scopes from the package name
|
|
10454
|
-
*
|
|
10455
|
-
* @param {Package|string} packageName Package Name
|
|
10456
|
-
* @returns {string} the striped package name
|
|
10457
|
-
*/
|
|
10458
|
-
function stripScope(packageName) {
|
|
10459
|
-
if (packageName instanceof Package_1) {
|
|
10460
|
-
return stripScope(packageName.get('name'));
|
|
10461
|
-
}
|
|
10462
|
-
const sliced = packageName.split('/');
|
|
10463
|
-
return sliced.length > 1 ? sliced.slice(1).join('/') : packageName;
|
|
10464
|
-
}
|
|
10465
|
-
/**
|
|
10466
|
-
* @param {Project} project Lerna Project
|
|
10467
|
-
* @param {import('./codecov-config').ICodecovConfig} codecovCfg parsed codecov config
|
|
10468
|
-
* @param {IUpdateOptions} opts Options
|
|
10469
|
-
* @returns {Promise<ICodecovConfig>} a promise which resolves with the updated Codecov config
|
|
10470
|
-
*/
|
|
10471
|
-
async function updateConfig(project, codecovCfg, opts) {
|
|
10472
|
-
var _a, _b;
|
|
10473
|
-
const stripScopeInName = (opts === null || opts === void 0 ? void 0 : opts.stripScope) || true;
|
|
10474
|
-
const packages = await project.getPackages();
|
|
10475
|
-
if (packages.length === 0) {
|
|
10476
|
-
return codecovCfg;
|
|
10477
|
-
}
|
|
10478
|
-
const codecovProjects = {};
|
|
10479
|
-
const sourcePackages = ((_b = (_a = codecovCfg === null || codecovCfg === void 0 ? void 0 : codecovCfg.coverage) === null || _a === void 0 ? void 0 : _a.status) === null || _b === void 0 ? void 0 : _b.project) || {};
|
|
10480
|
-
for (const pkg of packages) {
|
|
10481
|
-
const stripedPackageName = stripScopeInName ? stripScope(pkg) : pkg.get('name');
|
|
10482
|
-
if (stripedPackageName in sourcePackages) {
|
|
10483
|
-
continue;
|
|
10484
|
-
}
|
|
10485
|
-
codecovProjects[stripedPackageName] = {
|
|
10486
|
-
paths: [relative(project.rootPath, pkg.location)],
|
|
10487
|
-
};
|
|
10488
|
-
}
|
|
10489
|
-
return deepmerge(codecovCfg, {
|
|
10490
|
-
coverage: {
|
|
10491
|
-
status: {
|
|
10492
|
-
project: codecovProjects,
|
|
10493
|
-
},
|
|
10494
|
-
},
|
|
10495
|
-
});
|
|
10450
|
+
/*
|
|
10451
|
+
* Package @donmahallem/lerna2codecov
|
|
10452
|
+
* Source https://github.com/donmahallem/js-libs/tree/master/packages/lerna2codecov
|
|
10453
|
+
*/
|
|
10454
|
+
/**
|
|
10455
|
+
* Removes potential scopes from the package name
|
|
10456
|
+
*
|
|
10457
|
+
* @param {Package|string} packageName Package Name
|
|
10458
|
+
* @returns {string} the striped package name
|
|
10459
|
+
*/
|
|
10460
|
+
function stripScope(packageName) {
|
|
10461
|
+
if (packageName instanceof Package_1) {
|
|
10462
|
+
return stripScope(packageName.get('name'));
|
|
10463
|
+
}
|
|
10464
|
+
const sliced = packageName.split('/');
|
|
10465
|
+
return sliced.length > 1 ? sliced.slice(1).join('/') : packageName;
|
|
10466
|
+
}
|
|
10467
|
+
/**
|
|
10468
|
+
* @param {Project} project Lerna Project
|
|
10469
|
+
* @param {import('./codecov-config').ICodecovConfig} codecovCfg parsed codecov config
|
|
10470
|
+
* @param {IUpdateOptions} opts Options
|
|
10471
|
+
* @returns {Promise<ICodecovConfig>} a promise which resolves with the updated Codecov config
|
|
10472
|
+
*/
|
|
10473
|
+
async function updateConfig(project, codecovCfg, opts) {
|
|
10474
|
+
var _a, _b;
|
|
10475
|
+
const stripScopeInName = (opts === null || opts === void 0 ? void 0 : opts.stripScope) || true;
|
|
10476
|
+
const packages = await project.getPackages();
|
|
10477
|
+
if (packages.length === 0) {
|
|
10478
|
+
return codecovCfg;
|
|
10479
|
+
}
|
|
10480
|
+
const codecovProjects = {};
|
|
10481
|
+
const sourcePackages = ((_b = (_a = codecovCfg === null || codecovCfg === void 0 ? void 0 : codecovCfg.coverage) === null || _a === void 0 ? void 0 : _a.status) === null || _b === void 0 ? void 0 : _b.project) || {};
|
|
10482
|
+
for (const pkg of packages) {
|
|
10483
|
+
const stripedPackageName = stripScopeInName ? stripScope(pkg) : pkg.get('name');
|
|
10484
|
+
if (stripedPackageName in sourcePackages) {
|
|
10485
|
+
continue;
|
|
10486
|
+
}
|
|
10487
|
+
codecovProjects[stripedPackageName] = {
|
|
10488
|
+
paths: [relative(project.rootPath, pkg.location)],
|
|
10489
|
+
};
|
|
10490
|
+
}
|
|
10491
|
+
return deepmerge(codecovCfg, {
|
|
10492
|
+
coverage: {
|
|
10493
|
+
status: {
|
|
10494
|
+
project: codecovProjects,
|
|
10495
|
+
},
|
|
10496
|
+
},
|
|
10497
|
+
});
|
|
10496
10498
|
}
|
|
10497
10499
|
|
|
10498
10500
|
export { updateConfig };
|
|
10499
|
-
// BUILD:
|
|
10501
|
+
// BUILD: Mon Mar 28 2022 05:36:52 GMT+0000 (Coordinated Universal Time)
|
|
10500
10502
|
|
|
10501
10503
|
//# sourceMappingURL=index.js.map
|