@naturalcycles/dev-lib 12.12.3 → 12.13.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.
- package/cfg/eslint-rules.js +1 -0
- package/dist/bin/lint-staged-def.js +1 -1
- package/dist/index.d.ts +3 -4
- package/dist/index.js +4 -17
- package/dist/jestOffline.util.js +3 -2
- package/dist/testing/index.d.ts +6 -6
- package/dist/testing/index.js +7 -15
- package/dist/testing/testing.util.d.ts +2 -0
- package/dist/testing/testing.util.js +9 -1
- package/package.json +5 -5
package/cfg/eslint-rules.js
CHANGED
|
@@ -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 =
|
|
17
|
+
const { default: lintStaged } = await eval(`import('lint-staged')`);
|
|
18
18
|
const success = await lintStaged({
|
|
19
19
|
configPath: config,
|
|
20
20
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
export * from './cmd/build-prod.command';
|
|
2
2
|
import type { BuildInfo } from './util/buildInfo.model';
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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);
|
package/dist/jestOffline.util.js
CHANGED
|
@@ -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
|
-
|
|
12
|
+
(0, testing_1.jestLog)('NOT applying jestOffline() when --detectLeaks is on');
|
|
12
13
|
return;
|
|
13
14
|
}
|
|
14
|
-
|
|
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) => {
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as timekeeper from 'timekeeper';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export {
|
|
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 };
|
package/dist/testing/index.js
CHANGED
|
@@ -1,19 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.timekeeper = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
4
5
|
const timekeeper = require("timekeeper");
|
|
5
6
|
exports.timekeeper = timekeeper;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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);
|
|
@@ -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.
|
|
3
|
+
"version": "12.13.2",
|
|
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": "^
|
|
33
|
-
"@commitlint/config-conventional": "^
|
|
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,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": "^
|
|
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": "^
|
|
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",
|