@shivaedev/quality 0.28.1 → 0.29.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.29.0 - 2026-10-19
4
+
5
+ ### Breaking
6
+
7
+ - `toolOwned` in `files/named-after-export` and `files/other-names` now extends the default tool-owned paths instead of replacing them. Remove copied defaults from your configured lists and keep only repository-specific additions.
8
+
9
+ ## 0.28.2 - 2026-10-19
10
+
11
+ ### Changed
12
+
13
+ - `testProjects()` sizes workers from a connection budget instead of CPU capacity. Set `connectionBudget` and `connectionsPerWorker` to match the repository's PostgreSQL usage, or set `maxWorkers` to override the calculation.
14
+
3
15
  ## 0.28.1 - 2026-10-19
4
16
 
5
17
  ### Fixed
package/README.md CHANGED
@@ -188,7 +188,7 @@ Keep the default error level. The command replaces that rule's entries and leave
188
188
  - **Comments:** the `comments/*` rules reject JSDoc, TODOs, banners, line and pull request references, environment pragmas and more than two comments per file. A comment says why, never what the code already says or what it used to be. A tool pragma such as `@jsxImportSource` counts as a comment until both `comments/no-jsdoc` and `comments/max-per-file` list its tag in their `allow` option.
189
189
  - **Suppressions:** the `suppressions/*` rules reject inline lint and compiler directives, casts through `unknown`, `any` or `never`, Biome settings that weaken a check, recommended Biome rules the preset leaves below `error`, and `ignoreDeprecations`. None of them takes exceptions. A type test (`*.typecheck.test.ts`) may use `@ts-expect-error`; a test that must pass a rejected value at run time calls the API through `Reflect.apply`.
190
190
  - **Imports:** cycles, unresolvable imports, workspace imports missing from the manifest, relative imports that leave their folder, production imports of test code, runtime folders and fences, as described above.
191
- - **Names and files:** the Biome preset's naming rules and plugins, and the `files/*` rules, which name a file after its main export with its folders as the prefix. No naming rule renames anything; the author picks the name. A name an outside system owns, such as a query parameter or an environment variable, is written as a quoted key, which the naming rules skip. A `Schema.Struct` field stays camelCase even when quoted and maps to the outside name with `Schema.encodeKeys`. Biome's naming messages print only a pattern: spell acronyms as words (`HttpClient`, `userId`, `parseUrl`) rather than turning off `strictCase` as its hint suggests, give a type no `I` prefix, and name a type parameter `T`, `T` plus a PascalCase name (`TItem`), or Effect's `A`, `E` and `R`. No rule checks these, so review does: a boolean reads as a question (`isOpen`, `canRetry`) unless the DOM or React names it (`open`, `disabled`); a schema shares its name with its type (`type Item = typeof Item.Type`); an unused parameter is removed rather than renamed with the `_` prefix TypeScript accepts. The naming rules take repository facts: `toolOwned` lists `.gitignore` patterns whose names a tool fixes, and a configured list replaces the rule's defaults, so repeat any default you still need; `content` lists snake_case content folders and files; `tests/follow` and `tests/colocated` take `suites` for test folders with their own layout, such as a Playwright suite.
191
+ - **Names and files:** the Biome preset's naming rules and plugins, and the `files/*` rules, which name a file after its main export with its folders as the prefix. No naming rule renames anything; the author picks the name. A name an outside system owns, such as a query parameter or an environment variable, is written as a quoted key, which the naming rules skip. A `Schema.Struct` field stays camelCase even when quoted and maps to the outside name with `Schema.encodeKeys`. Biome's naming messages print only a pattern: spell acronyms as words (`HttpClient`, `userId`, `parseUrl`) rather than turning off `strictCase` as its hint suggests, give a type no `I` prefix, and name a type parameter `T`, `T` plus a PascalCase name (`TItem`), or Effect's `A`, `E` and `R`. No rule checks these, so review does: a boolean reads as a question (`isOpen`, `canRetry`) unless the DOM or React names it (`open`, `disabled`); a schema shares its name with its type (`type Item = typeof Item.Type`); an unused parameter is removed rather than renamed with the `_` prefix TypeScript accepts. The naming rules take repository facts: `toolOwned` lists `.gitignore` patterns whose names a tool fixes, and a configured list extends the rule's defaults, so list only repository-specific additions; `content` lists snake_case content folders and files; `tests/follow` and `tests/colocated` take `suites` for test folders with their own layout, such as a Playwright suite.
192
192
  - **Tests:** `tests/follow` and `tests/colocated` keep a test beside the code it covers, named `<file>[.<environment>].test.ts` or `<behaviour>[.<environment>].spec.ts`, and the story rules above keep setup in the kit.
193
193
  - **Manifests:** `manifests/sorted` keeps every `package.json` in sort-package-json order, and `manifests/source-first` puts the `source` condition first in `exports` and `imports`.
194
194
  - **Biome:** the `biome` rule reports Biome's error findings as `biome/<category>`. The preset's plugins ban ambient time, randomness, `console` and `process.env` in favour of Effect's services.
@@ -294,6 +294,17 @@ export default defineConfig({ test: testProjects() });
294
294
 
295
295
  `testProjects` runs unit tests and specs in Node and `.dom` tests and specs in test-story's DOM environment by default. The DOM environment keeps Node's host constructors separate from the happy-dom window, so DOM specs need no project remap. Each test gets 30 seconds instead of Vitest's 5, because tests that start servers, browsers or CLIs take seconds on a busy CI runner. `.slow` tests run only when `--project slow` asks for them. Type tests are excluded from Vitest and belong in the compiler's input. Every project excludes `**/.worktrees/**` so a checkout does not collect specs from its worktrees.
296
296
 
297
+ Worker concurrency comes from a configured PostgreSQL connection budget, independent of CPU count: `max(1, floor(connectionBudget / connectionsPerWorker))`. The defaults are 80 usable connections and 14 connections per worker, giving five workers. The budget leaves room on a typical 100-connection server for administration and other clients; the estimate allows for full-app tests with several pools. Set the budget from your server's `SHOW max_connections`, subtracting connections reserved for other clients and concurrent test processes. Quality does not query the server. If even one worker exceeds the budget, it still runs one worker; reduce that test's pool sizes or increase the server capacity.
298
+
299
+ Set the per-worker estimate to the peak connections held by one test worker, and supply your usable budget or an explicit worker override:
300
+
301
+ ```ts
302
+ testProjects({ connectionBudget: 84, connectionsPerWorker: 14 });
303
+ testProjects({ maxWorkers: 4 });
304
+ ```
305
+
306
+ The first configuration allows six workers, including on a two-CPU runner. `maxWorkers` takes precedence over the connection calculation. Counts and estimates must be positive safe integers. Vitest's native `--maxWorkers` CLI option can also override the returned configuration for a single run.
307
+
297
308
  Coverage is opt-in: `testProjects({ coverage: true })` enables Vitest's V8 provider across the selected projects. Install `@vitest/coverage-v8` at the same version as Vitest. The report includes unvisited `src/**/*.ts` and `src/**/*.tsx` files and excludes declarations, tests, specs and `test-support`. To customize it, pass native Vitest coverage options, for example `testProjects({ coverage: { reporter: ["lcov", "text-summary"] } })`. No separate coverage config is needed.
298
309
 
299
310
  Outside CI, `testProjects` sets `silent: "passed-only"` so local runs show logs only from failing tests. When `CI` is set to a nonempty value, it sets `silent: false` so CI keeps all test logs. It leaves `reporters` unset so Vitest can auto-detect its agent reporter. If a repository adds a reporter, spread `configDefaults.reporters` instead of replacing the defaults:
@@ -22,7 +22,7 @@ const TEST = /\.(?:test|spec)\.[cm]?[jt]sx?$/u;
22
22
  const SHEBANG = "#!";
23
23
  const SHAPES = "The file name and the names of its folders spell the export, in any order, and the file's first letter follows the export's case: listItems in items/ is items/list.ts, ItemPanel is ItemPanel.tsx or item/Panel.tsx.";
24
24
  const NamedAfterExportOptions = Schema.Struct({
25
- toolOwned: Schema.Array(Schema.String).pipe(Schema.withDecodingDefaultKey(Effect.succeed(DEFAULT_TOOL_OWNED))),
25
+ toolOwned: Schema.Array(Schema.String).pipe(Schema.withDecodingDefaultKey(Effect.succeed([]))),
26
26
  });
27
27
  function stemOf(path) {
28
28
  return posix.basename(path).replace(/\.[^.]+$/u, "");
@@ -75,7 +75,7 @@ function findingsOf(file, layout) {
75
75
  export const namedAfterExport = defineRule({
76
76
  check: async ({ files, options, readText, sources }) => {
77
77
  const layout = await packageLayout({ files, readText });
78
- const toolOwned = ignore().add([...options.toolOwned]);
78
+ const toolOwned = ignore().add([...DEFAULT_TOOL_OWNED, ...options.toolOwned]);
79
79
  return sources
80
80
  .filter((file) => !(TEST.test(file.path) || isMigrationFile(file.path) || toolOwned.ignores(file.path)))
81
81
  .flatMap((file) => findingsOf(file, layout));
@@ -1 +1 @@
1
- {"version":3,"file":"namedAfterExport.js","sourceRoot":"","sources":["../../../src/rules/files/namedAfterExport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,UAA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QACxD,MAAM,SAAS,GAAG,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,kBAAkB,EAAE,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;QAC9E,OAAO,OAAO;aACZ,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;aACvG,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IAC/C,CAAC;IACD,WAAW,EACV,sNAAsN;IACvN,EAAE,EAAE,0BAA0B;IAC9B,OAAO,EAAE,MAAM,CAAC,kBAAkB,CAAC,uBAAuB,EAAE,EAAE,YAAY,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,EAAE,CAAC;CAC3H,CAAC,CAAC"}
@@ -31,7 +31,7 @@ const SNAKE = /^[a-z0-9]+(?:__?[a-z0-9]+)*$/u;
31
31
  const CODE = /\.[cm]?[jt]sx?$/u;
32
32
  const OtherNamesOptions = Schema.Struct({
33
33
  content: Schema.Array(Schema.String).pipe(Schema.withDecodingDefaultKey(Effect.succeed([]))),
34
- toolOwned: Schema.Array(Schema.String).pipe(Schema.withDecodingDefaultKey(Effect.succeed(DEFAULT_TOOL_OWNED))),
34
+ toolOwned: Schema.Array(Schema.String).pipe(Schema.withDecodingDefaultKey(Effect.succeed([]))),
35
35
  });
36
36
  function stylesheetMessage(path, stem, importedBy) {
37
37
  const [only] = importedBy;
@@ -68,7 +68,7 @@ export const otherNames = defineRule({
68
68
  const context = {
69
69
  content: ignore().add([...options.content]),
70
70
  stylesheets: await stylesheetImporters({ files, readText, sources }),
71
- toolOwned: ignore().add([...options.toolOwned]),
71
+ toolOwned: ignore().add([...DEFAULT_TOOL_OWNED, ...options.toolOwned]),
72
72
  };
73
73
  return files.flatMap((path) => {
74
74
  const message = messageFor(path, context);
@@ -1 +1 @@
1
- {"version":3,"file":"otherNames.js","sourceRoot":"","sources":["../../../src/rules/files/otherNames.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,MAAM,EAAE,EAAe,MAAM,QAAQ,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAgB,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,MAAM,kBAAkB,GAAsB,CAAC,IAAI,EAAE,cAAc,EAAE,gBAAgB,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,CAAC,CAAC;AAElI,MAAM,YAAY,GAAwB,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC;AAE/I,MAAM,WAAW,GAAwB,IAAI,GAAG,CAAC;IAChD,MAAM;IACN,KAAK;IACL,MAAM;IACN,KAAK;IACL,MAAM;IACN,KAAK;IACL,MAAM;IACN,OAAO;IACP,IAAI;IACJ,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,MAAM;IACN,MAAM;IACN,OAAO;CACP,CAAC,CAAC;AAEH,MAAM,WAAW,GAAwB,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;AAElE,MAAM,YAAY,GAAG,4DAA4D,CAAC;AAElF,MAAM,KAAK,GAAG,+BAA+B,CAAC;AAE9C,MAAM,IAAI,GAA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AC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;QAC/D,CAAC,CAAC,CAAC;IACJ,CAAC;IACD,WAAW,EACV,6KAA6K;IAC9K,EAAE,EAAE,mBAAmB;IACvB,OAAO,EAAE,MAAM,CAAC,kBAAkB,CAAC,iBAAiB,EAAE,EAAE,YAAY,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,EAAE,CAAC;CACrH,CAAC,CAAC"}
@@ -1,6 +1,9 @@
1
1
  import { type TestUserConfig } from "vitest/config";
2
2
  export interface TestProjectsOptions {
3
+ readonly connectionBudget?: number;
4
+ readonly connectionsPerWorker?: number;
3
5
  readonly coverage?: boolean | NonNullable<TestUserConfig["coverage"]>;
6
+ readonly maxWorkers?: number;
4
7
  }
5
- export declare function testProjects({ coverage }?: TestProjectsOptions): TestUserConfig;
8
+ export declare function testProjects(options?: TestProjectsOptions): TestUserConfig;
6
9
  //# sourceMappingURL=testProjects.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"testProjects.d.ts","sourceRoot":"","sources":["../src/testProjects.ts"],"names":[],"mappings":"AAEA,OAAO,EAA0C,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAe5F,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC;CACtE;AAED,wBAAgB,YAAY,CAAC,EAAE,QAAgB,EAAE,GAAE,mBAAwB,GAAG,cAAc,CAgC3F"}
1
+ {"version":3,"file":"testProjects.d.ts","sourceRoot":"","sources":["../src/testProjects.ts"],"names":[],"mappings":"AAEA,OAAO,EAA0C,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAe5F,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IACvC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC;IACtE,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC7B;AAmBD,wBAAgB,YAAY,CAAC,OAAO,GAAE,mBAAwB,GAAG,cAAc,CAkC9E"}
@@ -9,9 +9,23 @@ function named(environment) {
9
9
  function excluding(...patterns) {
10
10
  return [...defaultExclude, "**/.worktrees/**", named("typecheck"), TYPECHECK_ALONE, ...patterns];
11
11
  }
12
- export function testProjects({ coverage = false } = {}) {
12
+ function positiveInteger(name, value) {
13
+ if (!Number.isSafeInteger(value) || value < 1) {
14
+ throw new RangeError(`${name} must be a positive safe integer`);
15
+ }
16
+ return value;
17
+ }
18
+ function workerCount({ connectionBudget = 80, connectionsPerWorker = 14, maxWorkers }) {
19
+ if (maxWorkers !== undefined) {
20
+ return positiveInteger("maxWorkers", maxWorkers);
21
+ }
22
+ return Math.max(1, Math.floor(positiveInteger("connectionBudget", connectionBudget) / positiveInteger("connectionsPerWorker", connectionsPerWorker)));
23
+ }
24
+ export function testProjects(options = {}) {
25
+ const { coverage = false } = options;
13
26
  const ci = Effect.runSync(Config.String("CI").pipe(Config.withDefault("")).parse(ConfigProvider.fromEnv()));
14
27
  return {
28
+ maxWorkers: workerCount(options),
15
29
  ...(coverage === false
16
30
  ? {}
17
31
  : {
@@ -1 +1 @@
1
- {"version":3,"file":"testProjects.js","sourceRoot":"","sources":["../src/testProjects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAuB,MAAM,eAAe,CAAC;AAG5F,MAAM,SAAS,GAAG,iBAAiB,CAAC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,CAAC,KAAK,CAAC,CAAC,CAAC,aAAa;QAClC,+IAA+I;QAC/I,WAAW,EAAE,MAAM;KACnB,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shivaedev/quality",
3
- "version": "0.28.1",
3
+ "version": "0.29.0",
4
4
  "description": "Repository quality gate with typed rules, a baseline of existing debt and a registry of reasoned exceptions",
5
5
  "homepage": "https://github.com/ShivaeDev/platform/tree/main/packages/quality#readme",
6
6
  "bugs": {
@@ -28,7 +28,7 @@ const SHAPES =
28
28
  "The file name and the names of its folders spell the export, in any order, and the file's first letter follows the export's case: listItems in items/ is items/list.ts, ItemPanel is ItemPanel.tsx or item/Panel.tsx.";
29
29
 
30
30
  const NamedAfterExportOptions = Schema.Struct({
31
- toolOwned: Schema.Array(Schema.String).pipe(Schema.withDecodingDefaultKey(Effect.succeed(DEFAULT_TOOL_OWNED))),
31
+ toolOwned: Schema.Array(Schema.String).pipe(Schema.withDecodingDefaultKey(Effect.succeed([]))),
32
32
  });
33
33
 
34
34
  function stemOf(path: string): string {
@@ -86,7 +86,7 @@ function findingsOf(file: SourceFile, layout: PackageLayout): readonly Finding[]
86
86
  export const namedAfterExport = defineRule({
87
87
  check: async ({ files, options, readText, sources }) => {
88
88
  const layout = await packageLayout({ files, readText });
89
- const toolOwned = ignore().add([...options.toolOwned]);
89
+ const toolOwned = ignore().add([...DEFAULT_TOOL_OWNED, ...options.toolOwned]);
90
90
  return sources
91
91
  .filter((file) => !(TEST.test(file.path) || isMigrationFile(file.path) || toolOwned.ignores(file.path)))
92
92
  .flatMap((file) => findingsOf(file, layout));
@@ -39,7 +39,7 @@ const CODE = /\.[cm]?[jt]sx?$/u;
39
39
 
40
40
  const OtherNamesOptions = Schema.Struct({
41
41
  content: Schema.Array(Schema.String).pipe(Schema.withDecodingDefaultKey(Effect.succeed([]))),
42
- toolOwned: Schema.Array(Schema.String).pipe(Schema.withDecodingDefaultKey(Effect.succeed(DEFAULT_TOOL_OWNED))),
42
+ toolOwned: Schema.Array(Schema.String).pipe(Schema.withDecodingDefaultKey(Effect.succeed([]))),
43
43
  });
44
44
 
45
45
  function stylesheetMessage(path: string, stem: string, importedBy: readonly string[]): string | undefined {
@@ -85,7 +85,7 @@ export const otherNames = defineRule({
85
85
  const context: Context = {
86
86
  content: ignore().add([...options.content]),
87
87
  stylesheets: await stylesheetImporters({ files, readText, sources }),
88
- toolOwned: ignore().add([...options.toolOwned]),
88
+ toolOwned: ignore().add([...DEFAULT_TOOL_OWNED, ...options.toolOwned]),
89
89
  };
90
90
  return files.flatMap((path): readonly Finding[] => {
91
91
  const message = messageFor(path, context);
@@ -16,12 +16,34 @@ function excluding(...patterns: readonly string[]): string[] {
16
16
  }
17
17
 
18
18
  export interface TestProjectsOptions {
19
+ readonly connectionBudget?: number;
20
+ readonly connectionsPerWorker?: number;
19
21
  readonly coverage?: boolean | NonNullable<TestUserConfig["coverage"]>;
22
+ readonly maxWorkers?: number;
20
23
  }
21
24
 
22
- export function testProjects({ coverage = false }: TestProjectsOptions = {}): TestUserConfig {
25
+ function positiveInteger(name: string, value: number): number {
26
+ if (!Number.isSafeInteger(value) || value < 1) {
27
+ throw new RangeError(`${name} must be a positive safe integer`);
28
+ }
29
+ return value;
30
+ }
31
+
32
+ function workerCount({ connectionBudget = 80, connectionsPerWorker = 14, maxWorkers }: TestProjectsOptions): number {
33
+ if (maxWorkers !== undefined) {
34
+ return positiveInteger("maxWorkers", maxWorkers);
35
+ }
36
+ return Math.max(
37
+ 1,
38
+ Math.floor(positiveInteger("connectionBudget", connectionBudget) / positiveInteger("connectionsPerWorker", connectionsPerWorker)),
39
+ );
40
+ }
41
+
42
+ export function testProjects(options: TestProjectsOptions = {}): TestUserConfig {
43
+ const { coverage = false } = options;
23
44
  const ci = Effect.runSync(Config.String("CI").pipe(Config.withDefault("")).parse(ConfigProvider.fromEnv()));
24
45
  return {
46
+ maxWorkers: workerCount(options),
25
47
  ...(coverage === false
26
48
  ? {}
27
49
  : {