webfast 0.1.28 → 0.1.31

Sign up to get free protection for your applications and to get access to all the features.
package/index.js CHANGED
@@ -1,6 +1,7 @@
1
- module.exports = function () {
1
+ module.exports = function (array) {
2
2
  const { readdirSync } = require("fs");
3
3
 
4
+ // Need to walk through array for specific things
4
5
  console.log(`WebFast!! Program`);
5
6
  let program = {
6
7
  ts : Date.now(),
@@ -9,12 +10,17 @@ module.exports = function () {
9
10
  set : {}
10
11
  }
11
12
 
13
+ for (let key in array) {
14
+ program.set[key] = array[key];
15
+ }
16
+
12
17
  // Setup The Requirements
13
18
  async function set(program) {
14
19
  program.path = await require(`path`);
15
20
  program.fs = await require(`fs`);
16
21
  program.uuid = require(`uuid`);
17
22
  program.fetch = require(`fetch`);
23
+
18
24
  return program;
19
25
  }
20
26
 
@@ -121,9 +127,11 @@ module.exports = function () {
121
127
  }
122
128
  }
123
129
 
124
- program.modules.fetch = async function(folder,program) {
130
+ program.modules.fetch = async function(folder,program,fetch) {
125
131
  // TO Fetch folder modules
126
- program = await set(program);
132
+ if (fetch == undefined) {
133
+ program = await set(program);
134
+ }
127
135
  try {
128
136
  // Loop through folder and run module if js
129
137
  const readPath = program.path.join(__dirname,folder);
@@ -244,10 +252,5 @@ module.exports = function () {
244
252
 
245
253
  // Run program fetch
246
254
  program.modules.fetch(`modules`,program);
247
- }
248
-
249
- if (process.env.log == undefined) {
250
- console.log = function() {
251
-
252
- }
255
+ return program;
253
256
  }
@@ -2,5 +2,5 @@ module.exports = async function (program, name) {
2
2
  console.log(`Running ${name}`);
3
3
 
4
4
  // src/ton-connect/wallets.js
5
-
5
+ return program;
6
6
  };
@@ -345,19 +345,19 @@ module.exports = async function(program,folder) {
345
345
 
346
346
  // Loop Through scripts folder
347
347
  let scriptsData = await program.modules.walkDirectory(scriptsPath);
348
-
348
+
349
349
  // Let's loop througha and if no extension it's folder
350
350
  let allScripts = {
351
351
  int : {}
352
352
  }
353
353
  for (let scriptIndex in scriptsData) {
354
- let script = scriptsData[scriptIndex];
354
+ let script = [scriptIndex];
355
355
  // We now have the specific script check if folder
356
356
  if (!script.extension) {
357
357
  // It's folder create the function and read folder
358
358
  console.log(`It's folder check for files as in .json or .js`);
359
359
  const folderScriptScan = await program.modules.walkDirectory(script.path);
360
-
360
+
361
361
  // Create now allScripts item interaction as we will check dynamic for the item
362
362
  for (let fsi in folderScriptScan) {
363
363
  // So now again we only do things when it's a file but check extension
@@ -24,7 +24,12 @@ module.exports = async function (program) {
24
24
  app.use(bodyParser.urlencoded({ extended: true }));
25
25
  app.set('view engine', 'ejs');
26
26
 
27
- const routesPath = program.path.join(__dirname, `routes`);
27
+ let routesPath = program.path.join(__dirname, `routes`);
28
+ // Check if custom routes path
29
+ if (program.set.path != undefined) {
30
+ routesPath = program.path.join(program.set.path,`routes`);
31
+ }
32
+
28
33
  let exprs = {};
29
34
 
30
35
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webfast",
3
- "version": "0.1.28",
3
+ "version": "0.1.31",
4
4
  "description": "WebFast! Bot Application, including TON mini-apps",
5
5
  "main": "index.js",
6
6
  "repository": {
File without changes
File without changes
File without changes
File without changes