@naturalcycles/dev-lib 13.42.0 → 13.42.2

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.
@@ -25,23 +25,6 @@ async function lintAllCommand() {
25
25
  default: false,
26
26
  },
27
27
  }).argv;
28
- if (canRunBinary('actionlint')) {
29
- const env_1 = { stack: [], error: void 0, hasError: false };
30
- try {
31
- const _ = tslib_1.__addDisposableResource(env_1, (0, js_lib_1._blockTimer)('actionlint'), false);
32
- (0, nodejs_lib_1.execVoidCommandSync)(`actionlint`);
33
- }
34
- catch (e_1) {
35
- env_1.error = e_1;
36
- env_1.hasError = true;
37
- }
38
- finally {
39
- tslib_1.__disposeResources(env_1);
40
- }
41
- }
42
- else {
43
- console.log(`actionlint is not installed and won't be run.\nThis is how to install it: https://github.com/rhysd/actionlint/blob/main/docs/install.md`);
44
- }
45
28
  const hadChangesBefore = (0, nodejs_lib_1.gitHasUncommittedChanges)();
46
29
  // We run eslint BEFORE Prettier, because eslint can delete e.g unused imports.
47
30
  await (0, eslint_all_command_1.eslintAllCommand)();
@@ -50,10 +33,8 @@ async function lintAllCommand() {
50
33
  (0, stylelint_util_1.stylelintAll)();
51
34
  }
52
35
  (0, prettier_util_1.runPrettier)();
53
- if (node_fs_1.default.existsSync(`node_modules/@naturalcycles/ktlint`)) {
54
- const ktlintLib = require('@naturalcycles/ktlint');
55
- await ktlintLib.ktlintAll();
56
- }
36
+ runActionLint();
37
+ await runKTLint();
57
38
  console.log(`${(0, nodejs_lib_1.boldGrey)('lint-all')} ${(0, nodejs_lib_1.dimGrey)(`took ` + (0, js_lib_1._since)(started))}`);
58
39
  if (commitOnChanges || failOnChanges) {
59
40
  // detect changes
@@ -78,6 +59,22 @@ async function lintAllCommand() {
78
59
  }
79
60
  }
80
61
  exports.lintAllCommand = lintAllCommand;
62
+ async function runKTLint() {
63
+ if (node_fs_1.default.existsSync(`node_modules/@naturalcycles/ktlint`)) {
64
+ const ktlintLib = require('@naturalcycles/ktlint');
65
+ await ktlintLib.ktlintAll();
66
+ }
67
+ }
68
+ function runActionLint() {
69
+ if (canRunBinary('actionlint')) {
70
+ const started = Date.now();
71
+ (0, nodejs_lib_1.execVoidCommandSync)(`actionlint`);
72
+ console.log(`${(0, nodejs_lib_1.boldGrey)('actionlint')} ${(0, nodejs_lib_1.dimGrey)(`took ` + (0, js_lib_1._since)(started))}`);
73
+ }
74
+ else {
75
+ console.log(`actionlint is not installed and won't be run.\nThis is how to install it: https://github.com/rhysd/actionlint/blob/main/docs/install.md`);
76
+ }
77
+ }
81
78
  function canRunBinary(name) {
82
79
  try {
83
80
  (0, node_child_process_1.execSync)(`which ${name}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturalcycles/dev-lib",
3
- "version": "13.42.0",
3
+ "version": "13.42.2",
4
4
  "scripts": {
5
5
  "prepare": "husky install",
6
6
  "tsn-debug": "tsn testScript.ts",