@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/cjs/index.js
CHANGED
|
@@ -7255,7 +7255,7 @@ function getChalk(options) {
|
|
|
7255
7255
|
}
|
|
7256
7256
|
|
|
7257
7257
|
function highlight(code, options = {}) {
|
|
7258
|
-
if (shouldHighlight(options)) {
|
|
7258
|
+
if (code !== "" && shouldHighlight(options)) {
|
|
7259
7259
|
const chalk = getChalk(options);
|
|
7260
7260
|
const defs = getDefs$1(chalk);
|
|
7261
7261
|
return highlightTokens(defs, code);
|
|
@@ -7727,7 +7727,9 @@ const processOk = function (process) {
|
|
|
7727
7727
|
// some kind of non-node environment, just no-op
|
|
7728
7728
|
/* istanbul ignore if */
|
|
7729
7729
|
if (!processOk(process$1)) {
|
|
7730
|
-
signalExit.exports = function () {
|
|
7730
|
+
signalExit.exports = function () {
|
|
7731
|
+
return function () {}
|
|
7732
|
+
};
|
|
7731
7733
|
} else {
|
|
7732
7734
|
var assert = require$$5__default$1["default"];
|
|
7733
7735
|
var signals = signals$1.exports;
|
|
@@ -7760,7 +7762,7 @@ if (!processOk(process$1)) {
|
|
|
7760
7762
|
signalExit.exports = function (cb, opts) {
|
|
7761
7763
|
/* istanbul ignore if */
|
|
7762
7764
|
if (!processOk(commonjsGlobal.process)) {
|
|
7763
|
-
return
|
|
7765
|
+
return function () {}
|
|
7764
7766
|
}
|
|
7765
7767
|
assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler');
|
|
7766
7768
|
|
|
@@ -10462,57 +10464,57 @@ class Package {
|
|
|
10462
10464
|
|
|
10463
10465
|
var Package_1 = Package;
|
|
10464
10466
|
|
|
10465
|
-
/*
|
|
10466
|
-
* Package @donmahallem/lerna2codecov
|
|
10467
|
-
* Source https://github.com/donmahallem/js-libs/tree/master/packages/lerna2codecov
|
|
10468
|
-
*/
|
|
10469
|
-
/**
|
|
10470
|
-
* Removes potential scopes from the package name
|
|
10471
|
-
*
|
|
10472
|
-
* @param {Package|string} packageName Package Name
|
|
10473
|
-
* @returns {string} the striped package name
|
|
10474
|
-
*/
|
|
10475
|
-
function stripScope(packageName) {
|
|
10476
|
-
if (packageName instanceof Package_1) {
|
|
10477
|
-
return stripScope(packageName.get('name'));
|
|
10478
|
-
}
|
|
10479
|
-
const sliced = packageName.split('/');
|
|
10480
|
-
return sliced.length > 1 ? sliced.slice(1).join('/') : packageName;
|
|
10481
|
-
}
|
|
10482
|
-
/**
|
|
10483
|
-
* @param {Project} project Lerna Project
|
|
10484
|
-
* @param {import('./codecov-config').ICodecovConfig} codecovCfg parsed codecov config
|
|
10485
|
-
* @param {IUpdateOptions} opts Options
|
|
10486
|
-
* @returns {Promise<ICodecovConfig>} a promise which resolves with the updated Codecov config
|
|
10487
|
-
*/
|
|
10488
|
-
async function updateConfig(project, codecovCfg, opts) {
|
|
10489
|
-
var _a, _b;
|
|
10490
|
-
const stripScopeInName = (opts === null || opts === void 0 ? void 0 : opts.stripScope) || true;
|
|
10491
|
-
const packages = await project.getPackages();
|
|
10492
|
-
if (packages.length === 0) {
|
|
10493
|
-
return codecovCfg;
|
|
10494
|
-
}
|
|
10495
|
-
const codecovProjects = {};
|
|
10496
|
-
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) || {};
|
|
10497
|
-
for (const pkg of packages) {
|
|
10498
|
-
const stripedPackageName = stripScopeInName ? stripScope(pkg) : pkg.get('name');
|
|
10499
|
-
if (stripedPackageName in sourcePackages) {
|
|
10500
|
-
continue;
|
|
10501
|
-
}
|
|
10502
|
-
codecovProjects[stripedPackageName] = {
|
|
10503
|
-
paths: [require$$3.relative(project.rootPath, pkg.location)],
|
|
10504
|
-
};
|
|
10505
|
-
}
|
|
10506
|
-
return deepmerge__default["default"](codecovCfg, {
|
|
10507
|
-
coverage: {
|
|
10508
|
-
status: {
|
|
10509
|
-
project: codecovProjects,
|
|
10510
|
-
},
|
|
10511
|
-
},
|
|
10512
|
-
});
|
|
10467
|
+
/*
|
|
10468
|
+
* Package @donmahallem/lerna2codecov
|
|
10469
|
+
* Source https://github.com/donmahallem/js-libs/tree/master/packages/lerna2codecov
|
|
10470
|
+
*/
|
|
10471
|
+
/**
|
|
10472
|
+
* Removes potential scopes from the package name
|
|
10473
|
+
*
|
|
10474
|
+
* @param {Package|string} packageName Package Name
|
|
10475
|
+
* @returns {string} the striped package name
|
|
10476
|
+
*/
|
|
10477
|
+
function stripScope(packageName) {
|
|
10478
|
+
if (packageName instanceof Package_1) {
|
|
10479
|
+
return stripScope(packageName.get('name'));
|
|
10480
|
+
}
|
|
10481
|
+
const sliced = packageName.split('/');
|
|
10482
|
+
return sliced.length > 1 ? sliced.slice(1).join('/') : packageName;
|
|
10483
|
+
}
|
|
10484
|
+
/**
|
|
10485
|
+
* @param {Project} project Lerna Project
|
|
10486
|
+
* @param {import('./codecov-config').ICodecovConfig} codecovCfg parsed codecov config
|
|
10487
|
+
* @param {IUpdateOptions} opts Options
|
|
10488
|
+
* @returns {Promise<ICodecovConfig>} a promise which resolves with the updated Codecov config
|
|
10489
|
+
*/
|
|
10490
|
+
async function updateConfig(project, codecovCfg, opts) {
|
|
10491
|
+
var _a, _b;
|
|
10492
|
+
const stripScopeInName = (opts === null || opts === void 0 ? void 0 : opts.stripScope) || true;
|
|
10493
|
+
const packages = await project.getPackages();
|
|
10494
|
+
if (packages.length === 0) {
|
|
10495
|
+
return codecovCfg;
|
|
10496
|
+
}
|
|
10497
|
+
const codecovProjects = {};
|
|
10498
|
+
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) || {};
|
|
10499
|
+
for (const pkg of packages) {
|
|
10500
|
+
const stripedPackageName = stripScopeInName ? stripScope(pkg) : pkg.get('name');
|
|
10501
|
+
if (stripedPackageName in sourcePackages) {
|
|
10502
|
+
continue;
|
|
10503
|
+
}
|
|
10504
|
+
codecovProjects[stripedPackageName] = {
|
|
10505
|
+
paths: [require$$3.relative(project.rootPath, pkg.location)],
|
|
10506
|
+
};
|
|
10507
|
+
}
|
|
10508
|
+
return deepmerge__default["default"](codecovCfg, {
|
|
10509
|
+
coverage: {
|
|
10510
|
+
status: {
|
|
10511
|
+
project: codecovProjects,
|
|
10512
|
+
},
|
|
10513
|
+
},
|
|
10514
|
+
});
|
|
10513
10515
|
}
|
|
10514
10516
|
|
|
10515
10517
|
exports.updateConfig = updateConfig;
|
|
10516
|
-
// BUILD:
|
|
10518
|
+
// BUILD: Mon Mar 28 2022 05:36:52 GMT+0000 (Coordinated Universal Time)
|
|
10517
10519
|
|
|
10518
10520
|
//# sourceMappingURL=index.js.map
|