mythix 2.4.5 → 2.4.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mythix",
3
- "version": "2.4.5",
3
+ "version": "2.4.9",
4
4
  "description": "Mythix is a NodeJS web-app framework",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -30,7 +30,7 @@
30
30
  "express": "^4.17.3",
31
31
  "express-busboy": "github:th317erd/express-busboy#0754a570d7979097b31e48655b80d3fcd628d4e4",
32
32
  "form-data": "^4.0.0",
33
- "mythix-orm": "^1.4.7",
33
+ "mythix-orm": "^1.5.2",
34
34
  "nife": "^1.11.3",
35
35
  "prompts": "^2.4.2"
36
36
  }
@@ -307,6 +307,8 @@ function loadMythixConfig(_mythixConfigPath, _appRootPath) {
307
307
  let appRootPath = (_appRootPath) ? Path.resolve(_appRootPath) : Path.resolve(mythixConfigPath, 'app');
308
308
 
309
309
  let defaultConfig = {
310
+ runtime: process.env.MYTHIX_RUNTIME || 'node',
311
+ runtimeArgs: (process.env.MYTHIX_RUNTIME_ARGS || '').split(/\s+/g),
310
312
  applicationPath: (config) => Path.resolve(config.appRootPath, 'application.js'),
311
313
  getApplicationClass: (config) => {
312
314
  let Application = require(config.applicationPath);
@@ -337,14 +339,15 @@ function loadMythixConfig(_mythixConfigPath, _appRootPath) {
337
339
  return resolveConfig(defaultConfig);
338
340
  }
339
341
 
340
- function spawnCommand(args, options) {
342
+ function spawnCommand(args, options, _config) {
343
+ const config = _config || {};
341
344
  const { spawn } = require('child_process');
342
345
 
343
346
  return new Promise((resolve, reject) => {
344
347
  try {
345
348
  let childProcess = spawn(
346
- 'node',
347
- args,
349
+ config.runtime || 'node',
350
+ (config.runtimeArgs || []).concat(args),
348
351
  Object.assign({}, options || {}, {
349
352
  env: Object.assign({}, process.env, (options || {}).env || {}),
350
353
  stdio: 'inherit',
@@ -364,16 +367,18 @@ function spawnCommand(args, options) {
364
367
  });
365
368
  }
366
369
 
367
- async function executeCommand(configPath, applicationCommandsPath, yargsPath, simpleYargsPath, argv, commandPath, command) {
370
+ async function executeCommand(configPath, applicationCommandsPath, yargsPath, simpleYargsPath, argv, commandPath, command, _config) {
368
371
  try {
372
+ let config = _config || {};
369
373
  let Klass = CommandBase.commands[command];
370
- let nodeArguments = Klass.nodeArguments || [];
374
+ let nodeArguments = ((config.runtime || 'node') === 'node') ? (Klass.nodeArguments || []) : [];
371
375
  let args = nodeArguments.concat([ commandPath ], argv);
372
376
 
373
377
  let code = await spawnCommand(
374
378
  args,
375
379
  {
376
380
  env: {
381
+ MYTHIX_RUNTIME: config.runtime || process.env.MYTHIX_RUNTIME || 'node',
377
382
  MYTHIX_CONFIG_PATH: configPath,
378
383
  MYTHIX_COMMAND_PATH: commandPath,
379
384
  MYTHIX_APPLICATION_COMMANDS: applicationCommandsPath,
@@ -382,6 +387,7 @@ async function executeCommand(configPath, applicationCommandsPath, yargsPath, si
382
387
  MYTHIX_EXECUTE_COMMAND: command,
383
388
  },
384
389
  },
390
+ config,
385
391
  );
386
392
 
387
393
  process.exit(code);