@roots/bud-compiler 5.0.0-next.6 → 5.0.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/README.md CHANGED
@@ -1,41 +1,25 @@
1
1
  <p align="center">
2
- <img alt="Bud" src="https://cdn.roots.io/app/uploads/logo-bud.svg" height="100" />
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 href="https://app.fossa.com/projects/git%2Bgithub.com%2Froots%2Fbud?ref=badge_small" alt="FOSSA Status">
11
- <img src="https://app.fossa.com/api/projects/git%2Bgithub.com%2Froots%2Fbud.svg?type=small"/>
12
- </a>
13
- <a href="https://www.npmjs.com/package/@roots/bud">
14
- <img src="https://img.shields.io/npm/v/@roots/bud.svg?color=%23525ddc&style=flat-square" />
15
- </a>
16
- <a href="https://codecov.io/gh/roots/bud">
17
- <img src="https://codecov.io/gh/roots/bud/branch/next/graph/badge.svg?token=DRJ28OD8XD"/>
18
- </a>
19
- <a href="https://twitter.com/rootswp">
20
- <img
21
- alt="Follow Roots"
22
- src="https://img.shields.io/twitter/follow/rootswp.svg?color=%23525ddc&style=flat-square"
23
- />
24
- </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" />
25
7
  </p>
26
8
 
27
-
28
9
  <h1 align="center">
29
10
  <strong>@roots/bud-compiler</strong>
30
11
  </h1>
31
12
 
32
- > Compilation handler
13
+ <p align="center">
14
+ Compilation handler
15
+ </p>
16
+
33
17
  ## Installation
34
18
 
35
19
  Install **@roots/bud-compiler** to your project.
36
20
 
37
21
  ```shell
38
- yarn add @roots/bud-compiler
22
+ yarn add @roots/bud-compiler --dev
39
23
  ```
40
24
 
41
25
  ## Documentation
@@ -67,8 +51,4 @@ Help support our open-source development efforts by [becoming a patron](https://
67
51
  <a href="https://carrot.com/"><img src="https://cdn.roots.io/app/uploads/carrot.svg" alt="Carrot" width="200" height="150"/></a>
68
52
  <a href="https://www.c21redwood.com/"><img src="https://cdn.roots.io/app/uploads/c21redwood.svg" alt="C21 Redwood Realty" width="200" height="150"/></a>
69
53
  <a href="https://wordpress.com/"><img src="https://cdn.roots.io/app/uploads/wordpress.svg" alt="WordPress.com" width="200" height="150"/></a>
70
- <a href="https://icons8.com/"><img src="https://cdn.roots.io/app/uploads/icons8.svg" alt="Icons8" width="200" height="150"/></a>
71
- <a href="https://www.harnessup.com/"><img src="https://cdn.roots.io/app/uploads/harness-software.svg" alt="Harness Software" width="200" height="150"/></a>
72
- <a href="https://www.codersclan.com/"><img src="https://cdn.roots.io/app/uploads/coders-clan.svg" alt="Coders Clan" width="200" height="150"/></a>
73
- <a href="https://generodigital.com/"><img src="https://cdn.roots.io/app/uploads/genero.svg" alt="Genero" width="200" height="150"/></a>
74
- <a href="https://motto.ca/roots"><img src="https://cdn.roots.io/app/uploads/motto.svg" alt="Motto" width="200" height="150"/></a>
54
+ <a href="https://pantheon.io/"><img src="https://cdn.roots.io/app/uploads/pantheon.svg" alt="Pantheon" width="200" height="150"/></a>
@@ -30,22 +30,20 @@ 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
  *
36
40
  * @public
37
41
  */
38
42
  this.isCompiled = false;
39
- }
40
- /**
41
- * {@inheritDoc @roots/bud-framework#Service.register}
42
- *
43
- * @public
44
- * @decorator `@bind`
45
- */
46
- register() {
47
- this.app.hooks.on('before', () => []);
48
- this.app.hooks.on('after', () => []);
43
+ /**
44
+ * @public
45
+ */
46
+ this.config = [];
49
47
  }
50
48
  /**
51
49
  * Initiates compilation
@@ -56,34 +54,46 @@ class Compiler extends bud_framework_1.Service {
56
54
  * @decorator `@bind`
57
55
  */
58
56
  compile() {
59
- let instance;
60
- if (this.isCompiled)
61
- this.instance.close(() => {
62
- instance = this.invokeCompiler(this.before());
63
- });
64
- else
65
- instance = this.invokeCompiler(this.before());
66
- return instance;
57
+ return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
58
+ const config = yield this.before();
59
+ const compiler = yield this.invoke(config);
60
+ this.app.timeEnd('bud');
61
+ return compiler;
62
+ });
67
63
  }
68
64
  /**
69
65
  * @public
70
66
  * @decorator `@bind`
71
67
  */
72
- invokeCompiler(config) {
73
- this.instance = this.app.isDevelopment
74
- ? (0, webpack_1.webpack)(config)
75
- : (0, webpack_1.webpack)(config, this.callback);
76
- this.instance.hooks.done.tap(this.app.name, stats => {
77
- stats && Object.assign(this.stats, stats.toJson());
78
- this.app.isProduction &&
79
- this.instance.close(err => {
80
- err && this.stats.errors.push(err);
81
- });
68
+ invoke(config) {
69
+ return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
70
+ config =
71
+ yield this.app.hooks.filterAsync('event.compiler.before', config);
72
+ config = this.app.hooks.filter('config.override', config);
73
+ this.instance = (0, webpack_1.webpack)(config);
74
+ this.instance.hooks.done.tap(config[0].name, (stats) => (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
75
+ this.app.hooks.filter('event.compiler.done', stats);
76
+ stats && Object.assign(this.stats, stats.toJson());
77
+ if (this.app.store.is('features.dashboard', false)) {
78
+ this.log('log', stats.toString(this.app.store.get('build.stats')));
79
+ }
80
+ if (this.app.isProduction) {
81
+ this.instance.close(err => {
82
+ if (err) {
83
+ err = this.app.hooks.filter('event.compiler.error', err);
84
+ this.stats.errors.push(err);
85
+ this.log('error', err);
86
+ }
87
+ !this.app.dashboard.instance && this.app.close();
88
+ });
89
+ }
90
+ }));
91
+ new webpack_1.ProgressPlugin((...args) => {
92
+ this.progress = args;
93
+ }).apply(this.instance);
94
+ this.app.hooks.filter('event.compiler.after', this.app);
95
+ return this.instance;
82
96
  });
83
- new webpack_1.ProgressPlugin((...args) => {
84
- this.progress = args;
85
- }).apply(this.instance);
86
- return this.instance;
87
97
  }
88
98
  /**
89
99
  * Returns final webpack configuration
@@ -92,37 +102,39 @@ class Compiler extends bud_framework_1.Service {
92
102
  * @decorator `@bind`
93
103
  */
94
104
  before() {
95
- const config = [];
96
- this.stats = INITIAL_STATS;
97
- this.isCompiled = true;
98
- this.app.hooks.filter('before').map(cb => cb(this.app));
99
- !this.app.parent &&
100
- this.app.error(`Trying to compile a child directly.`);
101
- const instanceConfig = this.app.build.make();
102
- /**
103
- * Attempt to use the parent instance in the compilation if there are entries
104
- * registered to it or if it has no child instances registered.
105
- */
106
- if ((this.app.hasChildren && instanceConfig.entry) ||
107
- !this.app.hasChildren) {
108
- this.app.info('using parent compiler');
109
- config.push(instanceConfig);
110
- }
111
- /**
112
- * If there are {@link Framework.children} instances, iterate through
113
- * them and add to `config`
114
- */
115
- this.app.hasChildren &&
116
- this.app.children.getValues().map(({ build, name }) => {
117
- name &&
118
- (() => {
119
- this.app.info(`using ${name} compiler`);
120
- const childConfig = build.make();
121
- config.push(childConfig);
122
- })();
123
- });
124
- this.app.log('final config', config);
125
- return config;
105
+ var _a;
106
+ return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
107
+ const config = [];
108
+ this.stats = INITIAL_STATS;
109
+ this.isCompiled = true;
110
+ !this.app.isRoot &&
111
+ this.log('error', `Attempting to compile a child directly. Only the parent instance should be compiled.`);
112
+ yield this.app.build.make();
113
+ /**
114
+ * Attempt to use the parent instance in the compilation if there are entries
115
+ * registered to it or if it has no child instances registered.
116
+ */
117
+ if (!this.app.hasChildren) {
118
+ this.app.info(`using config from parent compiler`);
119
+ config.push(this.app.build.config);
120
+ return config;
121
+ }
122
+ else {
123
+ this.app.warn(`root compiler will not be tapped (child compilers in use)`);
124
+ }
125
+ /**
126
+ * If there are {@link Framework.children} instances, iterate through
127
+ * them and add to `config`
128
+ */
129
+ yield Promise.all((_a = this.app.children) === null || _a === void 0 ? void 0 : _a.getValues().map((instance) => (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
130
+ if (!instance.name)
131
+ return;
132
+ this.log('success', `\`${instance.name}\` compiler will be tapped`);
133
+ yield instance.build.make();
134
+ config.push(instance.build.config);
135
+ })));
136
+ return config;
137
+ });
126
138
  }
127
139
  /**
128
140
  * Compilation callback
@@ -131,6 +143,7 @@ class Compiler extends bud_framework_1.Service {
131
143
  * @decorator `@bind`
132
144
  */
133
145
  callback(...args) {
146
+ var _a, _b;
134
147
  /**
135
148
  * production mode callback takes two parameters (webpack err and stats)
136
149
  * however, the done hook used in development just takes one (stats)
@@ -138,33 +151,34 @@ class Compiler extends bud_framework_1.Service {
138
151
  * here we parse the callback args so that we dont have to
139
152
  * duplicate the callback.
140
153
  */
141
- const [err, stats] = args.length > 1 ? args : [null, args.pop()];
154
+ let [err, stats] = args.length > 1 ? args : [null, args.pop()];
142
155
  if ((stats === null || stats === void 0 ? void 0 : stats.toJson) && isFunction(stats.toJson)) {
143
- this.stats = stats.toJson(this.app.build.config.stats);
144
- this.app.store.is('ci', true) &&
145
- // eslint-disable-next-line no-console
146
- console.log(stats.toString());
156
+ this.stats = stats.toJson(this.app.store.get('build.stats'));
157
+ this.stats = this.app.hooks.filter('event.compiler.stats', this.stats);
147
158
  }
148
159
  if (err) {
149
- this.stats.errors.push(err);
150
- // eslint-disable-next-line no-console
151
- this.app.store.is('ci', true) && console.error(err);
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));
167
+ this.app.store.is('features.dashboard', false) &&
168
+ this.log('error', err);
152
169
  }
153
- const doneCallbacks = this.app.hooks.filter('done');
154
- doneCallbacks === null || doneCallbacks === void 0 ? void 0 : doneCallbacks.map((cb) => cb(this.app));
155
170
  }
156
171
  }
157
172
  (0, tslib_1.__decorate)([
158
- bud_support_1.bind
159
- ], Compiler.prototype, "register", null);
160
- (0, tslib_1.__decorate)([
161
- bud_support_1.bind
173
+ bud_support_1.bind,
174
+ bud_support_1.once
162
175
  ], Compiler.prototype, "compile", null);
163
176
  (0, tslib_1.__decorate)([
164
177
  bud_support_1.bind
165
- ], Compiler.prototype, "invokeCompiler", null);
178
+ ], Compiler.prototype, "invoke", null);
166
179
  (0, tslib_1.__decorate)([
167
- bud_support_1.bind
180
+ bud_support_1.bind,
181
+ bud_support_1.once
168
182
  ], Compiler.prototype, "before", null);
169
183
  (0, tslib_1.__decorate)([
170
184
  bud_support_1.bind
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Compiler/index.ts"],"names":[],"mappings":";;;;AAAA,wDAI6B;AAC7B,oDAA+C;AAC/C,qCAAiE;AAEjE,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;QAS9C;;;;WAIG;QACI,eAAU,GAAY,KAAK,CAAA;IAsJpC,CAAC;IApJC;;;;;OAKG;IAEI,QAAQ;QACb,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CAAA;QACrC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,C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I,CAAC,GAAG,CAAC,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"}
package/lib/cjs/index.js CHANGED
@@ -10,7 +10,7 @@ exports.Compiler = void 0;
10
10
  * @see https://roots.io/bud
11
11
  * @see https://github.com/roots/bud
12
12
  *
13
- * @core @packageDocumentation @betaDocumentation
13
+ * @packageDocumentation
14
14
  */
15
15
  var Compiler_1 = require("./Compiler");
16
16
  Object.defineProperty(exports, "Compiler", { enumerable: true, get: function () { return Compiler_1.Compiler; } });
@@ -1,7 +1,7 @@
1
- import { __decorate } from "tslib";
1
+ import { __awaiter, __decorate } from "tslib";
2
2
  import { Service, } from '@roots/bud-framework';
3
- import { bind, lodash } from '@roots/bud-support';
4
- import { ProgressPlugin, webpack } from 'webpack';
3
+ import { bind, lodash, once } from '@roots/bud-support';
4
+ import { ProgressPlugin, webpack, } from 'webpack';
5
5
  const { isFunction } = lodash;
6
6
  /**
7
7
  * Initial state
@@ -27,22 +27,20 @@ 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
  *
33
37
  * @public
34
38
  */
35
39
  this.isCompiled = false;
36
- }
37
- /**
38
- * {@inheritDoc @roots/bud-framework#Service.register}
39
- *
40
- * @public
41
- * @decorator `@bind`
42
- */
43
- register() {
44
- this.app.hooks.on('before', () => []);
45
- this.app.hooks.on('after', () => []);
40
+ /**
41
+ * @public
42
+ */
43
+ this.config = [];
46
44
  }
47
45
  /**
48
46
  * Initiates compilation
@@ -53,34 +51,46 @@ export class Compiler extends Service {
53
51
  * @decorator `@bind`
54
52
  */
55
53
  compile() {
56
- let instance;
57
- if (this.isCompiled)
58
- this.instance.close(() => {
59
- instance = this.invokeCompiler(this.before());
60
- });
61
- else
62
- instance = this.invokeCompiler(this.before());
63
- return instance;
54
+ return __awaiter(this, void 0, void 0, function* () {
55
+ const config = yield this.before();
56
+ const compiler = yield this.invoke(config);
57
+ this.app.timeEnd('bud');
58
+ return compiler;
59
+ });
64
60
  }
65
61
  /**
66
62
  * @public
67
63
  * @decorator `@bind`
68
64
  */
69
- invokeCompiler(config) {
70
- this.instance = this.app.isDevelopment
71
- ? webpack(config)
72
- : webpack(config, this.callback);
73
- this.instance.hooks.done.tap(this.app.name, stats => {
74
- stats && Object.assign(this.stats, stats.toJson());
75
- this.app.isProduction &&
76
- this.instance.close(err => {
77
- err && this.stats.errors.push(err);
78
- });
65
+ invoke(config) {
66
+ return __awaiter(this, void 0, void 0, function* () {
67
+ config =
68
+ yield this.app.hooks.filterAsync('event.compiler.before', config);
69
+ config = this.app.hooks.filter('config.override', config);
70
+ this.instance = webpack(config);
71
+ this.instance.hooks.done.tap(config[0].name, (stats) => __awaiter(this, void 0, void 0, function* () {
72
+ this.app.hooks.filter('event.compiler.done', stats);
73
+ stats && Object.assign(this.stats, stats.toJson());
74
+ if (this.app.store.is('features.dashboard', false)) {
75
+ this.log('log', stats.toString(this.app.store.get('build.stats')));
76
+ }
77
+ if (this.app.isProduction) {
78
+ this.instance.close(err => {
79
+ if (err) {
80
+ err = this.app.hooks.filter('event.compiler.error', err);
81
+ this.stats.errors.push(err);
82
+ this.log('error', err);
83
+ }
84
+ !this.app.dashboard.instance && this.app.close();
85
+ });
86
+ }
87
+ }));
88
+ new ProgressPlugin((...args) => {
89
+ this.progress = args;
90
+ }).apply(this.instance);
91
+ this.app.hooks.filter('event.compiler.after', this.app);
92
+ return this.instance;
79
93
  });
80
- new ProgressPlugin((...args) => {
81
- this.progress = args;
82
- }).apply(this.instance);
83
- return this.instance;
84
94
  }
85
95
  /**
86
96
  * Returns final webpack configuration
@@ -89,37 +99,39 @@ export class Compiler extends Service {
89
99
  * @decorator `@bind`
90
100
  */
91
101
  before() {
92
- const config = [];
93
- this.stats = INITIAL_STATS;
94
- this.isCompiled = true;
95
- this.app.hooks.filter('before').map(cb => cb(this.app));
96
- !this.app.parent &&
97
- this.app.error(`Trying to compile a child directly.`);
98
- const instanceConfig = this.app.build.make();
99
- /**
100
- * Attempt to use the parent instance in the compilation if there are entries
101
- * registered to it or if it has no child instances registered.
102
- */
103
- if ((this.app.hasChildren && instanceConfig.entry) ||
104
- !this.app.hasChildren) {
105
- this.app.info('using parent compiler');
106
- config.push(instanceConfig);
107
- }
108
- /**
109
- * If there are {@link Framework.children} instances, iterate through
110
- * them and add to `config`
111
- */
112
- this.app.hasChildren &&
113
- this.app.children.getValues().map(({ build, name }) => {
114
- name &&
115
- (() => {
116
- this.app.info(`using ${name} compiler`);
117
- const childConfig = build.make();
118
- config.push(childConfig);
119
- })();
120
- });
121
- this.app.log('final config', config);
122
- return config;
102
+ var _a;
103
+ return __awaiter(this, void 0, void 0, function* () {
104
+ const config = [];
105
+ this.stats = INITIAL_STATS;
106
+ this.isCompiled = true;
107
+ !this.app.isRoot &&
108
+ this.log('error', `Attempting to compile a child directly. Only the parent instance should be compiled.`);
109
+ yield this.app.build.make();
110
+ /**
111
+ * Attempt to use the parent instance in the compilation if there are entries
112
+ * registered to it or if it has no child instances registered.
113
+ */
114
+ if (!this.app.hasChildren) {
115
+ this.app.info(`using config from parent compiler`);
116
+ config.push(this.app.build.config);
117
+ return config;
118
+ }
119
+ else {
120
+ this.app.warn(`root compiler will not be tapped (child compilers in use)`);
121
+ }
122
+ /**
123
+ * If there are {@link Framework.children} instances, iterate through
124
+ * them and add to `config`
125
+ */
126
+ yield Promise.all((_a = this.app.children) === null || _a === void 0 ? void 0 : _a.getValues().map((instance) => __awaiter(this, void 0, void 0, function* () {
127
+ if (!instance.name)
128
+ return;
129
+ this.log('success', `\`${instance.name}\` compiler will be tapped`);
130
+ yield instance.build.make();
131
+ config.push(instance.build.config);
132
+ })));
133
+ return config;
134
+ });
123
135
  }
124
136
  /**
125
137
  * Compilation callback
@@ -128,6 +140,7 @@ export class Compiler extends Service {
128
140
  * @decorator `@bind`
129
141
  */
130
142
  callback(...args) {
143
+ var _a, _b;
131
144
  /**
132
145
  * production mode callback takes two parameters (webpack err and stats)
133
146
  * however, the done hook used in development just takes one (stats)
@@ -135,33 +148,34 @@ export class Compiler extends Service {
135
148
  * here we parse the callback args so that we dont have to
136
149
  * duplicate the callback.
137
150
  */
138
- const [err, stats] = args.length > 1 ? args : [null, args.pop()];
151
+ let [err, stats] = args.length > 1 ? args : [null, args.pop()];
139
152
  if ((stats === null || stats === void 0 ? void 0 : stats.toJson) && isFunction(stats.toJson)) {
140
- this.stats = stats.toJson(this.app.build.config.stats);
141
- this.app.store.is('ci', true) &&
142
- // eslint-disable-next-line no-console
143
- console.log(stats.toString());
153
+ this.stats = stats.toJson(this.app.store.get('build.stats'));
154
+ this.stats = this.app.hooks.filter('event.compiler.stats', this.stats);
144
155
  }
145
156
  if (err) {
146
- this.stats.errors.push(err);
147
- // eslint-disable-next-line no-console
148
- this.app.store.is('ci', true) && console.error(err);
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));
164
+ this.app.store.is('features.dashboard', false) &&
165
+ this.log('error', err);
149
166
  }
150
- const doneCallbacks = this.app.hooks.filter('done');
151
- doneCallbacks === null || doneCallbacks === void 0 ? void 0 : doneCallbacks.map((cb) => cb(this.app));
152
167
  }
153
168
  }
154
169
  __decorate([
155
- bind
156
- ], Compiler.prototype, "register", null);
157
- __decorate([
158
- bind
170
+ bind,
171
+ once
159
172
  ], Compiler.prototype, "compile", null);
160
173
  __decorate([
161
174
  bind
162
- ], Compiler.prototype, "invokeCompiler", null);
175
+ ], Compiler.prototype, "invoke", null);
163
176
  __decorate([
164
- bind
177
+ bind,
178
+ once
165
179
  ], Compiler.prototype, "before", null);
166
180
  __decorate([
167
181
  bind
@@ -1 +1 @@
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,EAAC,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAC,cAAc,EAAoB,OAAO,EAAC,MAAM,SAAS,CAAA;AAEjE,MAAM,EAAC,UAAU,EAAC,GAAG,MAAM,CAAA;AAE3B;;;;GAIG;AACH,MAAM,aAAa,GAAG;IACpB,MAAM,EAAE,EAAE;IACV,MAAM,EAAE,EAAE;IACV,QAAQ,EAAE,EAAE;CACb,CAAA;AAED;;;;GAIG;AACH,MAAM,OAAO,QAAS,SAAQ,OAAO;IAArC;;QAQE;;;;WAIG;QACI,UAAK,GAAqB,aAAa,CAAA;QAS9C;;;;WAIG;QACI,eAAU,GAAY,KAAK,CAAA;IAsJpC,CAAC;IApJC;;;;;OAKG;IAEI,QAAQ;QACb,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CAAA;QACrC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CAAA;IACtC,CAAC;IAED;;;;;;;OAOG;IAEI,OAAO;QACZ,IAAI,QAAQ,CAAA;QAEZ,IAAI,IAAI,CAAC,UAAU;YACjB,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,EAAE;gBACvB,QAAQ,GAAG,IA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B;IACH,CAAC;CACF;AA5KC;IAFC,IAAI;IACJ,IAAI;uCAOJ;AAOD;IADC,IAAI;sCAqDJ;AAUD;IAFC,IAAI;IACJ,IAAI;sCAmDJ;AASD;IADC,IAAI;wCAsCJ"}
package/lib/esm/index.js CHANGED
@@ -7,7 +7,7 @@
7
7
  * @see https://roots.io/bud
8
8
  * @see https://github.com/roots/bud
9
9
  *
10
- * @core @packageDocumentation @betaDocumentation
10
+ * @packageDocumentation
11
11
  */
12
12
  export { Compiler } from './Compiler';
13
13
  //# sourceMappingURL=index.js.map