@naturalcycles/dev-lib 15.2.0 → 15.4.0

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.
@@ -2,7 +2,7 @@ module.exports = {
2
2
  rules: {
3
3
  '@typescript-eslint/adjacent-overload-signatures': 2,
4
4
  '@typescript-eslint/ban-ts-comment': 0,
5
- '@typescript-eslint/ban-types': [
5
+ '@typescript-eslint/no-restricted-types': [
6
6
  2,
7
7
  {
8
8
  types: {
@@ -345,6 +345,7 @@ module.exports = {
345
345
  '@typescript-eslint/no-redundant-type-constituents': 0, // `'a' | string` is still useful for DX
346
346
  '@typescript-eslint/no-empty-function': 0,
347
347
  '@typescript-eslint/no-var-requires': 0,
348
+ '@typescript-eslint/no-require-imports': 0,
348
349
  '@typescript-eslint/no-explicit-any': 0,
349
350
  '@typescript-eslint/no-non-null-assertion': 0,
350
351
  '@typescript-eslint/explicit-module-boundary-types': [
@@ -30,6 +30,11 @@ const commands = [
30
30
  desc: 'Clean ./dist and ./dist-esm, then run "tsc" in CJS and ESM modes.',
31
31
  cliOnly: true,
32
32
  },
33
+ {
34
+ name: 'tsc',
35
+ fn: tscAll,
36
+ desc: 'Run tsc in folders (src, scripts, e2e, playwright) if there is tsconfig.json present',
37
+ },
33
38
  { name: 'bt', fn: bt, desc: 'Build & Test: run "build" and then "test".' },
34
39
  { name: 'lbt', fn: lbt, desc: 'Lint/Build/Test: run "lint", then "build", then "test".' },
35
40
  new prompts_1.Separator(), // test
@@ -122,9 +127,13 @@ async function lbt() {
122
127
  await bt();
123
128
  }
124
129
  async function bt() {
125
- await (0, build_util_1.runTSCInFolders)(['.', 'scripts'], ['--noEmit']);
130
+ await tscAll();
126
131
  (0, test_util_1.runJest)();
127
132
  }
133
+ async function tscAll() {
134
+ // todo: remove playwright after it fully moves to e2e
135
+ await (0, build_util_1.runTSCInFolders)(['.', 'scripts', 'e2e', 'playwright'], ['--noEmit']);
136
+ }
128
137
  function logEnvironment() {
129
138
  const { CPU_LIMIT, NODE_OPTIONS = 'not defined' } = process.env;
130
139
  const { node } = process.versions;
package/dist/test.util.js CHANGED
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.runJest = runJest;
4
4
  const tslib_1 = require("tslib");
5
5
  const node_fs_1 = tslib_1.__importDefault(require("node:fs"));
6
- const node_os_1 = tslib_1.__importDefault(require("node:os"));
7
6
  const js_lib_1 = require("@naturalcycles/js-lib");
8
7
  const nodejs_lib_1 = require("@naturalcycles/nodejs-lib");
9
8
  const paths_1 = require("./paths");
@@ -15,8 +14,7 @@ function runJest(opt = {}) {
15
14
  console.log((0, nodejs_lib_1.dimGrey)(`node_modules/${(0, nodejs_lib_1.white)('jest')} not found, skipping tests`));
16
15
  return;
17
16
  }
18
- const { CI, CPU_LIMIT, TZ = 'UTC', APP_ENV, JEST_NO_ALPHABETIC, JEST_SHARDS, NODE_OPTIONS = 'not defined', } = process.env;
19
- const { node } = process.versions;
17
+ const { CI, CPU_LIMIT, TZ = 'UTC', APP_ENV, JEST_NO_ALPHABETIC, JEST_SHARDS } = process.env;
20
18
  const cpuLimit = Number(CPU_LIMIT) || undefined;
21
19
  const { integration, manual, leaks } = opt;
22
20
  const processArgs = process.argv.slice(3);
@@ -80,17 +78,6 @@ function runJest(opt = {}) {
80
78
  if (!JEST_NO_ALPHABETIC) {
81
79
  args.push(`--testSequencer=${paths_1.cfgDir}/jest.alphabetic.sequencer.js`);
82
80
  }
83
- const availableParallelism = node_os_1.default.availableParallelism?.();
84
- const cpus = node_os_1.default.cpus().length;
85
- console.log((0, nodejs_lib_1.dimGrey)(Object.entries({
86
- node,
87
- NODE_OPTIONS,
88
- cpus,
89
- availableParallelism,
90
- cpuLimit,
91
- })
92
- .map(([k, v]) => `${k}: ${v}`)
93
- .join(', ')));
94
81
  if (JEST_SHARDS) {
95
82
  const totalShards = Number(JEST_SHARDS);
96
83
  const shards = (0, js_lib_1._range)(1, totalShards + 1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturalcycles/dev-lib",
3
- "version": "15.2.0",
3
+ "version": "15.4.0",
4
4
  "scripts": {
5
5
  "prepare": "husky",
6
6
  "tsn-debug": "tsn testScript.ts",
@@ -47,7 +47,7 @@
47
47
  "timekeeper": "^2.2.0",
48
48
  "ts-jest": "^29.0.0",
49
49
  "typescript": "^5.0.2",
50
- "typescript-eslint": "^7.16.1",
50
+ "typescript-eslint": "^8.0.0",
51
51
  "yargs": "^17.0.0"
52
52
  },
53
53
  "devDependencies": {