@polylith/builder 0.2.4 → 0.2.5

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 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 "node-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.4",
3
+ "version": "0.2.5",
4
4
  "description": "The polylith builder",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -28,6 +28,7 @@
28
28
  "fast-glob": "^3.2.12",
29
29
  "fs-extra": "^10.0.0",
30
30
  "less": "^4.1.2",
31
+ "node-console-colors": "^1.1.5",
31
32
  "rollup": "^2.58.0",
32
33
  "rollup-plugin-html": "^0.2.1",
33
34
  "rollup-plugin-jsx": "^1.0.3",
@@ -36,4 +37,4 @@
36
37
  "rollup-plugin-styles": "^4.0.0",
37
38
  "sass": "^1.43.4"
38
39
  }
39
- }
40
+ }
package/plugin-watch.js CHANGED
@@ -1,9 +1,11 @@
1
+ import cc from "node-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}${cc.set('reset')} of file ${id}`)
7
9
  return null;
8
10
  }
9
11
  };