uni-run 2.0.1 → 2.0.3

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/README.md CHANGED
@@ -97,7 +97,7 @@ Create `~/.uni-run.json` to override default runtimes:
97
97
 
98
98
  ```json
99
99
  {
100
- "$schema": "https://github.com/NazmusSayad/uni-run/raw/refs/heads/main/public/uni-run.schema.json",
100
+ "$schema": "https://github.com/NazmusSayad/uni-run/raw/refs/heads/schema/schema.json",
101
101
  "runtime": {
102
102
  "python": "uv",
103
103
  "javascript": "bun",
@@ -30714,11 +30714,17 @@ const runtimeSchema = object({
30714
30714
  ]),
30715
30715
  typescript: _enum([
30716
30716
  "tsx",
30717
+ "tsx.exe",
30717
30718
  "ts-node",
30719
+ "ts-node.exe",
30718
30720
  "deno",
30719
30721
  "bun"
30720
30722
  ]),
30721
- dart: _enum(["dart", "dartvm"]),
30723
+ dart: _enum([
30724
+ "fvm",
30725
+ "dart",
30726
+ "dartvm"
30727
+ ]),
30722
30728
  powershell: _enum(["powershell", "pwsh"]),
30723
30729
  shell: _enum([
30724
30730
  "bash",
@@ -30760,7 +30766,19 @@ const defaultRuntimes = [
30760
30766
  parse(args) {
30761
30767
  return _asyncToGenerator(function* () {
30762
30768
  var _userConfig$runtime$j, _userConfig$runtime;
30763
- return { start: [(_userConfig$runtime$j = (_userConfig$runtime = readUserConfig().runtime) === null || _userConfig$runtime === void 0 ? void 0 : _userConfig$runtime.javascript) !== null && _userConfig$runtime$j !== void 0 ? _userConfig$runtime$j : "node", ...args] };
30769
+ const runtime = (_userConfig$runtime$j = (_userConfig$runtime = readUserConfig().runtime) === null || _userConfig$runtime === void 0 ? void 0 : _userConfig$runtime.javascript) !== null && _userConfig$runtime$j !== void 0 ? _userConfig$runtime$j : "node";
30770
+ if (runtime === "node") return { start: ["node", ...args] };
30771
+ if (runtime === "bun") return { start: [
30772
+ "bun",
30773
+ "run",
30774
+ ...args
30775
+ ] };
30776
+ if (runtime === "deno") return { start: [
30777
+ "deno",
30778
+ "run",
30779
+ ...args
30780
+ ] };
30781
+ throw new Error(`Unsupported JavaScript runtime: ${runtime}`);
30764
30782
  })();
30765
30783
  }
30766
30784
  },
@@ -30777,7 +30795,22 @@ const defaultRuntimes = [
30777
30795
  parse(args) {
30778
30796
  return _asyncToGenerator(function* () {
30779
30797
  var _userConfig$runtime$t, _userConfig$runtime2;
30780
- return { start: [(_userConfig$runtime$t = (_userConfig$runtime2 = readUserConfig().runtime) === null || _userConfig$runtime2 === void 0 ? void 0 : _userConfig$runtime2.typescript) !== null && _userConfig$runtime$t !== void 0 ? _userConfig$runtime$t : "tsx", ...args] };
30798
+ const runtime = (_userConfig$runtime$t = (_userConfig$runtime2 = readUserConfig().runtime) === null || _userConfig$runtime2 === void 0 ? void 0 : _userConfig$runtime2.typescript) !== null && _userConfig$runtime$t !== void 0 ? _userConfig$runtime$t : "tsx";
30799
+ if (runtime === "tsx") return { start: ["tsx", ...args] };
30800
+ if (runtime === "tsx.exe") return { start: ["tsx.exe", ...args] };
30801
+ if (runtime === "ts-node") return { start: ["ts-node", ...args] };
30802
+ if (runtime === "ts-node.exe") return { start: ["ts-node.exe", ...args] };
30803
+ if (runtime === "bun") return { start: [
30804
+ "bun",
30805
+ "run",
30806
+ ...args
30807
+ ] };
30808
+ if (runtime === "deno") return { start: [
30809
+ "deno",
30810
+ "run",
30811
+ ...args
30812
+ ] };
30813
+ throw new Error(`Unsupported TypeScript runtime: ${runtime}`);
30781
30814
  })();
30782
30815
  }
30783
30816
  },
@@ -30788,12 +30821,14 @@ const defaultRuntimes = [
30788
30821
  return _asyncToGenerator(function* () {
30789
30822
  var _userConfig$runtime$p, _userConfig$runtime3;
30790
30823
  const runtime = (_userConfig$runtime$p = (_userConfig$runtime3 = readUserConfig().runtime) === null || _userConfig$runtime3 === void 0 ? void 0 : _userConfig$runtime3.python) !== null && _userConfig$runtime$p !== void 0 ? _userConfig$runtime$p : "python";
30791
- return { start: runtime === "uv" ? [
30824
+ if (runtime === "python" || runtime === "python3") return { start: [runtime, ...args] };
30825
+ if (runtime === "uv") return { start: [
30792
30826
  "uv",
30793
30827
  "run",
30794
30828
  "python",
30795
30829
  ...args
30796
- ] : [runtime, ...args] };
30830
+ ] };
30831
+ throw new Error(`Unsupported Python runtime: ${runtime}`);
30797
30832
  })();
30798
30833
  }
30799
30834
  },
@@ -30813,11 +30848,19 @@ const defaultRuntimes = [
30813
30848
  return _asyncToGenerator(function* () {
30814
30849
  var _userConfig$runtime$d, _userConfig$runtime4;
30815
30850
  const runtime = (_userConfig$runtime$d = (_userConfig$runtime4 = readUserConfig().runtime) === null || _userConfig$runtime4 === void 0 ? void 0 : _userConfig$runtime4.dart) !== null && _userConfig$runtime$d !== void 0 ? _userConfig$runtime$d : "dart";
30816
- return { start: runtime === "dart" ? [
30851
+ if (runtime === "fvm") return { start: [
30852
+ "fvm",
30853
+ "dart",
30854
+ "run",
30855
+ ...args
30856
+ ] };
30857
+ if (runtime === "dart") return { start: [
30817
30858
  "dart",
30818
30859
  "run",
30819
30860
  ...args
30820
- ] : [runtime, ...args] };
30861
+ ] };
30862
+ if (runtime === "dartvm") return { start: ["dartvm", ...args] };
30863
+ throw new Error(`Unsupported Dart runtime: ${runtime}`);
30821
30864
  })();
30822
30865
  }
30823
30866
  },
@@ -30827,11 +30870,13 @@ const defaultRuntimes = [
30827
30870
  parse(args) {
30828
30871
  return _asyncToGenerator(function* () {
30829
30872
  var _userConfig$runtime$p2, _userConfig$runtime5;
30830
- return { start: [
30831
- (_userConfig$runtime$p2 = (_userConfig$runtime5 = readUserConfig().runtime) === null || _userConfig$runtime5 === void 0 ? void 0 : _userConfig$runtime5.powershell) !== null && _userConfig$runtime$p2 !== void 0 ? _userConfig$runtime$p2 : "powershell",
30873
+ const runtime = (_userConfig$runtime$p2 = (_userConfig$runtime5 = readUserConfig().runtime) === null || _userConfig$runtime5 === void 0 ? void 0 : _userConfig$runtime5.powershell) !== null && _userConfig$runtime$p2 !== void 0 ? _userConfig$runtime$p2 : "powershell";
30874
+ if (runtime === "powershell" || runtime === "pwsh") return { start: [
30875
+ runtime,
30832
30876
  "-File",
30833
30877
  ...args
30834
30878
  ] };
30879
+ throw new Error(`Unsupported PowerShell runtime: ${runtime}`);
30835
30880
  })();
30836
30881
  }
30837
30882
  },
@@ -30854,7 +30899,9 @@ const defaultRuntimes = [
30854
30899
  parse(args) {
30855
30900
  return _asyncToGenerator(function* () {
30856
30901
  var _userConfig$runtime$s, _userConfig$runtime6;
30857
- return { start: [(_userConfig$runtime$s = (_userConfig$runtime6 = readUserConfig().runtime) === null || _userConfig$runtime6 === void 0 ? void 0 : _userConfig$runtime6.shell) !== null && _userConfig$runtime$s !== void 0 ? _userConfig$runtime$s : "bash", ...args] };
30902
+ const shell = (_userConfig$runtime$s = (_userConfig$runtime6 = readUserConfig().runtime) === null || _userConfig$runtime6 === void 0 ? void 0 : _userConfig$runtime6.shell) !== null && _userConfig$runtime$s !== void 0 ? _userConfig$runtime$s : "bash";
30903
+ if (shell === "bash" || shell === "zsh" || shell === "sh") return { start: [shell, ...args] };
30904
+ throw new Error(`Unsupported shell: ${shell}`);
30858
30905
  })();
30859
30906
  }
30860
30907
  },
@@ -30873,7 +30920,11 @@ const defaultRuntimes = [
30873
30920
  parse(args) {
30874
30921
  return _asyncToGenerator(function* () {
30875
30922
  var _userConfig$runtime$l, _userConfig$runtime7;
30876
- return { start: [(_userConfig$runtime$l = (_userConfig$runtime7 = readUserConfig().runtime) === null || _userConfig$runtime7 === void 0 ? void 0 : _userConfig$runtime7.lua) !== null && _userConfig$runtime$l !== void 0 ? _userConfig$runtime$l : "lua", ...args] };
30923
+ const runtime = (_userConfig$runtime$l = (_userConfig$runtime7 = readUserConfig().runtime) === null || _userConfig$runtime7 === void 0 ? void 0 : _userConfig$runtime7.lua) !== null && _userConfig$runtime$l !== void 0 ? _userConfig$runtime$l : "lua";
30924
+ if (runtime === "lua") return { start: ["lua", ...args] };
30925
+ if (runtime === "luajit") return { start: ["luajit", ...args] };
30926
+ if (runtime === "luac") return { start: ["luac", ...args] };
30927
+ throw new Error(`Unsupported Lua runtime: ${runtime}`);
30877
30928
  })();
30878
30929
  }
30879
30930
  },
package/dist/run.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { a as resolveSharedConfigOptions, c as TEMP_DIR, d as init_objectSpread2, i as appExecutionConfig, l as source_default, n as defaultRuntimes, o as _asyncToGenerator, r as Execution, s as init_asyncToGenerator, t as app, u as _objectSpread2 } from "./app-BZaoTGMC.mjs";
2
+ import { a as resolveSharedConfigOptions, c as TEMP_DIR, d as init_objectSpread2, i as appExecutionConfig, l as source_default, n as defaultRuntimes, o as _asyncToGenerator, r as Execution, s as init_asyncToGenerator, t as app, u as _objectSpread2 } from "./app-ymqYDN8R.mjs";
3
3
  import fs from "fs";
4
4
  init_objectSpread2();
5
5
  init_asyncToGenerator();
package/dist/rux.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { f as setSystemRuntime, t as app } from "./app-BZaoTGMC.mjs";
2
+ import { f as setSystemRuntime, t as app } from "./app-ymqYDN8R.mjs";
3
3
  setSystemRuntime("rux");
4
4
  app.start(process.argv.slice(2));
5
5
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uni-run",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "scripts": {
5
5
  "test": "vitest run",
6
6
  "test:watch": "vitest",