@faable/faable 1.4.6 → 1.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.
@@ -1,6 +1,7 @@
1
1
  import fs from 'fs-extra';
2
2
  import path__default from 'path';
3
3
  import { cmd } from '../../../../lib/cmd.js';
4
+ import { log } from '../../../../log.js';
4
5
 
5
6
  /**
6
7
  * Strategy to detect app name from package.json
@@ -18,8 +19,14 @@ const strategy_nodejs = async (workdir) => {
18
19
  // Use engines.node if found
19
20
  let runtime_version = "18.19.0";
20
21
  if (engines?.node) {
21
- const out = await cmd(`npm view node@20.8 version | tail -n 1 | cut -d "'" -f2`);
22
- runtime_version = out.stdout.toString();
22
+ try {
23
+ const out = await cmd(`npm view node@${engines.node} version | tail -n 1 | cut -d "'" -f2`);
24
+ runtime_version = out.stdout.toString();
25
+ log.info(`Using node@${runtime_version} from engines in package.json (${engines.node})`);
26
+ }
27
+ catch (e) {
28
+ throw new Error(`Node version is not valid (${engines.node})`);
29
+ }
23
30
  }
24
31
  return {
25
32
  app_name: name,
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "yaml": "^2.2.2",
15
15
  "yargs": "^17.6.2"
16
16
  },
17
- "version": "1.4.6",
17
+ "version": "1.4.7",
18
18
  "bin": {
19
19
  "faable": "bin/faable.js"
20
20
  },