@genesislcap/eslint-stylelint-builder 14.385.0 → 14.386.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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;yBAGrC,KAAK,YAAY;AAAvC,wBA8BE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;yBAIrC,KAAK,YAAY;AAAvC,wBAuCE"}
package/dist/index.js CHANGED
@@ -3,8 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const build_kit_1 = require("@genesislcap/build-kit");
5
5
  const consola_1 = tslib_1.__importDefault(require("consola"));
6
+ const os_1 = tslib_1.__importDefault(require("os"));
6
7
  exports.default = (ctx) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
7
- const { dirs: { cwd }, cli: { isLint, options: { profile, linter, fix }, }, } = ctx;
8
+ const { dirs: { cwd }, cli: { isLint, options: { profile, linter, fix, concurrency }, }, } = ctx;
8
9
  if (isLint) {
9
10
  const fixArg = fix ? ' --fix' : '';
10
11
  if (!linter || linter === 'eslint' || linter === 'all') {
@@ -13,7 +14,17 @@ exports.default = (ctx) => tslib_1.__awaiter(void 0, void 0, void 0, function* (
13
14
  process.env.TIMING = '1';
14
15
  }
15
16
  const eslint = yield (0, build_kit_1.resolveBin)('eslint');
16
- (0, build_kit_1.run)(cwd, `${eslint} "./**/*.{ts,js}" ${fixArg}`);
17
+ let concurrencyArg = '';
18
+ if (concurrency) {
19
+ concurrencyArg = ` --concurrency ${concurrency}`;
20
+ }
21
+ else if (!process.env.CI) {
22
+ const defaultConcurrency = Math.max(1, Math.floor(os_1.default.cpus().length / 2));
23
+ concurrencyArg = ` --concurrency ${defaultConcurrency}`;
24
+ }
25
+ const command = `${eslint} "./**/*.{ts,js}" ${fixArg}${concurrencyArg}`;
26
+ consola_1.default.info(`Executing: ${command}`);
27
+ (0, build_kit_1.run)(cwd, command);
17
28
  consola_1.default.success('ESLint completed');
18
29
  }
19
30
  if (!linter || linter === 'stylelint' || linter === 'all') {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/eslint-stylelint-builder",
3
3
  "description": "ESLint/Stylelint builder",
4
- "version": "14.385.0",
4
+ "version": "14.386.1",
5
5
  "license": "SEE LICENSE IN license.txt",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -14,9 +14,9 @@
14
14
  "dev": "tsc -b ./tsconfig.json -w"
15
15
  },
16
16
  "dependencies": {
17
- "@genesislcap/build-kit": "14.385.0",
17
+ "@genesislcap/build-kit": "14.386.1",
18
18
  "consola": "^3.0.2",
19
- "eslint": "^8.0.0",
19
+ "eslint": "^9.34.0",
20
20
  "stylelint": "^14.0.0"
21
21
  },
22
22
  "repository": {
@@ -27,5 +27,5 @@
27
27
  "publishConfig": {
28
28
  "access": "public"
29
29
  },
30
- "gitHead": "a88364dbf8f6a8e87274f572f76ab3cd0fe1983b"
30
+ "gitHead": "64f3112ad5703fc7b72e253e30bd78cce50c4a60"
31
31
  }
package/src/index.ts CHANGED
@@ -1,13 +1,14 @@
1
1
  import { run, resolveBin } from '@genesislcap/build-kit';
2
2
  import type { BuildContext } from '@genesislcap/build-kit';
3
3
  import consola from 'consola';
4
+ import os from 'os';
4
5
 
5
6
  export default async (ctx: BuildContext) => {
6
7
  const {
7
8
  dirs: { cwd },
8
9
  cli: {
9
10
  isLint,
10
- options: { profile, linter, fix },
11
+ options: { profile, linter, fix, concurrency },
11
12
  },
12
13
  } = ctx;
13
14
  if (isLint) {
@@ -19,7 +20,16 @@ export default async (ctx: BuildContext) => {
19
20
  process.env.TIMING = '1';
20
21
  }
21
22
  const eslint = await resolveBin('eslint');
22
- run(cwd, `${eslint} "./**/*.{ts,js}" ${fixArg}`);
23
+ let concurrencyArg = '';
24
+ if (concurrency) {
25
+ concurrencyArg = ` --concurrency ${concurrency}`;
26
+ } else if (!process.env.CI) {
27
+ const defaultConcurrency = Math.max(1, Math.floor(os.cpus().length / 2));
28
+ concurrencyArg = ` --concurrency ${defaultConcurrency}`;
29
+ }
30
+ const command = `${eslint} "./**/*.{ts,js}" ${fixArg}${concurrencyArg}`;
31
+ consola.info(`Executing: ${command}`);
32
+ run(cwd, command);
23
33
  consola.success('ESLint completed');
24
34
  }
25
35