@form8ion/codecov 1.2.0 → 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/README.md +42 -2
- package/example.js +5 -2
- package/lib/index.cjs.js +132 -21
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.es.js +131 -22
- package/lib/index.es.js.map +1 -1
- package/package.json +14 -8
package/README.md
CHANGED
|
@@ -11,20 +11,41 @@ code coverage service plugin for form8ion
|
|
|
11
11
|
|
|
12
12
|
## Table of Contents
|
|
13
13
|
|
|
14
|
+
* [Features](#features)
|
|
15
|
+
* [Scaffold](#scaffold)
|
|
16
|
+
* [Lift](#lift)
|
|
14
17
|
* [Usage](#usage)
|
|
15
18
|
* [Installation](#installation)
|
|
16
19
|
* [Example](#example)
|
|
17
20
|
* [Import](#import)
|
|
18
21
|
* [Execute](#execute)
|
|
19
22
|
* [API](#api)
|
|
20
|
-
* [scaffold](#scaffold)
|
|
23
|
+
* [scaffold](#scaffold-1)
|
|
21
24
|
* [`vcs` __object__ (_required_)](#vcs-object-required)
|
|
22
25
|
* [`visibility` __string__ (_required_)](#visibility-string-required)
|
|
23
26
|
* [`apiAccessToken` __string__ (_optional_)](#apiaccesstoken-string-optional)
|
|
27
|
+
* [lift](#lift-1)
|
|
28
|
+
* [`projectRoot` __string__ (_required_)](#projectroot-string-required)
|
|
29
|
+
* [`packageManager` __string__ (_required_)](#packagemanager-string-required)
|
|
24
30
|
* [Contributing](#contributing)
|
|
25
31
|
* [Dependencies](#dependencies)
|
|
26
32
|
* [Verification](#verification)
|
|
27
33
|
|
|
34
|
+
## Features
|
|
35
|
+
|
|
36
|
+
### Scaffold
|
|
37
|
+
|
|
38
|
+
* Define a coverage status badge to communicate current coverage details
|
|
39
|
+
* Link from the status badge to further details on the [Codecov](https://codecov.io/)
|
|
40
|
+
site
|
|
41
|
+
* Define a coverage status badge for private projects when an [`apiAccessToken` __string__ (_optional_)](#apiaccesstoken-string-optional)
|
|
42
|
+
is provided
|
|
43
|
+
|
|
44
|
+
### Lift
|
|
45
|
+
|
|
46
|
+
* Migrate from the [legacy node uploader](https://github.com/codecov/codecov-node)
|
|
47
|
+
to the [modern uploader](https://docs.codecov.com/docs/codecov-uploader)
|
|
48
|
+
|
|
28
49
|
## Usage
|
|
29
50
|
|
|
30
51
|
<!--consumer-badges start -->
|
|
@@ -46,7 +67,8 @@ $ npm install @form8ion/codecov --save
|
|
|
46
67
|
#### Import
|
|
47
68
|
|
|
48
69
|
```javascript
|
|
49
|
-
import {
|
|
70
|
+
import {packageManagers} from '@form8ion/javascript-core';
|
|
71
|
+
import {scaffold, lift} from '@form8ion/codecov';
|
|
50
72
|
```
|
|
51
73
|
|
|
52
74
|
#### Execute
|
|
@@ -71,6 +93,8 @@ import {scaffold} from './lib/index.cjs';
|
|
|
71
93
|
},
|
|
72
94
|
apiAccessToken: 'XXXXXX'
|
|
73
95
|
});
|
|
96
|
+
|
|
97
|
+
await lift({projectRoot: process.cwd(), packageManager: packageManagers.NPM});
|
|
74
98
|
})();
|
|
75
99
|
```
|
|
76
100
|
|
|
@@ -108,6 +132,22 @@ Since the [Codecov API](https://docs.codecov.com/reference) appears to only
|
|
|
108
132
|
support GitHub at the time of this implementation, GitHub is the only VCS host
|
|
109
133
|
supported by this scaffolder at this time.
|
|
110
134
|
|
|
135
|
+
#### lift
|
|
136
|
+
|
|
137
|
+
Migrates [Codecov](https://codecov.io/) details from legacy conventions to
|
|
138
|
+
modern conventions.
|
|
139
|
+
|
|
140
|
+
Takes a single options object as an argument, containing:
|
|
141
|
+
|
|
142
|
+
##### `projectRoot` __string__ (_required_)
|
|
143
|
+
|
|
144
|
+
path to the root of the project
|
|
145
|
+
|
|
146
|
+
##### `packageManager` __string__ (_required_)
|
|
147
|
+
|
|
148
|
+
chosen [package manager](https://github.com/form8ion/javascript-core#packagemanagers)
|
|
149
|
+
to be used for the project
|
|
150
|
+
|
|
111
151
|
## Contributing
|
|
112
152
|
|
|
113
153
|
<!--contribution-badges start -->
|
package/example.js
CHANGED
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
import stubbedFs from 'mock-fs';
|
|
4
4
|
import nock from 'nock';
|
|
5
5
|
import {StatusCodes} from 'http-status-codes';
|
|
6
|
-
import {
|
|
6
|
+
import {packageManagers} from '@form8ion/javascript-core';
|
|
7
|
+
import {scaffold, lift} from './lib/index.cjs';
|
|
7
8
|
|
|
8
9
|
// remark-usage-ignore-next 5
|
|
9
|
-
stubbedFs();
|
|
10
|
+
stubbedFs({'package.json': JSON.stringify({scripts: {}})});
|
|
10
11
|
nock.disableNetConnect();
|
|
11
12
|
nock('https://codecov.io/')
|
|
12
13
|
.get('/api/gh/foo/bar')
|
|
@@ -33,4 +34,6 @@ nock('https://codecov.io/')
|
|
|
33
34
|
},
|
|
34
35
|
apiAccessToken: 'XXXXXX'
|
|
35
36
|
});
|
|
37
|
+
|
|
38
|
+
await lift({projectRoot: process.cwd(), packageManager: packageManagers.NPM});
|
|
36
39
|
})();
|
package/lib/index.cjs.js
CHANGED
|
@@ -3,24 +3,24 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var got = require('got');
|
|
6
|
+
var fs = require('fs');
|
|
7
|
+
var execa = require('execa');
|
|
8
|
+
var jsYaml = require('js-yaml');
|
|
9
|
+
var core = require('@form8ion/core');
|
|
6
10
|
|
|
7
11
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
12
|
|
|
9
13
|
var got__default = /*#__PURE__*/_interopDefaultLegacy(got);
|
|
14
|
+
var execa__default = /*#__PURE__*/_interopDefaultLegacy(execa);
|
|
10
15
|
|
|
11
16
|
function ownKeys(object, enumerableOnly) {
|
|
12
17
|
var keys = Object.keys(object);
|
|
13
18
|
|
|
14
19
|
if (Object.getOwnPropertySymbols) {
|
|
15
20
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
keys.push.apply(keys, symbols);
|
|
21
|
+
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
22
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
23
|
+
})), keys.push.apply(keys, symbols);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
return keys;
|
|
@@ -28,19 +28,12 @@ function ownKeys(object, enumerableOnly) {
|
|
|
28
28
|
|
|
29
29
|
function _objectSpread2(target) {
|
|
30
30
|
for (var i = 1; i < arguments.length; i++) {
|
|
31
|
-
var source = arguments[i]
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
} else if (Object.getOwnPropertyDescriptors) {
|
|
38
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
39
|
-
} else {
|
|
40
|
-
ownKeys(Object(source)).forEach(function (key) {
|
|
41
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
42
|
-
});
|
|
43
|
-
}
|
|
31
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
32
|
+
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
33
|
+
_defineProperty(target, key, source[key]);
|
|
34
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
35
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
36
|
+
});
|
|
44
37
|
}
|
|
45
38
|
|
|
46
39
|
return target;
|
|
@@ -61,6 +54,42 @@ function _defineProperty(obj, key, value) {
|
|
|
61
54
|
return obj;
|
|
62
55
|
}
|
|
63
56
|
|
|
57
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
58
|
+
if (source == null) return {};
|
|
59
|
+
var target = {};
|
|
60
|
+
var sourceKeys = Object.keys(source);
|
|
61
|
+
var key, i;
|
|
62
|
+
|
|
63
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
64
|
+
key = sourceKeys[i];
|
|
65
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
66
|
+
target[key] = source[key];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return target;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function _objectWithoutProperties(source, excluded) {
|
|
73
|
+
if (source == null) return {};
|
|
74
|
+
|
|
75
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
76
|
+
|
|
77
|
+
var key, i;
|
|
78
|
+
|
|
79
|
+
if (Object.getOwnPropertySymbols) {
|
|
80
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
81
|
+
|
|
82
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
83
|
+
key = sourceSymbolKeys[i];
|
|
84
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
85
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
86
|
+
target[key] = source[key];
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return target;
|
|
91
|
+
}
|
|
92
|
+
|
|
64
93
|
function coverageShouldBeReportedToCodecov({
|
|
65
94
|
vcs,
|
|
66
95
|
visibility,
|
|
@@ -78,6 +107,77 @@ function scaffold$2() {
|
|
|
78
107
|
};
|
|
79
108
|
}
|
|
80
109
|
|
|
110
|
+
async function lift$1({
|
|
111
|
+
projectRoot
|
|
112
|
+
}) {
|
|
113
|
+
const pathToWorkflowFile = `${projectRoot}/.github/workflows/node-ci.yml`;
|
|
114
|
+
if (!(await core.fileExists(pathToWorkflowFile))) return;
|
|
115
|
+
const workflowDetails = jsYaml.load(await fs.promises.readFile(pathToWorkflowFile, 'utf-8'));
|
|
116
|
+
const {
|
|
117
|
+
jobs: {
|
|
118
|
+
verify: {
|
|
119
|
+
steps
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
} = workflowDetails;
|
|
123
|
+
|
|
124
|
+
if (!steps.find(step => {
|
|
125
|
+
var _step$uses;
|
|
126
|
+
|
|
127
|
+
return (_step$uses = step.uses) === null || _step$uses === void 0 ? void 0 : _step$uses.startsWith('codecov/codecov-action');
|
|
128
|
+
})) {
|
|
129
|
+
const stepsWithLegacyReportingRemoved = steps.filter(({
|
|
130
|
+
run
|
|
131
|
+
}) => 'npm run coverage:report' !== run);
|
|
132
|
+
await fs.promises.writeFile(pathToWorkflowFile, jsYaml.dump(_objectSpread2(_objectSpread2({}, workflowDetails), {}, {
|
|
133
|
+
jobs: _objectSpread2(_objectSpread2({}, workflowDetails.jobs), {}, {
|
|
134
|
+
verify: _objectSpread2(_objectSpread2({}, workflowDetails.jobs.verify), {}, {
|
|
135
|
+
steps: [...stepsWithLegacyReportingRemoved, {
|
|
136
|
+
uses: 'codecov/codecov-action@v2'
|
|
137
|
+
}]
|
|
138
|
+
})
|
|
139
|
+
})
|
|
140
|
+
})));
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
const _excluded = ["scripts"],
|
|
145
|
+
_excluded2 = ["coverage:report"];
|
|
146
|
+
async function liftReporting ({
|
|
147
|
+
projectRoot,
|
|
148
|
+
packageManager
|
|
149
|
+
}) {
|
|
150
|
+
const pathToPackageJson = `${projectRoot}/package.json`;
|
|
151
|
+
const existingPackageContents = await fs.promises.readFile(pathToPackageJson, 'utf-8');
|
|
152
|
+
|
|
153
|
+
const _JSON$parse = JSON.parse(existingPackageContents),
|
|
154
|
+
{
|
|
155
|
+
scripts
|
|
156
|
+
} = _JSON$parse,
|
|
157
|
+
otherTopLevelProperties = _objectWithoutProperties(_JSON$parse, _excluded);
|
|
158
|
+
|
|
159
|
+
const otherScripts = _objectWithoutProperties(scripts, _excluded2);
|
|
160
|
+
|
|
161
|
+
await lift$1({
|
|
162
|
+
projectRoot
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
if (scripts['coverage:report']) {
|
|
166
|
+
await fs.promises.writeFile(pathToPackageJson, JSON.stringify(_objectSpread2(_objectSpread2({}, otherTopLevelProperties), {}, {
|
|
167
|
+
scripts: otherScripts
|
|
168
|
+
})));
|
|
169
|
+
await execa__default["default"](packageManager, ['remove', 'codecov']);
|
|
170
|
+
return {
|
|
171
|
+
nextSteps: [{
|
|
172
|
+
summary: 'Configure modern reporting to Codecov on your CI service',
|
|
173
|
+
description: 'Configure the [Codecov Uploader](https://docs.codecov.com/docs/codecov-uploader) appropriately' + ' for your CI Provider. If available for your provider, prefer one of the dedicated wrappers.'
|
|
174
|
+
}]
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
return {};
|
|
179
|
+
}
|
|
180
|
+
|
|
81
181
|
async function fetchRepositoryDetails ({
|
|
82
182
|
vcs,
|
|
83
183
|
apiAccessToken
|
|
@@ -131,5 +231,16 @@ async function scaffold({
|
|
|
131
231
|
}));
|
|
132
232
|
}
|
|
133
233
|
|
|
234
|
+
function lift({
|
|
235
|
+
projectRoot,
|
|
236
|
+
packageManager
|
|
237
|
+
}) {
|
|
238
|
+
return liftReporting({
|
|
239
|
+
projectRoot,
|
|
240
|
+
packageManager
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
exports.lift = lift;
|
|
134
245
|
exports.scaffold = scaffold;
|
|
135
246
|
//# sourceMappingURL=index.cjs.js.map
|
package/lib/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../src/predicates.js","../src/reporter.js","../src/repository-details-fetcher.js","../src/badge.js","../src/scaffolder.js"],"sourcesContent":["export function coverageShouldBeReportedToCodecov({vcs, visibility, apiAccessToken}) {\n return !!('Public' === visibility || (apiAccessToken && 'github' === vcs.host));\n}\n","export function scaffold() {\n return {\n devDependencies: ['codecov'],\n scripts: {'coverage:report': 'c8 report --reporter=text-lcov > coverage.lcov && codecov'}\n };\n}\n","import got from '
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../src/predicates.js","../src/reporter/scaffolder.js","../src/reporter/github-workflow.js","../src/reporter/lifter.js","../src/badge/repository-details-fetcher.js","../src/badge/scaffolder.js","../src/scaffolder.js","../src/lifter.js"],"sourcesContent":["export function coverageShouldBeReportedToCodecov({vcs, visibility, apiAccessToken}) {\n return !!('Public' === visibility || (apiAccessToken && 'github' === vcs.host));\n}\n","export function scaffold() {\n return {\n devDependencies: ['codecov'],\n scripts: {'coverage:report': 'c8 report --reporter=text-lcov > coverage.lcov && codecov'}\n };\n}\n","import {promises as fs} from 'fs';\nimport {dump, load} from 'js-yaml';\nimport {fileExists} from '@form8ion/core';\n\nexport async function lift({projectRoot}) {\n const pathToWorkflowFile = `${projectRoot}/.github/workflows/node-ci.yml`;\n\n if (!await fileExists(pathToWorkflowFile)) return;\n\n const workflowDetails = load(await fs.readFile(pathToWorkflowFile, 'utf-8'));\n const {jobs: {verify: {steps}}} = workflowDetails;\n\n if (!steps.find(step => step.uses?.startsWith('codecov/codecov-action'))) {\n const stepsWithLegacyReportingRemoved = steps.filter(({run}) => 'npm run coverage:report' !== run);\n\n await fs.writeFile(\n pathToWorkflowFile,\n dump({\n ...workflowDetails,\n jobs: {\n ...workflowDetails.jobs,\n verify: {\n ...workflowDetails.jobs.verify,\n steps: [...stepsWithLegacyReportingRemoved, {uses: 'codecov/codecov-action@v2'}]\n }\n }\n })\n );\n }\n}\n","import {promises as fs} from 'fs';\n\nimport execa from '../../thirdparty-wrappers/execa';\nimport {lift as liftGithubWorkflow} from './github-workflow';\n\nexport default async function ({projectRoot, packageManager}) {\n const pathToPackageJson = `${projectRoot}/package.json`;\n\n const existingPackageContents = await fs.readFile(pathToPackageJson, 'utf-8');\n const {scripts, ...otherTopLevelProperties} = JSON.parse(existingPackageContents);\n const {'coverage:report': reportCoverageScript, ...otherScripts} = scripts;\n\n await liftGithubWorkflow({projectRoot});\n\n if (scripts['coverage:report']) {\n await fs.writeFile(pathToPackageJson, JSON.stringify({...otherTopLevelProperties, scripts: otherScripts}));\n\n await execa(packageManager, ['remove', 'codecov']);\n\n return {\n nextSteps: [{\n summary: 'Configure modern reporting to Codecov on your CI service',\n description: 'Configure the [Codecov Uploader](https://docs.codecov.com/docs/codecov-uploader) appropriately'\n + ' for your CI Provider. If available for your provider, prefer one of the dedicated wrappers.'\n }]\n };\n }\n\n return {};\n}\n","import got from '../../thirdparty-wrappers/got';\n\nexport default async function ({vcs, apiAccessToken}) {\n const {body: {repo}} = await got(\n `https://codecov.io/api/gh/${vcs.owner}/${vcs.name}`,\n {headers: {Authorization: apiAccessToken}, responseType: 'json'}\n );\n\n return repo;\n}\n","import fetchRepositoryDetails from './repository-details-fetcher';\n\nexport async function scaffold({vcs, apiAccessToken}) {\n return {\n ...['github', 'gitlab', 'bitbucket'].includes(vcs?.host) && {\n badges: {\n status: {\n coverage: {\n img: `https://img.shields.io/codecov/c/${vcs.host}/${vcs.owner}/${vcs.name}?logo=codecov${\n apiAccessToken\n ? `&token=${(await fetchRepositoryDetails({vcs, apiAccessToken})).image_token}`\n : ''\n }`,\n link: `https://codecov.io/${vcs.host}/${vcs.owner}/${vcs.name}`,\n text: 'Codecov'\n }\n }\n }\n }\n };\n}\n","import {coverageShouldBeReportedToCodecov} from './predicates';\nimport {scaffold as scaffoldReporter} from './reporter';\nimport {scaffold as scaffoldBadge} from './badge';\n\nexport async function scaffold({vcs, visibility, apiAccessToken}) {\n if (!coverageShouldBeReportedToCodecov({vcs, visibility, apiAccessToken})) return {};\n\n return {\n ...scaffoldReporter(),\n ...await scaffoldBadge({vcs, apiAccessToken})\n };\n}\n","import {lift as liftReporting} from './reporter';\n\nexport function lift({projectRoot, packageManager}) {\n return liftReporting({projectRoot, packageManager});\n}\n"],"names":["coverageShouldBeReportedToCodecov","vcs","visibility","apiAccessToken","host","scaffold","devDependencies","scripts","lift","projectRoot","pathToWorkflowFile","fileExists","workflowDetails","load","fs","readFile","jobs","verify","steps","find","step","uses","startsWith","stepsWithLegacyReportingRemoved","filter","run","writeFile","dump","packageManager","pathToPackageJson","existingPackageContents","JSON","parse","otherTopLevelProperties","otherScripts","liftGithubWorkflow","stringify","execa","nextSteps","summary","description","body","repo","got","owner","name","headers","Authorization","responseType","includes","badges","status","coverage","img","fetchRepositoryDetails","image_token","link","text","scaffoldReporter","scaffoldBadge","liftReporting"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,SAASA,iCAAT,CAA2C;AAACC,EAAAA,GAAD;AAAMC,EAAAA,UAAN;AAAkBC,EAAAA;AAAlB,CAA3C,EAA8E;AACnF,SAAO,CAAC,EAAE,aAAaD,UAAb,IAA4BC,cAAc,IAAI,aAAaF,GAAG,CAACG,IAAjE,CAAR;AACD;;ACFM,SAASC,UAAT,GAAoB;AACzB,SAAO;AACLC,IAAAA,eAAe,EAAE,CAAC,SAAD,CADZ;AAELC,IAAAA,OAAO,EAAE;AAAC,yBAAmB;AAApB;AAFJ,GAAP;AAID;;ACDM,eAAeC,MAAf,CAAoB;AAACC,EAAAA;AAAD,CAApB,EAAmC;AACxC,QAAMC,kBAAkB,GAAI,GAAED,WAAY,gCAA1C;AAEA,MAAI,EAAC,MAAME,eAAU,CAACD,kBAAD,CAAjB,CAAJ,EAA2C;AAE3C,QAAME,eAAe,GAAGC,WAAI,CAAC,MAAMC,WAAE,CAACC,QAAH,CAAYL,kBAAZ,EAAgC,OAAhC,CAAP,CAA5B;AACA,QAAM;AAACM,IAAAA,IAAI,EAAE;AAACC,MAAAA,MAAM,EAAE;AAACC,QAAAA;AAAD;AAAT;AAAP,MAA4BN,eAAlC;;AAEA,MAAI,CAACM,KAAK,CAACC,IAAN,CAAWC,IAAI;AAAA;;AAAA,yBAAIA,IAAI,CAACC,IAAT,+C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;AAiBD;;AChBM,eAAepD,QAAf,CAAwB;AAACJ,EAAAA,GAAD;AAAMC,EAAAA,UAAN;AAAkBC,EAAAA;AAAlB,CAAxB,EAA2D;AAChE,MAAI,CAACH,iCAAiC,CAAC;AAACC,IAAAA,GAAD;AAAMC,IAAAA,UAAN;AAAkBC,IAAAA;AAAlB,GAAD,CAAtC,EAA2E,OAAO,EAAP;AAE3E,2CACKuD,UAAgB,EADrB,GAEK,MAAMC,UAAa,CAAC;AAAC1D,IAAAA,GAAD;AAAME,IAAAA;AAAN,GAAD,CAFxB;AAID;;ACTM,SAASK,IAAT,CAAc;AAACC,EAAAA,WAAD;AAAcmB,EAAAA;AAAd,CAAd,EAA6C;AAClD,SAAOgC,aAAa,CAAC;AAACnD,IAAAA,WAAD;AAAcmB,IAAAA;AAAd,GAAD,CAApB;AACD;;;;;"}
|
package/lib/index.es.js
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import got from 'got';
|
|
2
|
+
import { promises } from 'fs';
|
|
3
|
+
import execa from 'execa';
|
|
4
|
+
import { load, dump } from 'js-yaml';
|
|
5
|
+
import { fileExists } from '@form8ion/core';
|
|
2
6
|
|
|
3
7
|
function ownKeys(object, enumerableOnly) {
|
|
4
8
|
var keys = Object.keys(object);
|
|
5
9
|
|
|
6
10
|
if (Object.getOwnPropertySymbols) {
|
|
7
11
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
keys.push.apply(keys, symbols);
|
|
12
|
+
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
13
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
14
|
+
})), keys.push.apply(keys, symbols);
|
|
16
15
|
}
|
|
17
16
|
|
|
18
17
|
return keys;
|
|
@@ -20,19 +19,12 @@ function ownKeys(object, enumerableOnly) {
|
|
|
20
19
|
|
|
21
20
|
function _objectSpread2(target) {
|
|
22
21
|
for (var i = 1; i < arguments.length; i++) {
|
|
23
|
-
var source = arguments[i]
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
} else if (Object.getOwnPropertyDescriptors) {
|
|
30
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
31
|
-
} else {
|
|
32
|
-
ownKeys(Object(source)).forEach(function (key) {
|
|
33
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
34
|
-
});
|
|
35
|
-
}
|
|
22
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
23
|
+
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
24
|
+
_defineProperty(target, key, source[key]);
|
|
25
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
26
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
27
|
+
});
|
|
36
28
|
}
|
|
37
29
|
|
|
38
30
|
return target;
|
|
@@ -53,6 +45,42 @@ function _defineProperty(obj, key, value) {
|
|
|
53
45
|
return obj;
|
|
54
46
|
}
|
|
55
47
|
|
|
48
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
49
|
+
if (source == null) return {};
|
|
50
|
+
var target = {};
|
|
51
|
+
var sourceKeys = Object.keys(source);
|
|
52
|
+
var key, i;
|
|
53
|
+
|
|
54
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
55
|
+
key = sourceKeys[i];
|
|
56
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
57
|
+
target[key] = source[key];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return target;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function _objectWithoutProperties(source, excluded) {
|
|
64
|
+
if (source == null) return {};
|
|
65
|
+
|
|
66
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
67
|
+
|
|
68
|
+
var key, i;
|
|
69
|
+
|
|
70
|
+
if (Object.getOwnPropertySymbols) {
|
|
71
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
72
|
+
|
|
73
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
74
|
+
key = sourceSymbolKeys[i];
|
|
75
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
76
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
77
|
+
target[key] = source[key];
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return target;
|
|
82
|
+
}
|
|
83
|
+
|
|
56
84
|
function coverageShouldBeReportedToCodecov({
|
|
57
85
|
vcs,
|
|
58
86
|
visibility,
|
|
@@ -70,6 +98,77 @@ function scaffold$2() {
|
|
|
70
98
|
};
|
|
71
99
|
}
|
|
72
100
|
|
|
101
|
+
async function lift$1({
|
|
102
|
+
projectRoot
|
|
103
|
+
}) {
|
|
104
|
+
const pathToWorkflowFile = `${projectRoot}/.github/workflows/node-ci.yml`;
|
|
105
|
+
if (!(await fileExists(pathToWorkflowFile))) return;
|
|
106
|
+
const workflowDetails = load(await promises.readFile(pathToWorkflowFile, 'utf-8'));
|
|
107
|
+
const {
|
|
108
|
+
jobs: {
|
|
109
|
+
verify: {
|
|
110
|
+
steps
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
} = workflowDetails;
|
|
114
|
+
|
|
115
|
+
if (!steps.find(step => {
|
|
116
|
+
var _step$uses;
|
|
117
|
+
|
|
118
|
+
return (_step$uses = step.uses) === null || _step$uses === void 0 ? void 0 : _step$uses.startsWith('codecov/codecov-action');
|
|
119
|
+
})) {
|
|
120
|
+
const stepsWithLegacyReportingRemoved = steps.filter(({
|
|
121
|
+
run
|
|
122
|
+
}) => 'npm run coverage:report' !== run);
|
|
123
|
+
await promises.writeFile(pathToWorkflowFile, dump(_objectSpread2(_objectSpread2({}, workflowDetails), {}, {
|
|
124
|
+
jobs: _objectSpread2(_objectSpread2({}, workflowDetails.jobs), {}, {
|
|
125
|
+
verify: _objectSpread2(_objectSpread2({}, workflowDetails.jobs.verify), {}, {
|
|
126
|
+
steps: [...stepsWithLegacyReportingRemoved, {
|
|
127
|
+
uses: 'codecov/codecov-action@v2'
|
|
128
|
+
}]
|
|
129
|
+
})
|
|
130
|
+
})
|
|
131
|
+
})));
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
const _excluded = ["scripts"],
|
|
136
|
+
_excluded2 = ["coverage:report"];
|
|
137
|
+
async function liftReporting ({
|
|
138
|
+
projectRoot,
|
|
139
|
+
packageManager
|
|
140
|
+
}) {
|
|
141
|
+
const pathToPackageJson = `${projectRoot}/package.json`;
|
|
142
|
+
const existingPackageContents = await promises.readFile(pathToPackageJson, 'utf-8');
|
|
143
|
+
|
|
144
|
+
const _JSON$parse = JSON.parse(existingPackageContents),
|
|
145
|
+
{
|
|
146
|
+
scripts
|
|
147
|
+
} = _JSON$parse,
|
|
148
|
+
otherTopLevelProperties = _objectWithoutProperties(_JSON$parse, _excluded);
|
|
149
|
+
|
|
150
|
+
const otherScripts = _objectWithoutProperties(scripts, _excluded2);
|
|
151
|
+
|
|
152
|
+
await lift$1({
|
|
153
|
+
projectRoot
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
if (scripts['coverage:report']) {
|
|
157
|
+
await promises.writeFile(pathToPackageJson, JSON.stringify(_objectSpread2(_objectSpread2({}, otherTopLevelProperties), {}, {
|
|
158
|
+
scripts: otherScripts
|
|
159
|
+
})));
|
|
160
|
+
await execa(packageManager, ['remove', 'codecov']);
|
|
161
|
+
return {
|
|
162
|
+
nextSteps: [{
|
|
163
|
+
summary: 'Configure modern reporting to Codecov on your CI service',
|
|
164
|
+
description: 'Configure the [Codecov Uploader](https://docs.codecov.com/docs/codecov-uploader) appropriately' + ' for your CI Provider. If available for your provider, prefer one of the dedicated wrappers.'
|
|
165
|
+
}]
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
return {};
|
|
170
|
+
}
|
|
171
|
+
|
|
73
172
|
async function fetchRepositoryDetails ({
|
|
74
173
|
vcs,
|
|
75
174
|
apiAccessToken
|
|
@@ -123,5 +222,15 @@ async function scaffold({
|
|
|
123
222
|
}));
|
|
124
223
|
}
|
|
125
224
|
|
|
126
|
-
|
|
225
|
+
function lift({
|
|
226
|
+
projectRoot,
|
|
227
|
+
packageManager
|
|
228
|
+
}) {
|
|
229
|
+
return liftReporting({
|
|
230
|
+
projectRoot,
|
|
231
|
+
packageManager
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
export { lift, scaffold };
|
|
127
236
|
//# sourceMappingURL=index.es.js.map
|
package/lib/index.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../src/predicates.js","../src/reporter.js","../src/repository-details-fetcher.js","../src/badge.js","../src/scaffolder.js"],"sourcesContent":["export function coverageShouldBeReportedToCodecov({vcs, visibility, apiAccessToken}) {\n return !!('Public' === visibility || (apiAccessToken && 'github' === vcs.host));\n}\n","export function scaffold() {\n return {\n devDependencies: ['codecov'],\n scripts: {'coverage:report': 'c8 report --reporter=text-lcov > coverage.lcov && codecov'}\n };\n}\n","import got from '
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../src/predicates.js","../src/reporter/scaffolder.js","../src/reporter/github-workflow.js","../src/reporter/lifter.js","../src/badge/repository-details-fetcher.js","../src/badge/scaffolder.js","../src/scaffolder.js","../src/lifter.js"],"sourcesContent":["export function coverageShouldBeReportedToCodecov({vcs, visibility, apiAccessToken}) {\n return !!('Public' === visibility || (apiAccessToken && 'github' === vcs.host));\n}\n","export function scaffold() {\n return {\n devDependencies: ['codecov'],\n scripts: {'coverage:report': 'c8 report --reporter=text-lcov > coverage.lcov && codecov'}\n };\n}\n","import {promises as fs} from 'fs';\nimport {dump, load} from 'js-yaml';\nimport {fileExists} from '@form8ion/core';\n\nexport async function lift({projectRoot}) {\n const pathToWorkflowFile = `${projectRoot}/.github/workflows/node-ci.yml`;\n\n if (!await fileExists(pathToWorkflowFile)) return;\n\n const workflowDetails = load(await fs.readFile(pathToWorkflowFile, 'utf-8'));\n const {jobs: {verify: {steps}}} = workflowDetails;\n\n if (!steps.find(step => step.uses?.startsWith('codecov/codecov-action'))) {\n const stepsWithLegacyReportingRemoved = steps.filter(({run}) => 'npm run coverage:report' !== run);\n\n await fs.writeFile(\n pathToWorkflowFile,\n dump({\n ...workflowDetails,\n jobs: {\n ...workflowDetails.jobs,\n verify: {\n ...workflowDetails.jobs.verify,\n steps: [...stepsWithLegacyReportingRemoved, {uses: 'codecov/codecov-action@v2'}]\n }\n }\n })\n );\n }\n}\n","import {promises as fs} from 'fs';\n\nimport execa from '../../thirdparty-wrappers/execa';\nimport {lift as liftGithubWorkflow} from './github-workflow';\n\nexport default async function ({projectRoot, packageManager}) {\n const pathToPackageJson = `${projectRoot}/package.json`;\n\n const existingPackageContents = await fs.readFile(pathToPackageJson, 'utf-8');\n const {scripts, ...otherTopLevelProperties} = JSON.parse(existingPackageContents);\n const {'coverage:report': reportCoverageScript, ...otherScripts} = scripts;\n\n await liftGithubWorkflow({projectRoot});\n\n if (scripts['coverage:report']) {\n await fs.writeFile(pathToPackageJson, JSON.stringify({...otherTopLevelProperties, scripts: otherScripts}));\n\n await execa(packageManager, ['remove', 'codecov']);\n\n return {\n nextSteps: [{\n summary: 'Configure modern reporting to Codecov on your CI service',\n description: 'Configure the [Codecov Uploader](https://docs.codecov.com/docs/codecov-uploader) appropriately'\n + ' for your CI Provider. If available for your provider, prefer one of the dedicated wrappers.'\n }]\n };\n }\n\n return {};\n}\n","import got from '../../thirdparty-wrappers/got';\n\nexport default async function ({vcs, apiAccessToken}) {\n const {body: {repo}} = await got(\n `https://codecov.io/api/gh/${vcs.owner}/${vcs.name}`,\n {headers: {Authorization: apiAccessToken}, responseType: 'json'}\n );\n\n return repo;\n}\n","import fetchRepositoryDetails from './repository-details-fetcher';\n\nexport async function scaffold({vcs, apiAccessToken}) {\n return {\n ...['github', 'gitlab', 'bitbucket'].includes(vcs?.host) && {\n badges: {\n status: {\n coverage: {\n img: `https://img.shields.io/codecov/c/${vcs.host}/${vcs.owner}/${vcs.name}?logo=codecov${\n apiAccessToken\n ? `&token=${(await fetchRepositoryDetails({vcs, apiAccessToken})).image_token}`\n : ''\n }`,\n link: `https://codecov.io/${vcs.host}/${vcs.owner}/${vcs.name}`,\n text: 'Codecov'\n }\n }\n }\n }\n };\n}\n","import {coverageShouldBeReportedToCodecov} from './predicates';\nimport {scaffold as scaffoldReporter} from './reporter';\nimport {scaffold as scaffoldBadge} from './badge';\n\nexport async function scaffold({vcs, visibility, apiAccessToken}) {\n if (!coverageShouldBeReportedToCodecov({vcs, visibility, apiAccessToken})) return {};\n\n return {\n ...scaffoldReporter(),\n ...await scaffoldBadge({vcs, apiAccessToken})\n };\n}\n","import {lift as liftReporting} from './reporter';\n\nexport function lift({projectRoot, packageManager}) {\n return liftReporting({projectRoot, packageManager});\n}\n"],"names":["coverageShouldBeReportedToCodecov","vcs","visibility","apiAccessToken","host","scaffold","devDependencies","scripts","lift","projectRoot","pathToWorkflowFile","fileExists","workflowDetails","load","fs","readFile","jobs","verify","steps","find","step","uses","startsWith","stepsWithLegacyReportingRemoved","filter","run","writeFile","dump","packageManager","pathToPackageJson","existingPackageContents","JSON","parse","otherTopLevelProperties","otherScripts","liftGithubWorkflow","stringify","execa","nextSteps","summary","description","body","repo","got","owner","name","headers","Authorization","responseType","includes","badges","status","coverage","img","fetchRepositoryDetails","image_token","link","text","scaffoldReporter","scaffoldBadge","liftReporting"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAA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A;AAAd,CAAd,EAA6C;AAClD,SAAOgC,aAAa,CAAC;AAACnD,IAAAA,WAAD;AAAcmB,IAAAA;AAAd,GAAD,CAApB;AACD;;;;"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@form8ion/codecov",
|
|
3
3
|
"description": "code coverage service plugin for form8ion",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.6.0",
|
|
6
6
|
"files": [
|
|
7
7
|
"example.js",
|
|
8
8
|
"lib/"
|
|
@@ -48,15 +48,17 @@
|
|
|
48
48
|
"test:integration:focus": "run-s 'test:integration:base -- --profile focus'"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@babel/register": "7.16.
|
|
51
|
+
"@babel/register": "7.16.5",
|
|
52
52
|
"@cucumber/cucumber": "8.0.0-rc.1",
|
|
53
|
-
"@form8ion/babel-preset": "1.6.
|
|
53
|
+
"@form8ion/babel-preset": "1.6.73",
|
|
54
54
|
"@form8ion/commitlint-config": "1.0.23",
|
|
55
|
-
"@form8ion/eslint-config": "
|
|
55
|
+
"@form8ion/eslint-config": "2.0.2",
|
|
56
56
|
"@form8ion/eslint-config-cucumber": "1.4.0",
|
|
57
|
-
"@form8ion/eslint-config-mocha": "1.2.
|
|
57
|
+
"@form8ion/eslint-config-mocha": "1.2.17",
|
|
58
|
+
"@form8ion/javascript-core": "4.0.1",
|
|
58
59
|
"@form8ion/remark-lint-preset": "2.1.7",
|
|
59
60
|
"@rollup/plugin-babel": "5.3.0",
|
|
61
|
+
"@rollup/plugin-node-resolve": "13.1.1",
|
|
60
62
|
"@travi/any": "2.0.19",
|
|
61
63
|
"ban-sensitive-files": "1.9.16",
|
|
62
64
|
"c8": "7.10.0",
|
|
@@ -77,11 +79,15 @@
|
|
|
77
79
|
"remark-toc": "8.0.1",
|
|
78
80
|
"remark-usage": "10.0.1",
|
|
79
81
|
"rimraf": "3.0.2",
|
|
80
|
-
"rollup": "2.
|
|
82
|
+
"rollup": "2.61.1",
|
|
81
83
|
"rollup-plugin-auto-external": "2.0.0",
|
|
82
|
-
"sinon": "12.0.1"
|
|
84
|
+
"sinon": "12.0.1",
|
|
85
|
+
"testdouble": "3.16.3"
|
|
83
86
|
},
|
|
84
87
|
"dependencies": {
|
|
85
|
-
"
|
|
88
|
+
"@form8ion/core": "^1.4.2",
|
|
89
|
+
"execa": "^5.1.1",
|
|
90
|
+
"got": "^11.8.2",
|
|
91
|
+
"js-yaml": "^4.1.0"
|
|
86
92
|
}
|
|
87
93
|
}
|