qa-control 0.6.4 → 0.6.7
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 +1 -1
- package/bin/definition/definition.js +37 -4
- package/bin/qa-control-run.js +0 -2
- package/bin/qa-control.js +3 -1
- package/bin/qac-init.js +1 -1
- package/package.json +4 -5
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ Quality assurance tool for node/npm projects
|
|
|
8
8
|
[](https://npmjs.org/package/qa-control)
|
|
9
9
|
[](https://github.com/codenautas/qa-control/actions/workflows/build-and-test.yml)
|
|
10
10
|
[](https://coveralls.io/r/codenautas/qa-control)
|
|
11
|
-
[](https://socket.dev/npm/package/qa-control)
|
|
12
12
|
[](https://github.com/codenautas/qa-control/actions/workflows/qa-control.yml)
|
|
13
13
|
|
|
14
14
|
|
|
@@ -13,7 +13,7 @@ function eslintrcToFlatConfig(rc) {
|
|
|
13
13
|
return flat;
|
|
14
14
|
}
|
|
15
15
|
var multilang = require('multilang');
|
|
16
|
-
var fs = require('fs-
|
|
16
|
+
var fs = require('fs-extra');
|
|
17
17
|
var Path = require('path');
|
|
18
18
|
var yaml = require('js-yaml');
|
|
19
19
|
|
|
@@ -160,10 +160,10 @@ module.exports = function(qaControl){
|
|
|
160
160
|
imgExample:'https://raw.githubusercontent.com/codenautas/codenautas/master/img/coverage.png',
|
|
161
161
|
docDescription: ''
|
|
162
162
|
},
|
|
163
|
-
|
|
163
|
+
security:{
|
|
164
164
|
mandatory:true,
|
|
165
|
-
md:'[](https://socket.dev/npm/package/yyy)',
|
|
166
|
+
imgExample:'https://socket.dev/api/badge/npm/package/my-package',
|
|
167
167
|
docDescription: ''
|
|
168
168
|
},
|
|
169
169
|
'qa-control':{
|
|
@@ -678,6 +678,39 @@ module.exports = function(qaControl){
|
|
|
678
678
|
return warns;
|
|
679
679
|
}
|
|
680
680
|
}]
|
|
681
|
+
},
|
|
682
|
+
workflows:{
|
|
683
|
+
checks:[{
|
|
684
|
+
warnings:function(info) {
|
|
685
|
+
var qaSection = info.packageJson?.['qa-control'] || {};
|
|
686
|
+
var gha = qaSection.gha;
|
|
687
|
+
if(gha === 'skip' || (qaSection.profile === 'minimum' && !gha)) { return []; }
|
|
688
|
+
var qaWorkflowsDir = Path.join(__dirname, '../../.github/workflows');
|
|
689
|
+
var projWorkflowsDir = Path.join(info.projectDir, '.github/workflows');
|
|
690
|
+
return fs.readdir(qaWorkflowsDir).then(function(qaFiles) {
|
|
691
|
+
return Promise.all(qaFiles.map(function(fileName) {
|
|
692
|
+
return fs.readFile(Path.join(qaWorkflowsDir, fileName), 'utf8').then(function(qaContent) {
|
|
693
|
+
return fs.readFile(Path.join(projWorkflowsDir, fileName), 'utf8').then(function(projContent) {
|
|
694
|
+
if(qaContent !== projContent) {
|
|
695
|
+
return [{warning:'workflow_file_1_differs', params:[fileName], scoring:{workflows:1}}];
|
|
696
|
+
}
|
|
697
|
+
return [];
|
|
698
|
+
}).catch(function(err) {
|
|
699
|
+
if(err.code === 'ENOENT') {
|
|
700
|
+
return [{warning:'lack_of_workflow_file_1', params:[fileName], scoring:{workflows:1}}];
|
|
701
|
+
}
|
|
702
|
+
throw err;
|
|
703
|
+
});
|
|
704
|
+
});
|
|
705
|
+
}));
|
|
706
|
+
}).then(function(results) {
|
|
707
|
+
return results.reduce(function(acc, arr) { return acc.concat(arr); }, []);
|
|
708
|
+
}).catch(function(err) {
|
|
709
|
+
if(err.code === 'ENOENT') { return []; }
|
|
710
|
+
throw err;
|
|
711
|
+
});
|
|
712
|
+
}
|
|
713
|
+
}]
|
|
681
714
|
}
|
|
682
715
|
}
|
|
683
716
|
};
|
package/bin/qa-control-run.js
CHANGED
package/bin/qa-control.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// CMD-TOOL
|
|
4
4
|
var qaControl = {};
|
|
5
5
|
|
|
6
|
-
var fs = require('fs-
|
|
6
|
+
var fs = require('fs-extra');
|
|
7
7
|
var Path = require('path');
|
|
8
8
|
var stripBom = require('strip-bom-string');
|
|
9
9
|
var yaml = require('js-yaml');
|
|
@@ -61,6 +61,8 @@ qaControl.msgs={
|
|
|
61
61
|
invalid_files_section_in_package_json: 'La sección "files" en package.json es inválida',
|
|
62
62
|
incorrect_ecmascript_versions_in_package_json: 'Las versiones de ECMAScript utilizadas en package.json son incorrectas',
|
|
63
63
|
non_recomended_dependency_1_in_package_json: 'Dependencia no recomendada "$1" en package.json',
|
|
64
|
+
lack_of_workflow_file_1: 'falta el archivo de workflow "$1"',
|
|
65
|
+
workflow_file_1_differs: 'el archivo de workflow "$1" difiere del template de qa-control',
|
|
64
66
|
bailing_could_be_more: '¡Qué --bail(e)! Podrían haber más problemas, correr de nuevo después de corregir estos'
|
|
65
67
|
}
|
|
66
68
|
};
|
package/bin/qac-init.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qa-control",
|
|
3
3
|
"description": "QA control of things that nobody controls",
|
|
4
|
-
"version": "0.6.
|
|
4
|
+
"version": "0.6.7",
|
|
5
5
|
"author": "Codenautas <codenautas@googlegroups.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": "codenautas/qa-control",
|
|
@@ -25,11 +25,10 @@
|
|
|
25
25
|
"uuid": ">=14.0.0"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"best-globals": "^2.1.
|
|
28
|
+
"best-globals": "^2.1.5",
|
|
29
29
|
"commander": "^14.0.3",
|
|
30
|
-
"eslint": "^10.
|
|
30
|
+
"eslint": "^10.4.0",
|
|
31
31
|
"fs-extra": "^11.3.5",
|
|
32
|
-
"fs-promise": "^2.0.3",
|
|
33
32
|
"js-yaml": "^4.1.1",
|
|
34
33
|
"multilang": "^1.2.1",
|
|
35
34
|
"semver": "^7.8.0",
|
|
@@ -37,7 +36,7 @@
|
|
|
37
36
|
},
|
|
38
37
|
"devDependencies": {
|
|
39
38
|
"@types/mocha": "^10.0.10",
|
|
40
|
-
"@types/node": "^25.
|
|
39
|
+
"@types/node": "^25.9.0",
|
|
41
40
|
"expect-called": "^0.4.0",
|
|
42
41
|
"expect.js": "^0.3.1",
|
|
43
42
|
"mocha": "^11.7.5",
|