@polylith/builder 0.2.23 → 0.2.25

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.
Files changed (3) hide show
  1. package/App.js +12 -12
  2. package/ConfigApp.js +14 -5
  3. package/package.json +6 -5
package/App.js CHANGED
@@ -564,7 +564,7 @@ export default class App {
564
564
  */
565
565
  async findLoadableCss(loadable) {
566
566
  if (loadable.css) {
567
- var files = new Files(this.sourcePath, this.destPath)
567
+ var files = new Files(this.sourcePath, this.destPath, this.testPath)
568
568
  loadable.css.forEach(function(spec) {
569
569
  files.addResourceSpec(loadable.root, spec);
570
570
  }, this)
@@ -814,11 +814,11 @@ export default class App {
814
814
  }
815
815
 
816
816
  await this.testFeatures();
817
- this.config = await this.generateTestConfiguration();
817
+ this.spec = await this.generateTestConfiguration();
818
818
 
819
- const bundle = await rollup.rollup(this.config.input);
820
- await bundle.generate(this.config.output);
821
- await bundle.write(this.config.output);
819
+ const bundle = await rollup.rollup(this.spec.input);
820
+ await bundle.generate(this.spec.output);
821
+ await bundle.write(this.spec.output);
822
822
  await bundle.close();
823
823
 
824
824
  return true;
@@ -832,11 +832,11 @@ export default class App {
832
832
  async build() {
833
833
  this.testing = false;
834
834
  await this.buildFeatures();
835
- this.config = await this.generateBuildConfiguration();
835
+ this.spec = await this.generateBuildConfiguration();
836
836
 
837
- const bundle = await rollup.rollup(this.config.input);
838
- await bundle.generate(this.config.output);
839
- await bundle.write(this.config.output);
837
+ const bundle = await rollup.rollup(this.spec.input);
838
+ await bundle.generate(this.spec.output);
839
+ await bundle.write(this.spec.output);
840
840
  await bundle.close();
841
841
 
842
842
  return true;
@@ -848,9 +848,9 @@ export default class App {
848
848
  */
849
849
  watch() {
850
850
  var watchConfig = {
851
- ...this.config.input,
852
- output: [this.config.output.output],
853
- ...this.config.watch,
851
+ ...this.spec.input,
852
+ output: [this.spec.output.output],
853
+ ...this.spec.watch,
854
854
  }
855
855
 
856
856
  const watcher = rollup.watch(watchConfig);
package/ConfigApp.js CHANGED
@@ -6,7 +6,13 @@ import {forceToPosix} from './utils.js'
6
6
  * This class is used to build an application from a configuration file.
7
7
  */
8
8
  export default class ConfigApp extends App {
9
- constructor (config, root) {
9
+ /**
10
+ *
11
+ * @param {*} config
12
+ * @param {*} options
13
+ * @param {*} root
14
+ */
15
+ constructor (options, config, root) {
10
16
  root = forceToPosix(root);
11
17
  var name = config.name || 'unnamed';
12
18
  var index = config.index || 'src/index.js';
@@ -14,8 +20,7 @@ export default class ConfigApp extends App {
14
20
  var spec = config.spec;
15
21
  var testDest = config.testDest;
16
22
 
17
- super(name, {root, index, dest, spec, testDest});
18
- this.config = config;
23
+ super(name, options, {root, index, dest, spec, testDest});
19
24
 
20
25
  if (!config.template || !config.template.source) throw new Error('html source not defined in config file');
21
26
  var source = config.template.source;
@@ -29,8 +34,8 @@ export default class ConfigApp extends App {
29
34
  }, this)
30
35
  }
31
36
 
32
- if (this.config.features) {
33
- this.config.features.forEach(function(feature) {
37
+ if (config.features) {
38
+ config.features.forEach(function(feature) {
34
39
  this.addFeature(feature);
35
40
  }.bind(this))
36
41
  }
@@ -53,5 +58,9 @@ export default class ConfigApp extends App {
53
58
  if (config.router) {
54
59
  this.setRouterModule(config.router);
55
60
  }
61
+
62
+ if (config.liveReload) {
63
+ this.setLiveReloadOptions(config.liveReload);
64
+ }
56
65
  }
57
66
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polylith/builder",
3
- "version": "0.2.23",
3
+ "version": "0.2.25",
4
4
  "description": "The polylith builder",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -17,19 +17,20 @@
17
17
  "license": "MIT",
18
18
  "dependencies": {
19
19
  "@babel/preset-env": "^7.16.11",
20
- "@babel/preset-react": "^7.16.7",
20
+ "@babel/preset-react": "^7.22.5",
21
21
  "@ondohers/console-colors": "^0.1.1",
22
22
  "@polylith/config-store": "0.1.2",
23
- "@polylith/core": "^0.1.9",
23
+ "@polylith/core": "0.1.10",
24
24
  "@rollup/plugin-babel": "^5.3.0",
25
25
  "@rollup/plugin-commonjs": "^24.0.0",
26
26
  "@rollup/plugin-json": "^5.0.2",
27
- "@rollup/plugin-node-resolve": "^13.0.5",
27
+ "@rollup/plugin-node-resolve": "^13.3.0",
28
28
  "@svgr/rollup": "^6.5.1",
29
29
  "babel": "^6.23.0",
30
30
  "escape-string-regexp": "^5.0.0",
31
+ "express": "^4.18.2",
31
32
  "fast-glob": "^3.2.12",
32
- "fs-extra": "^10.0.0",
33
+ "fs-extra": "^10.1.0",
33
34
  "less": "^4.1.2",
34
35
  "node-console-colors": "^1.1.5",
35
36
  "rollup": "^2.58.0",