@polylith/builder 0.2.4 → 0.2.6
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/App.js +7 -6
- package/package.json +4 -2
- package/plugin-watch.js +3 -1
package/App.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import {readFile, writeFile, stat} from 'node:fs/promises';
|
|
3
|
+
import cc from "@ondohers/console-colors";
|
|
3
4
|
import express from 'express';
|
|
4
5
|
import * as rollup from 'rollup';
|
|
5
6
|
import { babel } from '@rollup/plugin-babel';
|
|
@@ -125,13 +126,13 @@ export default class App {
|
|
|
125
126
|
await router(appRouter, this);
|
|
126
127
|
return true;
|
|
127
128
|
} catch(e) {
|
|
128
|
-
console.error('error while building router', this.modulePath);
|
|
129
|
+
console.error(cc.set('fg_red;, error while building router'), this.modulePath);
|
|
129
130
|
console.log(e);
|
|
130
131
|
}
|
|
131
132
|
}
|
|
132
133
|
|
|
133
134
|
async sendIndex(res) {
|
|
134
|
-
var indexPath = path.join(this.root, this.htmlTemplate.source);
|
|
135
|
+
var indexPath = path.posix.join(this.root, this.htmlTemplate.source);
|
|
135
136
|
res.sendFile(indexPath)
|
|
136
137
|
}
|
|
137
138
|
|
|
@@ -465,7 +466,7 @@ export default class App {
|
|
|
465
466
|
let feature = module.default;
|
|
466
467
|
await feature.build(this);
|
|
467
468
|
} catch(e) {
|
|
468
|
-
console.error('error while building feature', root);
|
|
469
|
+
console.error(cc.set('fg_red', 'error while building feature'), root);
|
|
469
470
|
console.log(e);
|
|
470
471
|
}
|
|
471
472
|
|
|
@@ -815,15 +816,15 @@ export default class App {
|
|
|
815
816
|
}
|
|
816
817
|
|
|
817
818
|
if (event.code === 'ERROR') {
|
|
818
|
-
console.error(event.error)
|
|
819
|
+
console.error(cc.set('fg_red', event.error))
|
|
819
820
|
}
|
|
820
821
|
|
|
821
822
|
if (event.code === 'BUNDLE_START') {
|
|
822
|
-
console.log('building...')
|
|
823
|
+
console.log(cc.set('fg_blue', 'building...'));
|
|
823
824
|
}
|
|
824
825
|
|
|
825
826
|
if (event.code === 'BUNDLE_END') {
|
|
826
|
-
console.log('build complete')
|
|
827
|
+
console.log(cc.set('fg_blue', 'build complete'))
|
|
827
828
|
}
|
|
828
829
|
}.bind(this));
|
|
829
830
|
return true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@polylith/builder",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"description": "The polylith builder",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@babel/preset-env": "^7.16.11",
|
|
20
20
|
"@babel/preset-react": "^7.16.7",
|
|
21
|
+
"@ondohers/console-colors": "^0.1.0",
|
|
21
22
|
"@rollup/plugin-babel": "^5.3.0",
|
|
22
23
|
"@rollup/plugin-commonjs": "^24.0.0",
|
|
23
24
|
"@rollup/plugin-json": "^5.0.2",
|
|
@@ -28,6 +29,7 @@
|
|
|
28
29
|
"fast-glob": "^3.2.12",
|
|
29
30
|
"fs-extra": "^10.0.0",
|
|
30
31
|
"less": "^4.1.2",
|
|
32
|
+
"node-console-colors": "^1.1.5",
|
|
31
33
|
"rollup": "^2.58.0",
|
|
32
34
|
"rollup-plugin-html": "^0.2.1",
|
|
33
35
|
"rollup-plugin-jsx": "^1.0.3",
|
|
@@ -36,4 +38,4 @@
|
|
|
36
38
|
"rollup-plugin-styles": "^4.0.0",
|
|
37
39
|
"sass": "^1.43.4"
|
|
38
40
|
}
|
|
39
|
-
}
|
|
41
|
+
}
|
package/plugin-watch.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import cc from "@ondohers/console-colors";
|
|
2
|
+
|
|
1
3
|
export default function watch() {
|
|
2
4
|
return {
|
|
3
5
|
name: 'watch-log',
|
|
4
6
|
|
|
5
7
|
watchChange(id, type) {
|
|
6
|
-
console.log(`${type} of file ${id}`)
|
|
8
|
+
console.log(`${cc.set('fg_green', type.event)} of file ${id}`)
|
|
7
9
|
return null;
|
|
8
10
|
}
|
|
9
11
|
};
|