@donmahallem/lerna2codecov 0.1.4 → 0.1.5
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 +49 -49
- package/dist/cjs/index.js.map +1 -1
- package/dist/cli/cli.js +118 -118
- package/dist/cli/cli.js.map +1 -1
- package/dist/esm/index.js +49 -49
- 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 +3 -3
package/dist/cjs/index.js
CHANGED
|
@@ -10464,57 +10464,57 @@ class Package {
|
|
|
10464
10464
|
|
|
10465
10465
|
var Package_1 = Package;
|
|
10466
10466
|
|
|
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
|
-
});
|
|
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
|
+
});
|
|
10515
10515
|
}
|
|
10516
10516
|
|
|
10517
10517
|
exports.updateConfig = updateConfig;
|
|
10518
|
-
// BUILD:
|
|
10518
|
+
// BUILD: Sat Mar 26 2022 22:52:56 GMT+0000 (Coordinated Universal Time)
|
|
10519
10519
|
|
|
10520
10520
|
//# sourceMappingURL=index.js.map
|