@mojojs/core 0.12.1 → 0.12.2

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/lib/cli/eval.js CHANGED
@@ -1,12 +1,19 @@
1
+ import nopt from 'nopt';
1
2
  export default async function evalCommand(app, args) {
2
- console.log(eval(args[1]));
3
+ const parsed = nopt({ verbose: Boolean }, { v: '--verbose' }, args, 1);
4
+ const output = await eval('(async () => (' + parsed.argv.remain[0] + '))()');
5
+ if (parsed.verbose === true)
6
+ console.log(output);
3
7
  }
4
8
  evalCommand.description = 'Run code against application';
5
9
  evalCommand.usage = `Usage: APPLICATION eval [OPTIONS] CODE
6
10
 
7
- node index.js eval 'app.home.toString()'
11
+ node index.js eval -v '(await app.ua.get("https://mojojs.org")).status'
12
+ node index.js eval -v 'app.home.toString()'
13
+ node index.js eval -v 'app.renderer.viewPaths'
8
14
 
9
15
  Options:
10
- -h, --help Show this summary of available options
16
+ -h, --help Show this summary of available options
17
+ -v, --verbose Print return value to STDOUT
11
18
  `;
12
19
  //# sourceMappingURL=eval.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"eval.js","sourceRoot":"","sources":["../../src/cli/eval.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,WAAW,CAAC,GAAY,EAAE,IAAc;IACpE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7B,CAAC;AAED,WAAW,CAAC,WAAW,GAAG,8BAA8B,CAAC;AACzD,WAAW,CAAC,KAAK,GAAG;;;;;;CAMnB,CAAC"}
1
+ {"version":3,"file":"eval.js","sourceRoot":"","sources":["../../src/cli/eval.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,WAAW,CAAC,GAAY,EAAE,IAAc;IACpE,MAAM,MAAM,GAAG,IAAI,CAAC,EAAC,OAAO,EAAE,OAAO,EAAC,EAAE,EAAC,CAAC,EAAE,WAAW,EAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACnE,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC;IAC7E,IAAI,MAAM,CAAC,OAAO,KAAK,IAAI;QAAE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACnD,CAAC;AAED,WAAW,CAAC,WAAW,GAAG,8BAA8B,CAAC;AACzD,WAAW,CAAC,KAAK,GAAG;;;;;;;;;CASnB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mojojs/core",
3
- "version": "0.12.1",
3
+ "version": "0.12.2",
4
4
  "description": "Real-time web framework",
5
5
  "keywords": [
6
6
  "web",
@@ -55,7 +55,7 @@
55
55
  "@types/js-yaml": "^4.0.3",
56
56
  "@types/lru-cache": "^5.1.0",
57
57
  "@types/mime-types": "^2.1.0",
58
- "@types/node": "^16.0.0",
58
+ "@types/node": "^17.0.0",
59
59
  "@types/nopt": "^3.0.29",
60
60
  "@types/stack-utils": "^2.0.0",
61
61
  "@types/tap": "^15.0.3",