webfast 0.1.21 → 0.1.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.
package/README.md CHANGED
@@ -84,11 +84,29 @@ module.exports = {
84
84
  }
85
85
  }
86
86
 
87
- ```
88
- ## Important!
87
+ ## Important Note on Including WebFast
88
+
89
+ When integrating WebFast into your project, consider the following instructions:
90
+
91
+ ```javascript
92
+ // If you want to set up your own paths, add "paths: true" when requiring WebFast.
93
+ // This will prompt WebFast to look for specific folders within your project directory.
89
94
 
90
- The folder [/app] is for your custom project, your custom github and code but can be used in combination with Webfast. Don't wory to contribute.
95
+ const program = require('webfast')({
96
+ paths: true,
97
+ path: __dirname
98
+ });
91
99
  ```
100
+ In this configuration:
101
+
102
+ The paths: true option instructs WebFast to search for specific folders within the project directory.
103
+
104
+ The path: __dirname parameter sets the base directory for WebFast, where it will look for the following essential folders:
105
+
106
+ bots
107
+ ejs
108
+ routes
109
+ Within these folders, you can establish a dynamic setup, as exemplified in the module itself.
92
110
 
93
111
  ```
94
112
  ## License
package/index.js CHANGED
@@ -5,7 +5,8 @@ module.exports = function () {
5
5
  let program = {
6
6
  ts : Date.now(),
7
7
  modules : {},
8
- tmp : {}
8
+ tmp : {},
9
+ set : {}
9
10
  }
10
11
 
11
12
  // Setup The Requirements
@@ -264,7 +264,8 @@ module.exports = async function(program,folder) {
264
264
  console.error(`Error Setting URL`);
265
265
  }
266
266
 
267
- const teleData = program.path.join(__dirname,`telegram`);
267
+ let teleData = program.path.join(__dirname,`telegram`);
268
+
268
269
  let moduleData = await program.modules.walkDirectory(teleData);
269
270
  // Loop Through
270
271
  let telegram = {
@@ -296,6 +297,10 @@ module.exports = async function(program,folder) {
296
297
  }
297
298
 
298
299
  let middleWareFolder = program.path.join(__dirname,`telegram`,`middleware`);
300
+ if (program.set.path != undefined) {
301
+ middleWareFolder = program.path.join(program.set.path,`bots`,`telegram`,`middleware`);
302
+ }
303
+
299
304
  console.log(`MiddleWare:`,middleWareFolder);
300
305
 
301
306
  let middleWareData = program.fs.readdirSync(middleWareFolder);
@@ -333,7 +338,10 @@ module.exports = async function(program,folder) {
333
338
  telegram.middleware = middleWarFuncs;
334
339
 
335
340
  // Process scripts
336
- const scriptsPath = program.path.join(__dirname,`telegram`,`scripts`);
341
+ let scriptsPath = program.path.join(__dirname,`telegram`,`scripts`);
342
+ if (program.set.path != undefined) {
343
+ scriptsPath = program.path.join(program.set.path,`bots`,`telegram`,`scripts`);
344
+ }
337
345
 
338
346
  // Loop Through scripts folder
339
347
  let scriptsData = await program.modules.walkDirectory(scriptsPath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webfast",
3
- "version": "0.1.21",
3
+ "version": "0.1.25",
4
4
  "description": "WebFast! Bot Application, including TON mini-apps",
5
5
  "main": "index.js",
6
6
  "repository": {