@roots/bud-compiler 2023.7.5-318 → 2023.7.18-452
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 +3 -2
- package/package.json +10 -10
- package/src/service.tsx +5 -4
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,11 +44,12 @@ 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
|
});
|
51
51
|
this.logger.timeEnd(`initialize`);
|
52
|
+
this.app.dashboard.updateStatus(`compiling`);
|
52
53
|
try {
|
53
54
|
this.instance = this.implementation(this.config);
|
54
55
|
}
|
@@ -90,7 +91,7 @@ export class Compiler extends Service {
|
|
90
91
|
: child.name;
|
91
92
|
this.stats = stats;
|
92
93
|
this.compilationStats = stats.toJson(statsOptions);
|
93
|
-
this.app.dashboard.
|
94
|
+
this.app.dashboard.updateStats(this.compilationStats);
|
94
95
|
if (stats.hasErrors()) {
|
95
96
|
process.exitCode = 1;
|
96
97
|
this.compilationStats.children = this.compilationStats.children?.map(child => ({
|
package/package.json
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
{
|
2
2
|
"name": "@roots/bud-compiler",
|
3
|
-
"version": "2023.7.
|
3
|
+
"version": "2023.7.18-452",
|
4
4
|
"description": "Compilation handler",
|
5
5
|
"engines": {
|
6
6
|
"node": ">=16"
|
7
7
|
},
|
8
8
|
"contributors": [
|
9
9
|
{
|
10
|
-
"name": "Kelly Mears",
|
11
10
|
"email": "developers@tinypixel.dev",
|
11
|
+
"name": "Kelly Mears",
|
12
12
|
"url": "https://github.com/kellymears"
|
13
13
|
},
|
14
14
|
{
|
15
|
-
"name": "Ben Word",
|
16
15
|
"email": "ben@benword.com",
|
16
|
+
"name": "Ben Word",
|
17
17
|
"url": "https://github.com/retlehs"
|
18
18
|
},
|
19
19
|
{
|
@@ -21,8 +21,8 @@
|
|
21
21
|
"url": "https://github.com/QWp6t"
|
22
22
|
},
|
23
23
|
{
|
24
|
-
"name": "Brandon",
|
25
24
|
"email": "brandon@tendency.me",
|
25
|
+
"name": "Brandon",
|
26
26
|
"url": "https://github.com/Log1x"
|
27
27
|
}
|
28
28
|
],
|
@@ -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-452",
|
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-452",
|
71
|
+
"@roots/bud-framework": "2023.7.18-452",
|
72
|
+
"@roots/bud-support": "2023.7.18-452",
|
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,13 +70,14 @@ 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
|
77
77
|
})
|
78
78
|
|
79
79
|
this.logger.timeEnd(`initialize`)
|
80
|
+
this.app.dashboard.updateStatus(`compiling`)
|
80
81
|
|
81
82
|
try {
|
82
83
|
this.instance = this.implementation(this.config)
|
@@ -99,7 +100,7 @@ export class Compiler extends Service implements BudCompiler {
|
|
99
100
|
* {@link BudCompiler.onError}
|
100
101
|
*/
|
101
102
|
@bind
|
102
|
-
public onError(error:
|
103
|
+
public onError(error: BudErrorClass | webpack.WebpackError) {
|
103
104
|
process.exitCode = 1
|
104
105
|
|
105
106
|
this.app.server?.appliedMiddleware?.hot?.publish({error})
|
@@ -131,7 +132,7 @@ export class Compiler extends Service implements BudCompiler {
|
|
131
132
|
|
132
133
|
this.compilationStats = stats.toJson(statsOptions)
|
133
134
|
|
134
|
-
this.app.dashboard.
|
135
|
+
this.app.dashboard.updateStats(this.compilationStats)
|
135
136
|
|
136
137
|
if (stats.hasErrors()) {
|
137
138
|
process.exitCode = 1
|