@naturalcycles/dev-lib 12.12.4 → 12.13.3

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.
@@ -370,5 +370,6 @@ module.exports = {
370
370
  '@typescript-eslint/unbound-method': 0,
371
371
  '@typescript-eslint/no-unsafe-argument': 0, // prevents "legit" use of `any`
372
372
  'unicorn/prefer-export-from': 0, // breaks auto-imports in IntelliJ Idea
373
+ 'unicorn/no-await-expression-member': 0, // some cases are better as-is
373
374
  },
374
375
  }
@@ -14,7 +14,7 @@ const paths_cnst_1 = require("../cnst/paths.cnst");
14
14
  // lint-staged is ESM since 12.0
15
15
  // const lintStaged = await import('lint-staged')
16
16
  // eslint-disable-next-line no-eval
17
- const lintStaged = (await eval(`import('lint-staged')`)).default;
17
+ const { default: lintStaged } = await eval(`import('lint-staged')`);
18
18
  const success = await lintStaged({
19
19
  configPath: config,
20
20
  });
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.jestOffline = void 0;
4
+ const testing_1 = require("./testing");
4
5
  const LOCAL_HOSTS = ['localhost', '127.0.0.1'];
5
6
  const detectLeaks = process.argv.some(a => a.includes('detectLeaks'));
6
7
  /**
@@ -8,10 +9,10 @@ const detectLeaks = process.argv.some(a => a.includes('detectLeaks'));
8
9
  */
9
10
  function jestOffline() {
10
11
  if (detectLeaks) {
11
- console.log('NOT applying jestOffline() when --detectLeaks is on');
12
+ (0, testing_1.jestLog)('NOT applying jestOffline() when --detectLeaks is on');
12
13
  return;
13
14
  }
14
- console.log('jest offline mode');
15
+ (0, testing_1.jestLog)('jest offline mode');
15
16
  const createMitm = require('mitm');
16
17
  const mitm = createMitm();
17
18
  mitm.on('connect', (socket, opts) => {
@@ -5,3 +5,5 @@
5
5
  */
6
6
  export declare function deepFreeze(o: any): void;
7
7
  export declare function silentConsole(): void;
8
+ export declare const jestLogger: import("@naturalcycles/js-lib").CommonLogger;
9
+ export declare const jestLog: import("@naturalcycles/js-lib").CommonLogFunction;
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.silentConsole = exports.deepFreeze = void 0;
3
+ exports.jestLog = exports.jestLogger = exports.silentConsole = exports.deepFreeze = void 0;
4
+ const js_lib_1 = require("@naturalcycles/js-lib");
5
+ const nodejs_lib_1 = require("@naturalcycles/nodejs-lib");
4
6
  /**
5
7
  * Does Object.freeze recursively for given object.
6
8
  *
@@ -28,3 +30,13 @@ function silentConsole() {
28
30
  console.table = () => { };
29
31
  }
30
32
  exports.silentConsole = silentConsole;
33
+ exports.jestLogger = (0, js_lib_1.commonLoggerCreate)((level, args) => {
34
+ if (process.env['JEST_SILENT'])
35
+ return; // no-op
36
+ process.stdout.write(args
37
+ .map(a => (0, nodejs_lib_1.inspectAny)(a, {
38
+ includeErrorStack: level === 'error',
39
+ }))
40
+ .join(' ') + '\n');
41
+ });
42
+ exports.jestLog = exports.jestLogger.log.bind(exports.jestLogger);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturalcycles/dev-lib",
3
- "version": "12.12.4",
3
+ "version": "12.13.3",
4
4
  "scripts": {
5
5
  "prepare": "husky install",
6
6
  "tsn-debug": "tsn testScript.ts",
@@ -47,7 +47,7 @@
47
47
  "eslint-plugin-import": "^2.22.1",
48
48
  "eslint-plugin-jest": "^25.0.5",
49
49
  "eslint-plugin-jsdoc": "^37.0.0",
50
- "eslint-plugin-unicorn": "^38.0.0",
50
+ "eslint-plugin-unicorn": "^39.0.0",
51
51
  "eslint-plugin-unused-imports": "^2.0.0",
52
52
  "eslint-plugin-vue": "^8.0.1",
53
53
  "execa": "^5.0.0",
@@ -59,7 +59,7 @@
59
59
  "prettier": "^2.0.4",
60
60
  "stylelint": "^14.0.0",
61
61
  "stylelint-config-prettier": "^9.0.3",
62
- "stylelint-config-standard-scss": "^2.0.0",
62
+ "stylelint-config-standard-scss": "^3.0.0",
63
63
  "timekeeper": "^2.2.0",
64
64
  "ts-jest": "^27.0.0",
65
65
  "typescript": "^4.0.2",