@roots/bud-compiler 2023.7.6-734 → 2023.7.18-645
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/lib/service.d.ts +2 -2
- package/lib/service.js +1 -1
- package/package.json +7 -7
- package/src/service.tsx +3 -3
package/lib/service.d.ts
CHANGED
@@ -3,7 +3,7 @@ import type { Bud } from '@roots/bud-framework';
|
|
3
3
|
import type { MultiCompiler, MultiStats, Stats, StatsError, Webpack } from '@roots/bud-framework/config';
|
4
4
|
import type { ErrorWithSourceFile } from '@roots/bud-support/open';
|
5
5
|
import { Service } from '@roots/bud-framework/service';
|
6
|
-
import { type
|
6
|
+
import { type BudErrorClass } from '@roots/bud-support/errors';
|
7
7
|
import webpack from '@roots/bud-support/webpack';
|
8
8
|
/**
|
9
9
|
* {@link BudCompiler} implementation
|
@@ -36,7 +36,7 @@ export declare class Compiler extends Service implements BudCompiler {
|
|
36
36
|
/**
|
37
37
|
* {@link BudCompiler.onError}
|
38
38
|
*/
|
39
|
-
onError(error:
|
39
|
+
onError(error: BudErrorClass | webpack.WebpackError): void;
|
40
40
|
/**
|
41
41
|
* {@link BudCompiler.onStats}
|
42
42
|
*/
|
package/lib/service.js
CHANGED
@@ -44,7 +44,7 @@ export class Compiler extends Service {
|
|
44
44
|
: await Promise.all(Object.values(bud.children).map(async (child) => await child.build.make().catch(error => {
|
45
45
|
throw error;
|
46
46
|
})));
|
47
|
-
this.config.parallelism = Math.
|
47
|
+
this.config.parallelism = Math.max(cpus().length - 1, 1);
|
48
48
|
await bud.hooks.fire(`compiler.before`, bud).catch(error => {
|
49
49
|
throw error;
|
50
50
|
});
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@roots/bud-compiler",
|
3
|
-
"version": "2023.7.
|
3
|
+
"version": "2023.7.18-645",
|
4
4
|
"description": "Compilation handler",
|
5
5
|
"engines": {
|
6
6
|
"node": ">=16"
|
@@ -61,15 +61,15 @@
|
|
61
61
|
"types": "./lib/index.d.ts",
|
62
62
|
"module": "./lib/index.js",
|
63
63
|
"devDependencies": {
|
64
|
-
"@roots/bud-api": "2023.7.
|
64
|
+
"@roots/bud-api": "2023.7.18-645",
|
65
65
|
"@skypack/package-check": "0.2.2",
|
66
|
-
"@types/node": "18.16.
|
67
|
-
"@types/react": "18.2.
|
66
|
+
"@types/node": "18.16.19",
|
67
|
+
"@types/react": "18.2.15"
|
68
68
|
},
|
69
69
|
"dependencies": {
|
70
|
-
"@roots/bud-dashboard": "2023.7.
|
71
|
-
"@roots/bud-framework": "2023.7.
|
72
|
-
"@roots/bud-support": "2023.7.
|
70
|
+
"@roots/bud-dashboard": "2023.7.18-645",
|
71
|
+
"@roots/bud-framework": "2023.7.18-645",
|
72
|
+
"@roots/bud-support": "2023.7.18-645",
|
73
73
|
"react": "18.2.0",
|
74
74
|
"tslib": "2.6.0"
|
75
75
|
},
|
package/src/service.tsx
CHANGED
@@ -20,7 +20,7 @@ import {pathToFileURL} from 'node:url'
|
|
20
20
|
import {Error} from '@roots/bud-dashboard/components/error'
|
21
21
|
import {Service} from '@roots/bud-framework/service'
|
22
22
|
import {bind} from '@roots/bud-support/decorators/bind'
|
23
|
-
import {BudError, type
|
23
|
+
import {BudError, type BudErrorClass} from '@roots/bud-support/errors'
|
24
24
|
import {duration} from '@roots/bud-support/human-readable'
|
25
25
|
import {render} from '@roots/bud-support/ink'
|
26
26
|
import stripAnsi from '@roots/bud-support/strip-ansi'
|
@@ -70,7 +70,7 @@ export class Compiler extends Service implements BudCompiler {
|
|
70
70
|
}),
|
71
71
|
),
|
72
72
|
)
|
73
|
-
this.config.parallelism = Math.
|
73
|
+
this.config.parallelism = Math.max(cpus().length - 1, 1)
|
74
74
|
|
75
75
|
await bud.hooks.fire(`compiler.before`, bud).catch(error => {
|
76
76
|
throw error
|
@@ -100,7 +100,7 @@ export class Compiler extends Service implements BudCompiler {
|
|
100
100
|
* {@link BudCompiler.onError}
|
101
101
|
*/
|
102
102
|
@bind
|
103
|
-
public onError(error:
|
103
|
+
public onError(error: BudErrorClass | webpack.WebpackError) {
|
104
104
|
process.exitCode = 1
|
105
105
|
|
106
106
|
this.app.server?.appliedMiddleware?.hot?.publish({error})
|