@polylith/builder 0.2.0 → 0.2.2

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 +6 -1
  2. package/package.json +1 -1
  3. package/utils.js +2 -2
package/App.js CHANGED
@@ -121,7 +121,7 @@ export default class App {
121
121
  try {
122
122
  let module = await import(this.modulePath)
123
123
  let router = module.default;
124
- await router(appRouter);
124
+ await router(appRouter, this);
125
125
  return true;
126
126
  } catch(e) {
127
127
  console.error('error while building router', this.modulePath);
@@ -129,6 +129,11 @@ export default class App {
129
129
  }
130
130
  }
131
131
 
132
+ async sendIndex(res) {
133
+ var path = path.join(this.root, this.htmlTemplate.destination);
134
+ res.sendFile(path)
135
+ }
136
+
132
137
  /**
133
138
  * Call this method to add a code variable to the output html file. This
134
139
  * variable will be added the namsespace for the app.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polylith/builder",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "The polylith builder",
5
5
  "main": "index.js",
6
6
  "type": "module",
package/utils.js CHANGED
@@ -10,8 +10,8 @@ import {readFile, writeFile, stat} from 'node:fs/promises';
10
10
  * @returns {String} the new path
11
11
  */
12
12
  export function forceToPosix(src) {
13
- src = src.replace('file:', '');
14
- src = src.replace('///', '');
13
+ src = src.replace('file:', '/');
14
+ src = src.replace('///', '/');
15
15
  src = src.replace(/.*?:/, '');
16
16
  src = src.replace(/\\/g, '/');
17
17