@roots/bud-compiler 5.0.0-next.17 → 5.0.0-next.18
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/README.md +7 -24
- package/lib/cjs/Compiler/index.js +20 -33
- package/lib/cjs/Compiler/index.js.map +1 -1
- package/lib/esm/Compiler/index.js +21 -34
- package/lib/esm/Compiler/index.js.map +1 -1
- package/lib/tsconfig-esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -6
- package/types/Compiler/index.d.ts +5 -8
- package/types/Compiler/index.d.ts.map +1 -1
package/README.md
CHANGED
@@ -1,37 +1,18 @@
|
|
1
1
|
<p align="center">
|
2
|
-
<img
|
2
|
+
<img src="https://cdn.roots.io/app/uploads/logo-bud.svg" height="100" alt="Bud" />
|
3
3
|
</p>
|
4
4
|
|
5
5
|
<p align="center">
|
6
|
-
<img
|
7
|
-
alt="MIT License"
|
8
|
-
src="https://img.shields.io/github/license/roots/bud?color=%23525ddc&style=flat-square"
|
9
|
-
/>
|
10
|
-
<a
|
11
|
-
href="https://app.fossa.com/projects/git%2Bgithub.com%2Froots%2Fbud?ref=badge_small"
|
12
|
-
alt="FOSSA Status"
|
13
|
-
>
|
14
|
-
<img src="https://app.fossa.com/api/projects/git%2Bgithub.com%2Froots%2Fbud.svg?type=small" />
|
15
|
-
</a>
|
16
|
-
<a href="https://www.npmjs.com/package/@roots/bud">
|
17
|
-
<img src="https://img.shields.io/npm/v/@roots/bud.svg?color=%23525ddc&style=flat-square" />
|
18
|
-
</a>
|
19
|
-
<a href="https://codecov.io/gh/roots/bud">
|
20
|
-
<img src="https://codecov.io/gh/roots/bud/branch/next/graph/badge.svg?token=DRJ28OD8XD" />
|
21
|
-
</a>
|
22
|
-
<a href="https://twitter.com/rootswp">
|
23
|
-
<img
|
24
|
-
alt="Follow Roots"
|
25
|
-
src="https://img.shields.io/twitter/follow/rootswp.svg?color=%23525ddc&style=flat-square"
|
26
|
-
/>
|
27
|
-
</a>
|
6
|
+
<img alt="MIT License" src="https://img.shields.io/github/license/roots/bud?color=%23525ddc&style=flat-square" /> <img alt="npm" src="https://img.shields.io/npm/v/@roots/bud.svg?color=%23525ddc&style=flat-square" /> <img alt="Follow Roots" src="https://img.shields.io/twitter/follow/rootswp.svg?color=%23525ddc&style=flat-square" />
|
28
7
|
</p>
|
29
8
|
|
30
9
|
<h1 align="center">
|
31
10
|
<strong>@roots/bud-compiler</strong>
|
32
11
|
</h1>
|
33
12
|
|
34
|
-
|
13
|
+
<p align="center">
|
14
|
+
Compilation handler
|
15
|
+
</p>
|
35
16
|
|
36
17
|
## Installation
|
37
18
|
|
@@ -58,11 +39,13 @@ Keep track of development and community news.
|
|
58
39
|
## Contributing
|
59
40
|
|
60
41
|
Contributions are welcome from everyone.
|
42
|
+
|
61
43
|
We have [contribution guidelines](https://github.com/roots/guidelines/blob/master/CONTRIBUTING.md) to help you get started.
|
62
44
|
|
63
45
|
## Sponsors
|
64
46
|
|
65
47
|
Help support our open-source development efforts by [becoming a patron](https://www.patreon.com/rootsdev).
|
48
|
+
|
66
49
|
<a href="https://kinsta.com/?kaid=OFDHAJIXUDIV"><img src="https://cdn.roots.io/app/uploads/kinsta.svg" alt="Kinsta" width="200" height="150"/></a>
|
67
50
|
<a href="https://k-m.com/"><img src="https://cdn.roots.io/app/uploads/km-digital.svg" alt="KM Digital" width="200" height="150"/></a>
|
68
51
|
<a href="https://carrot.com/"><img src="https://cdn.roots.io/app/uploads/carrot.svg" alt="Carrot" width="200" height="150"/></a>
|
@@ -30,6 +30,10 @@ class Compiler extends bud_framework_1.Service {
|
|
30
30
|
* @public
|
31
31
|
*/
|
32
32
|
this.stats = INITIAL_STATS;
|
33
|
+
/**
|
34
|
+
* Compiler errors
|
35
|
+
*/
|
36
|
+
this.errors = [];
|
33
37
|
/**
|
34
38
|
* True if compiler is already instantiated
|
35
39
|
*
|
@@ -41,18 +45,6 @@ class Compiler extends bud_framework_1.Service {
|
|
41
45
|
*/
|
42
46
|
this.config = [];
|
43
47
|
}
|
44
|
-
/**
|
45
|
-
* Service register event
|
46
|
-
*
|
47
|
-
* @public
|
48
|
-
* @decorator `@bind`
|
49
|
-
*/
|
50
|
-
register() {
|
51
|
-
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
52
|
-
this.app.hooks.filter('event.compiler.register.before', this.app);
|
53
|
-
this.app.hooks.filter('event.compiler.register.after', this.app);
|
54
|
-
});
|
55
|
-
}
|
56
48
|
/**
|
57
49
|
* Initiates compilation
|
58
50
|
*
|
@@ -75,27 +67,20 @@ class Compiler extends bud_framework_1.Service {
|
|
75
67
|
*/
|
76
68
|
invoke(config) {
|
77
69
|
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
78
|
-
config =
|
70
|
+
config =
|
71
|
+
yield this.app.hooks.filterAsync('event.compiler.before', config);
|
79
72
|
config = this.app.hooks.filter('config.override', config);
|
80
73
|
this.instance = (0, webpack_1.webpack)(config);
|
81
74
|
this.instance.hooks.done.tap(config[0].name, (stats) => (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
82
|
-
|
75
|
+
this.app.hooks.filter('event.compiler.done', stats);
|
83
76
|
stats && Object.assign(this.stats, stats.toJson());
|
84
77
|
if (this.app.store.is('features.dashboard', false)) {
|
85
|
-
this.log('log', stats.toString(
|
86
|
-
colors: true,
|
87
|
-
modules: false,
|
88
|
-
children: false,
|
89
|
-
chunks: false,
|
90
|
-
chunkModules: false,
|
91
|
-
entrypoints: false,
|
92
|
-
performance: false,
|
93
|
-
}));
|
78
|
+
this.log('log', stats.toString(this.app.store.get('build.stats')));
|
94
79
|
}
|
95
80
|
if (this.app.isProduction) {
|
96
81
|
this.instance.close(err => {
|
97
82
|
if (err) {
|
98
|
-
err = this.app.hooks.filter('compiler.error', err);
|
83
|
+
err = this.app.hooks.filter('event.compiler.error', err);
|
99
84
|
this.stats.errors.push(err);
|
100
85
|
this.log('error', err);
|
101
86
|
}
|
@@ -106,7 +91,7 @@ class Compiler extends bud_framework_1.Service {
|
|
106
91
|
new webpack_1.ProgressPlugin((...args) => {
|
107
92
|
this.progress = args;
|
108
93
|
}).apply(this.instance);
|
109
|
-
this.app.hooks.filter('event.compiler.after');
|
94
|
+
this.app.hooks.filter('event.compiler.after', this.app);
|
110
95
|
return this.instance;
|
111
96
|
});
|
112
97
|
}
|
@@ -158,7 +143,7 @@ class Compiler extends bud_framework_1.Service {
|
|
158
143
|
* @decorator `@bind`
|
159
144
|
*/
|
160
145
|
callback(...args) {
|
161
|
-
var _a;
|
146
|
+
var _a, _b;
|
162
147
|
/**
|
163
148
|
* production mode callback takes two parameters (webpack err and stats)
|
164
149
|
* however, the done hook used in development just takes one (stats)
|
@@ -168,20 +153,22 @@ class Compiler extends bud_framework_1.Service {
|
|
168
153
|
*/
|
169
154
|
let [err, stats] = args.length > 1 ? args : [null, args.pop()];
|
170
155
|
if ((stats === null || stats === void 0 ? void 0 : stats.toJson) && isFunction(stats.toJson)) {
|
171
|
-
this.stats = stats.toJson(
|
172
|
-
this.stats = this.app.hooks.filter('compiler.stats', this.stats);
|
156
|
+
this.stats = stats.toJson(this.app.store.get('build.stats'));
|
157
|
+
this.stats = this.app.hooks.filter('event.compiler.stats', this.stats);
|
173
158
|
}
|
174
159
|
if (err) {
|
175
|
-
|
176
|
-
|
160
|
+
if (this.app.isDevelopment) {
|
161
|
+
(_b = (_a = this.app.server.middleware) === null || _a === void 0 ? void 0 : _a.hot) === null || _b === void 0 ? void 0 : _b.publish({
|
162
|
+
errors: stats.toJson(this.app.store.get('build.stats'))
|
163
|
+
.errors,
|
164
|
+
});
|
165
|
+
}
|
166
|
+
this.errors.push(this.app.hooks.filter('event.compiler.error', err));
|
177
167
|
this.app.store.is('features.dashboard', false) &&
|
178
168
|
this.log('error', err);
|
179
169
|
}
|
180
170
|
}
|
181
171
|
}
|
182
|
-
(0, tslib_1.__decorate)([
|
183
|
-
bud_support_1.bind
|
184
|
-
], Compiler.prototype, "register", null);
|
185
172
|
(0, tslib_1.__decorate)([
|
186
173
|
bud_support_1.bind,
|
187
174
|
bud_support_1.once
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Compiler/index.ts"],"names":[],"mappings":";;;;AAAA,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Compiler/index.ts"],"names":[],"mappings":";;;;AAAA,wDAI6B;AAC7B,oDAAqD;AACrD,qCAKgB;AAChB,MAAM,EAAC,UAAU,EAAC,GAAG,oBAAM,CAAA;AAE3B;;;;GAIG;AACH,MAAM,aAAa,GAAG;IACpB,MAAM,EAAE,EAAE;IACV,MAAM,EAAE,EAAE;IACV,QAAQ,EAAE,EAAE;CACb,CAAA;AAED;;;;GAIG;AACH,MAAa,QAAS,SAAQ,uBAAO;IAArC;;QAQE;;;;WAIG;QACI,UAAK,GAAqB,aAAa,CAAA;QAE9C;;WAEG;QACI,WAAM,GAAsB,EAAE,CAAA;QASrC;;;;WAIG;QACI,eAAU,GAAY,KAAK,CAAA;QAElC;;WAEG;QACI,WAAM,GAAQ,EAAE,CAAA;IAwLzB,CAAC;IAtLC;;;;;;;OAOG;IAGU,OAAO;;YAClB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,EAAE,CAAA;YAClC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;YAE1C,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;YACvB,OAAO,QAAQ,CAAA;QACjB,CAAC;KAAA;IAED;;;OAGG;IAEU,MAAM,CAAC,MAAW;;YAC7B,MAAM;gBACJ,MAAM,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,CAC9B,uBAAuB,EACvB,MAAM,CACP,CAAA;YAEH,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,iBAAiB,EAAE,MAAM,C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,KAAK,CAAC,EAAE,CAAC,oBAAoB,EAAE,KAAK,CAAC;gBAC5C,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;SACzB;IACH,CAAC;CACF;AA5KC;IAFC,kBAAI;IACJ,kBAAI;uCAOJ;AAOD;IADC,kBAAI;sCAqDJ;AAUD;IAFC,kBAAI;IACJ,kBAAI;sCAmDJ;AASD;IADC,kBAAI;wCAsCJ;AA5NH,4BA6NC"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { __awaiter, __decorate } from "tslib";
|
2
2
|
import { Service, } from '@roots/bud-framework';
|
3
3
|
import { bind, lodash, once } from '@roots/bud-support';
|
4
|
-
import { ProgressPlugin, webpack } from 'webpack';
|
4
|
+
import { ProgressPlugin, webpack, } from 'webpack';
|
5
5
|
const { isFunction } = lodash;
|
6
6
|
/**
|
7
7
|
* Initial state
|
@@ -27,6 +27,10 @@ export class Compiler extends Service {
|
|
27
27
|
* @public
|
28
28
|
*/
|
29
29
|
this.stats = INITIAL_STATS;
|
30
|
+
/**
|
31
|
+
* Compiler errors
|
32
|
+
*/
|
33
|
+
this.errors = [];
|
30
34
|
/**
|
31
35
|
* True if compiler is already instantiated
|
32
36
|
*
|
@@ -38,18 +42,6 @@ export class Compiler extends Service {
|
|
38
42
|
*/
|
39
43
|
this.config = [];
|
40
44
|
}
|
41
|
-
/**
|
42
|
-
* Service register event
|
43
|
-
*
|
44
|
-
* @public
|
45
|
-
* @decorator `@bind`
|
46
|
-
*/
|
47
|
-
register() {
|
48
|
-
return __awaiter(this, void 0, void 0, function* () {
|
49
|
-
this.app.hooks.filter('event.compiler.register.before', this.app);
|
50
|
-
this.app.hooks.filter('event.compiler.register.after', this.app);
|
51
|
-
});
|
52
|
-
}
|
53
45
|
/**
|
54
46
|
* Initiates compilation
|
55
47
|
*
|
@@ -72,27 +64,20 @@ export class Compiler extends Service {
|
|
72
64
|
*/
|
73
65
|
invoke(config) {
|
74
66
|
return __awaiter(this, void 0, void 0, function* () {
|
75
|
-
config =
|
67
|
+
config =
|
68
|
+
yield this.app.hooks.filterAsync('event.compiler.before', config);
|
76
69
|
config = this.app.hooks.filter('config.override', config);
|
77
70
|
this.instance = webpack(config);
|
78
71
|
this.instance.hooks.done.tap(config[0].name, (stats) => __awaiter(this, void 0, void 0, function* () {
|
79
|
-
|
72
|
+
this.app.hooks.filter('event.compiler.done', stats);
|
80
73
|
stats && Object.assign(this.stats, stats.toJson());
|
81
74
|
if (this.app.store.is('features.dashboard', false)) {
|
82
|
-
this.log('log', stats.toString(
|
83
|
-
colors: true,
|
84
|
-
modules: false,
|
85
|
-
children: false,
|
86
|
-
chunks: false,
|
87
|
-
chunkModules: false,
|
88
|
-
entrypoints: false,
|
89
|
-
performance: false,
|
90
|
-
}));
|
75
|
+
this.log('log', stats.toString(this.app.store.get('build.stats')));
|
91
76
|
}
|
92
77
|
if (this.app.isProduction) {
|
93
78
|
this.instance.close(err => {
|
94
79
|
if (err) {
|
95
|
-
err = this.app.hooks.filter('compiler.error', err);
|
80
|
+
err = this.app.hooks.filter('event.compiler.error', err);
|
96
81
|
this.stats.errors.push(err);
|
97
82
|
this.log('error', err);
|
98
83
|
}
|
@@ -103,7 +88,7 @@ export class Compiler extends Service {
|
|
103
88
|
new ProgressPlugin((...args) => {
|
104
89
|
this.progress = args;
|
105
90
|
}).apply(this.instance);
|
106
|
-
this.app.hooks.filter('event.compiler.after');
|
91
|
+
this.app.hooks.filter('event.compiler.after', this.app);
|
107
92
|
return this.instance;
|
108
93
|
});
|
109
94
|
}
|
@@ -155,7 +140,7 @@ export class Compiler extends Service {
|
|
155
140
|
* @decorator `@bind`
|
156
141
|
*/
|
157
142
|
callback(...args) {
|
158
|
-
var _a;
|
143
|
+
var _a, _b;
|
159
144
|
/**
|
160
145
|
* production mode callback takes two parameters (webpack err and stats)
|
161
146
|
* however, the done hook used in development just takes one (stats)
|
@@ -165,20 +150,22 @@ export class Compiler extends Service {
|
|
165
150
|
*/
|
166
151
|
let [err, stats] = args.length > 1 ? args : [null, args.pop()];
|
167
152
|
if ((stats === null || stats === void 0 ? void 0 : stats.toJson) && isFunction(stats.toJson)) {
|
168
|
-
this.stats = stats.toJson(
|
169
|
-
this.stats = this.app.hooks.filter('compiler.stats', this.stats);
|
153
|
+
this.stats = stats.toJson(this.app.store.get('build.stats'));
|
154
|
+
this.stats = this.app.hooks.filter('event.compiler.stats', this.stats);
|
170
155
|
}
|
171
156
|
if (err) {
|
172
|
-
|
173
|
-
|
157
|
+
if (this.app.isDevelopment) {
|
158
|
+
(_b = (_a = this.app.server.middleware) === null || _a === void 0 ? void 0 : _a.hot) === null || _b === void 0 ? void 0 : _b.publish({
|
159
|
+
errors: stats.toJson(this.app.store.get('build.stats'))
|
160
|
+
.errors,
|
161
|
+
});
|
162
|
+
}
|
163
|
+
this.errors.push(this.app.hooks.filter('event.compiler.error', err));
|
174
164
|
this.app.store.is('features.dashboard', false) &&
|
175
165
|
this.log('error', err);
|
176
166
|
}
|
177
167
|
}
|
178
168
|
}
|
179
|
-
__decorate([
|
180
|
-
bind
|
181
|
-
], Compiler.prototype, "register", null);
|
182
169
|
__decorate([
|
183
170
|
bind,
|
184
171
|
once
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Compiler/index.ts"],"names":[],"mappings":";AAAA,OAAO,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Compiler/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAGL,OAAO,GACR,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAC,MAAM,oBAAoB,CAAA;AACrD,OAAO,EACL,cAAc,EAGd,OAAO,GACR,MAAM,SAAS,CAAA;AAChB,MAAM,EAAC,UAAU,EAAC,GAAG,MAAM,CAAA;AAE3B;;;;GAIG;AACH,MAAM,aAAa,GAAG;IACpB,MAAM,EAAE,EAAE;IACV,MAAM,EAAE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