@polylith/builder 0.1.11 → 0.1.12

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
@@ -218,12 +218,20 @@ export default class App {
218
218
 
219
219
  /**
220
220
  * Call this method to add specifications for application css files These
221
- * css files will be included in the html template
221
+ * css files will be included in the html template. They will also be copied
222
+ * to the destination folder
222
223
  *
224
+ * @param {String} root the relative path from the source root to the path
225
+ * to the origin of the caller. This will either be a feature root, or
226
+ * empty for the main application the source pathPaths specified in the
227
+ * resource spec are assumed to be relative to this.
223
228
  * @param {ResourceSpecList} specs the specification for the css files. These
224
229
  * will also be added as resources to be copied.
225
230
  */
226
- addMainCss(specs) {
231
+ addMainCss(root, specs) {
232
+ specs = specs.map(function(spec) {
233
+ return {root, spec}
234
+ }, this)
227
235
  this.cssSpecs = [...this.cssSpecs, ...specs];
228
236
  }
229
237
 
@@ -233,9 +241,10 @@ export default class App {
233
241
  async findMainCss() {
234
242
  var files = new Files(this.sourcePath, this.destPath)
235
243
 
236
- // Find all the files frem the added css speces
244
+ // Find all the files from the added css specs. Also add them to be copied
237
245
  this.cssSpecs.forEach(function(spec) {
238
- files.addResourceSpec('', spec);
246
+ files.addResourceSpec(spec.root, spec.spec);
247
+ this.files.addResourceSpec(spec.root, spec.spec);
239
248
  }, this)
240
249
 
241
250
  var expanded = await files.findAllFiles();
@@ -245,8 +254,10 @@ export default class App {
245
254
  this.cssFiles.push(file.uri)
246
255
  }, this);
247
256
 
248
- // now add them to be copied
249
- this.addResources('', this.cssSpecs);
257
+ this.cssSpecs.map(function(spec) {
258
+ this.files.addResourceSpec(spec.root, spec.spec);
259
+ return spec.spec;
260
+ }, this);
250
261
  }
251
262
 
252
263
  /**
@@ -255,9 +266,9 @@ export default class App {
255
266
  *
256
267
  * @param {String} root the relative path from the source root to the path
257
268
  * to the origin of the caller. This will either be a feature root, or
258
- * empty for the main applicatio the source pathPaths specified in the
259
- * resource spec are assumed to be relative to this.-
260
- * @param {Array<ReourceSpec>} resourceSpecs the copy specs
269
+ * empty for the main application the source pathPaths specified in the
270
+ * resource spec are assumed to be relative to this.
271
+ * @param {ResourceSpecList} resourceSpecs the copy specs
261
272
  * for all the resources being added.
262
273
  */
263
274
  addResources(root, resourceSpecs) {
package/ConfigApp.js CHANGED
@@ -34,7 +34,7 @@ export default class ConfigApp extends App {
34
34
  }
35
35
 
36
36
  if (config.resources && Array.isArray(config.resources)) this.addResources('', config.resources);
37
- if (config.css) this.addMainCss(config.css);
37
+ if (config.css) this.addMainCss('', config.css);
38
38
 
39
39
  if (config.variables) {
40
40
  var names = Object.keys(config.variables);
package/ConfigFeature.js CHANGED
@@ -33,5 +33,6 @@ export default class ConfigFeature extends Feature {
33
33
  if (config.index) app.addFeatureIndex(path.join(this.root, config.index));
34
34
  if (config.config) app.addConfig(config.config, this.root);
35
35
  if (config.resources && Array.isArray(config.resources)) app.addResources(this.root, config.resources);
36
+ if (config.css && Array.isArray(config.css)) app.addMainCss(this.root, config.css);
36
37
  }
37
38
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polylith/builder",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "The polylith builder",
5
5
  "main": "index.js",
6
6
  "type": "module",