functionalscript 0.10.0 → 0.10.1

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.
Files changed (2) hide show
  1. package/fjs/module.f.js +8 -2
  2. package/package.json +1 -1
package/fjs/module.f.js CHANGED
@@ -7,9 +7,10 @@ import { fromIo } from "../io/module.f.js";
7
7
  import { compile } from "../djs/module.f.js";
8
8
  import { main as testMain } from "../dev/tf/module.f.js";
9
9
  import { main as casMain } from "../cas/module.f.js";
10
- export const main = (io) => {
10
+ export const main = async (io) => {
11
11
  const { error } = io.console;
12
12
  const [command, ...rest] = io.process.argv.slice(2);
13
+ const eRun = fromIo(io);
13
14
  switch (command) {
14
15
  case 'test':
15
16
  case 't':
@@ -19,7 +20,12 @@ export const main = (io) => {
19
20
  return compile(io)(rest);
20
21
  case 'cas':
21
22
  case 's':
22
- return fromIo(io)(casMain(rest));
23
+ return eRun(casMain(rest));
24
+ case 'run':
25
+ case 'r':
26
+ const [file, ...args] = rest;
27
+ const m = await io.asyncImport(file);
28
+ return eRun(m.default(args));
23
29
  case undefined:
24
30
  error('Error: command is required');
25
31
  return Promise.resolve(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "functionalscript",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "**/*.js",