mythix 2.4.5 → 2.4.7

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.7",
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.1",
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,17 @@ 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 {
369
372
  let Klass = CommandBase.commands[command];
370
- let nodeArguments = Klass.nodeArguments || [];
373
+ let nodeArguments = ((config.runtime || 'node') === 'node') ? (Klass.nodeArguments || []) : [];
371
374
  let args = nodeArguments.concat([ commandPath ], argv);
372
375
 
373
376
  let code = await spawnCommand(
374
377
  args,
375
378
  {
376
379
  env: {
380
+ MYTHIX_RUNTIME: config.runtime || process.env.MYTHIX_RUNTIME || 'node',
377
381
  MYTHIX_CONFIG_PATH: configPath,
378
382
  MYTHIX_COMMAND_PATH: commandPath,
379
383
  MYTHIX_APPLICATION_COMMANDS: applicationCommandsPath,
@@ -382,6 +386,7 @@ async function executeCommand(configPath, applicationCommandsPath, yargsPath, si
382
386
  MYTHIX_EXECUTE_COMMAND: command,
383
387
  },
384
388
  },
389
+ config,
385
390
  );
386
391
 
387
392
  process.exit(code);