@naturalcycles/dev-lib 12.12.2 → 12.13.1

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.
@@ -10,7 +10,11 @@ const paths_cnst_1 = require("../cnst/paths.cnst");
10
10
  const sharedConfig = `${paths_cnst_1.cfgDir}/lint-staged.config.js`;
11
11
  const config = fs.existsSync(localConfig) ? localConfig : sharedConfig;
12
12
  // await execWithArgs(`lint-staged`, [`--config`, config])
13
- const lintStaged = require('lint-staged');
13
+ // const lintStaged = require('lint-staged')
14
+ // lint-staged is ESM since 12.0
15
+ // const lintStaged = await import('lint-staged')
16
+ // eslint-disable-next-line no-eval
17
+ const lintStaged = (await eval(`import('lint-staged')`)).default;
14
18
  const success = await lintStaged({
15
19
  configPath: config,
16
20
  });
package/dist/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
- import { buildProdCommand } from './cmd/build-prod.command';
1
+ export * from './cmd/build-prod.command';
2
2
  import type { BuildInfo } from './util/buildInfo.model';
3
- import { generateBuildInfo } from './util/buildInfo.util';
4
- import { getLastGitCommitMsg, gitCommitAll, gitCurrentCommitSha, gitCurrentCommitTimestamp, gitCurrentBranchName, gitCurrentRepoName, commitMessageToTitleMessage, gitIsAhead, gitHasUncommittedChanges, gitPush, gitPull } from './util/git.util';
5
- export { generateBuildInfo, buildProdCommand, getLastGitCommitMsg, gitCommitAll, gitCurrentCommitSha, gitCurrentCommitTimestamp, gitCurrentBranchName, gitCurrentRepoName, commitMessageToTitleMessage, gitIsAhead, gitHasUncommittedChanges, gitPush, gitPull, };
3
+ export * from './util/buildInfo.util';
4
+ export * from './util/git.util';
6
5
  export type { BuildInfo };
package/dist/index.js CHANGED
@@ -1,19 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.gitPull = exports.gitPush = exports.gitHasUncommittedChanges = exports.gitIsAhead = exports.commitMessageToTitleMessage = exports.gitCurrentRepoName = exports.gitCurrentBranchName = exports.gitCurrentCommitTimestamp = exports.gitCurrentCommitSha = exports.gitCommitAll = exports.getLastGitCommitMsg = exports.buildProdCommand = exports.generateBuildInfo = void 0;
4
- const build_prod_command_1 = require("./cmd/build-prod.command");
5
- Object.defineProperty(exports, "buildProdCommand", { enumerable: true, get: function () { return build_prod_command_1.buildProdCommand; } });
6
- const buildInfo_util_1 = require("./util/buildInfo.util");
7
- Object.defineProperty(exports, "generateBuildInfo", { enumerable: true, get: function () { return buildInfo_util_1.generateBuildInfo; } });
8
- const git_util_1 = require("./util/git.util");
9
- Object.defineProperty(exports, "getLastGitCommitMsg", { enumerable: true, get: function () { return git_util_1.getLastGitCommitMsg; } });
10
- Object.defineProperty(exports, "gitCommitAll", { enumerable: true, get: function () { return git_util_1.gitCommitAll; } });
11
- Object.defineProperty(exports, "gitCurrentCommitSha", { enumerable: true, get: function () { return git_util_1.gitCurrentCommitSha; } });
12
- Object.defineProperty(exports, "gitCurrentCommitTimestamp", { enumerable: true, get: function () { return git_util_1.gitCurrentCommitTimestamp; } });
13
- Object.defineProperty(exports, "gitCurrentBranchName", { enumerable: true, get: function () { return git_util_1.gitCurrentBranchName; } });
14
- Object.defineProperty(exports, "gitCurrentRepoName", { enumerable: true, get: function () { return git_util_1.gitCurrentRepoName; } });
15
- Object.defineProperty(exports, "commitMessageToTitleMessage", { enumerable: true, get: function () { return git_util_1.commitMessageToTitleMessage; } });
16
- Object.defineProperty(exports, "gitIsAhead", { enumerable: true, get: function () { return git_util_1.gitIsAhead; } });
17
- Object.defineProperty(exports, "gitHasUncommittedChanges", { enumerable: true, get: function () { return git_util_1.gitHasUncommittedChanges; } });
18
- Object.defineProperty(exports, "gitPush", { enumerable: true, get: function () { return git_util_1.gitPush; } });
19
- Object.defineProperty(exports, "gitPull", { enumerable: true, get: function () { return git_util_1.gitPull; } });
3
+ const tslib_1 = require("tslib");
4
+ (0, tslib_1.__exportStar)(require("./cmd/build-prod.command"), exports);
5
+ (0, tslib_1.__exportStar)(require("./util/buildInfo.util"), exports);
6
+ (0, tslib_1.__exportStar)(require("./util/git.util"), exports);
@@ -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) => {
@@ -1,7 +1,7 @@
1
1
  import * as timekeeper from 'timekeeper';
2
- import { jestOffline } from '../jestOffline.util';
3
- import { expectResults } from './expect.util';
4
- import { mockAllKindsOfThings } from './mockAllKindsOfThings';
5
- import { deepFreeze, silentConsole } from './testing.util';
6
- import { mockTime, mockTimeMillis, MOCK_TS_2018_06_21, resetTime } from './time.util';
7
- export { jestOffline, deepFreeze, silentConsole, mockTime, mockTimeMillis, resetTime, MOCK_TS_2018_06_21, timekeeper, mockAllKindsOfThings, expectResults, };
2
+ export * from '../jestOffline.util';
3
+ export * from './expect.util';
4
+ export * from './mockAllKindsOfThings';
5
+ export * from './testing.util';
6
+ export * from './time.util';
7
+ export { timekeeper };
@@ -1,19 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.expectResults = exports.mockAllKindsOfThings = exports.timekeeper = exports.MOCK_TS_2018_06_21 = exports.resetTime = exports.mockTimeMillis = exports.mockTime = exports.silentConsole = exports.deepFreeze = exports.jestOffline = void 0;
3
+ exports.timekeeper = void 0;
4
+ const tslib_1 = require("tslib");
4
5
  const timekeeper = require("timekeeper");
5
6
  exports.timekeeper = timekeeper;
6
- const jestOffline_util_1 = require("../jestOffline.util");
7
- Object.defineProperty(exports, "jestOffline", { enumerable: true, get: function () { return jestOffline_util_1.jestOffline; } });
8
- const expect_util_1 = require("./expect.util");
9
- Object.defineProperty(exports, "expectResults", { enumerable: true, get: function () { return expect_util_1.expectResults; } });
10
- const mockAllKindsOfThings_1 = require("./mockAllKindsOfThings");
11
- Object.defineProperty(exports, "mockAllKindsOfThings", { enumerable: true, get: function () { return mockAllKindsOfThings_1.mockAllKindsOfThings; } });
12
- const testing_util_1 = require("./testing.util");
13
- Object.defineProperty(exports, "deepFreeze", { enumerable: true, get: function () { return testing_util_1.deepFreeze; } });
14
- Object.defineProperty(exports, "silentConsole", { enumerable: true, get: function () { return testing_util_1.silentConsole; } });
15
- const time_util_1 = require("./time.util");
16
- Object.defineProperty(exports, "mockTime", { enumerable: true, get: function () { return time_util_1.mockTime; } });
17
- Object.defineProperty(exports, "mockTimeMillis", { enumerable: true, get: function () { return time_util_1.mockTimeMillis; } });
18
- Object.defineProperty(exports, "MOCK_TS_2018_06_21", { enumerable: true, get: function () { return time_util_1.MOCK_TS_2018_06_21; } });
19
- Object.defineProperty(exports, "resetTime", { enumerable: true, get: function () { return time_util_1.resetTime; } });
7
+ (0, tslib_1.__exportStar)(require("../jestOffline.util"), exports);
8
+ (0, tslib_1.__exportStar)(require("./expect.util"), exports);
9
+ (0, tslib_1.__exportStar)(require("./mockAllKindsOfThings"), exports);
10
+ (0, tslib_1.__exportStar)(require("./testing.util"), exports);
11
+ (0, tslib_1.__exportStar)(require("./time.util"), exports);
@@ -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,9 @@ 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.map(a => (0, nodejs_lib_1.inspectAny)(a)).join(' ') + '\n');
37
+ });
38
+ 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.2",
3
+ "version": "12.13.1",
4
4
  "scripts": {
5
5
  "prepare": "husky install",
6
6
  "tsn-debug": "tsn testScript.ts",
@@ -29,8 +29,8 @@
29
29
  "update-from-dev-lib": "tsn ./src/bin/update-from-dev-lib.ts"
30
30
  },
31
31
  "dependencies": {
32
- "@commitlint/cli": "^14.1.0",
33
- "@commitlint/config-conventional": "^14.1.0",
32
+ "@commitlint/cli": "^15.0.0",
33
+ "@commitlint/config-conventional": "^15.0.0",
34
34
  "@naturalcycles/cli": "^1.0.0",
35
35
  "@naturalcycles/js-lib": "^14.0.0",
36
36
  "@naturalcycles/nodejs-lib": "^12.0.0",
@@ -47,19 +47,19 @@
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",
54
54
  "fs-extra": "^10.0.0",
55
55
  "husky": "^7.0.0",
56
56
  "jest-junit": "^13.0.0",
57
- "lint-staged": "^11.0.0",
57
+ "lint-staged": "^12.0.2",
58
58
  "mitm": "^1.7.0",
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",