uni-run 1.0.4 → 1.0.6

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 (61) hide show
  1. package/README.md +122 -0
  2. package/dist/app.cjs +60 -0
  3. package/dist/app.d.mts +1 -0
  4. package/dist/{index.js → app.mjs} +8 -10
  5. package/dist/{arg-helper.js → arg-helper.cjs} +44 -31
  6. package/dist/{arg-helper.d.ts → arg-helper.d.cts} +52 -42
  7. package/dist/arg-helper.d.mts +121 -0
  8. package/dist/arg-helper.mjs +93 -0
  9. package/dist/{arg.js → arg.cjs} +5 -2
  10. package/dist/{arg.d.ts → arg.d.cts} +95 -77
  11. package/dist/arg.d.mts +243 -0
  12. package/dist/arg.mjs +9 -0
  13. package/dist/{bin.js → bin.cjs} +2 -2
  14. package/dist/{bin.d.ts → bin.d.cts} +1 -1
  15. package/dist/bin.d.mts +2 -0
  16. package/dist/bin.mjs +4 -0
  17. package/dist/builtin-bin/{Executor.js → Executor.cjs} +5 -2
  18. package/dist/builtin-bin/{Executor.d.ts → Executor.d.cts} +1 -1
  19. package/dist/builtin-bin/Executor.d.mts +21 -0
  20. package/dist/builtin-bin/Executor.mjs +61 -0
  21. package/dist/builtin-bin/{index.js → index.cjs} +4 -1
  22. package/dist/builtin-bin/{index.d.ts → index.d.cts} +1 -1
  23. package/dist/builtin-bin/index.d.mts +3 -0
  24. package/dist/builtin-bin/index.mjs +94 -0
  25. package/dist/execution/gitignore.cjs +40 -0
  26. package/dist/execution/gitignore.d.mts +1 -0
  27. package/dist/execution/gitignore.mjs +11 -0
  28. package/dist/execution/{index.js → index.cjs} +47 -8
  29. package/dist/execution/{index.d.ts → index.d.cts} +3 -1
  30. package/dist/execution/index.d.mts +15 -0
  31. package/dist/execution/index.mjs +103 -0
  32. package/dist/execution/kill-process.cjs +50 -0
  33. package/dist/execution/{kill-process.d.ts → kill-process.d.cts} +1 -1
  34. package/dist/execution/kill-process.d.mts +2 -0
  35. package/dist/execution/{kill-process.js → kill-process.mjs} +4 -7
  36. package/dist/execution/watcher.cjs +64 -0
  37. package/dist/execution/watcher.d.mts +6 -0
  38. package/dist/execution/{watcher.js → watcher.mjs} +8 -11
  39. package/dist/index.cjs +19 -0
  40. package/dist/index.d.cts +8 -0
  41. package/dist/index.d.mts +8 -0
  42. package/dist/index.mjs +13 -0
  43. package/dist/lib/colors.cjs +32 -0
  44. package/dist/lib/colors.d.cts +3 -0
  45. package/dist/lib/colors.d.mts +3 -0
  46. package/dist/lib/colors.mjs +4 -0
  47. package/dist/lib/currentModule.cjs +19 -0
  48. package/dist/lib/currentModule.d.cts +5 -0
  49. package/dist/lib/currentModule.d.mts +5 -0
  50. package/dist/lib/currentModule.mjs +17 -0
  51. package/dist/utils/debounce.d.mts +1 -0
  52. package/dist/utils/debounce.mjs +7 -0
  53. package/package.json +14 -10
  54. package/dist/execution/gitignore.js +0 -14
  55. package/dist/lib/colors.d.ts +0 -2
  56. package/dist/lib/colors.js +0 -4
  57. /package/dist/{index.d.ts → app.d.cts} +0 -0
  58. /package/dist/execution/{gitignore.d.ts → gitignore.d.cts} +0 -0
  59. /package/dist/execution/{watcher.d.ts → watcher.d.cts} +0 -0
  60. /package/dist/utils/{debounce.js → debounce.cjs} +0 -0
  61. /package/dist/utils/{debounce.d.ts → debounce.d.cts} +0 -0
@@ -0,0 +1,4 @@
1
+ import mjs from "ansi-colors";
2
+ import * as cjs from "ansi-colors";
3
+ import currentModule from "./currentModule.mjs";
4
+ export default currentModule.isCJS ? cjs : mjs;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ // @ts-nocheck
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ let currentModule;
5
+ try {
6
+ currentModule = module;
7
+ currentModule = exports;
8
+ currentModule = 'cjs';
9
+ }
10
+ catch (_a) {
11
+ currentModule = 'mjs';
12
+ }
13
+ if (!currentModule) {
14
+ throw new Error('Unkown module System');
15
+ }
16
+ exports.default = {
17
+ isCJS: currentModule === 'cjs',
18
+ isESM: currentModule === 'mjs',
19
+ };
@@ -0,0 +1,5 @@
1
+ declare const _default: {
2
+ isCJS: boolean;
3
+ isESM: boolean;
4
+ };
5
+ export default _default;
@@ -0,0 +1,5 @@
1
+ declare const _default: {
2
+ isCJS: boolean;
3
+ isESM: boolean;
4
+ };
5
+ export default _default;
@@ -0,0 +1,17 @@
1
+ // @ts-nocheck
2
+ let currentModule;
3
+ try {
4
+ currentModule = module;
5
+ currentModule = exports;
6
+ currentModule = 'cjs';
7
+ }
8
+ catch (_a) {
9
+ currentModule = 'mjs';
10
+ }
11
+ if (!currentModule) {
12
+ throw new Error('Unkown module System');
13
+ }
14
+ export default {
15
+ isCJS: currentModule === 'cjs',
16
+ isESM: currentModule === 'mjs',
17
+ };
@@ -0,0 +1 @@
1
+ export declare function createDebounce(delay: number): (fn: Function) => void;
@@ -0,0 +1,7 @@
1
+ export function createDebounce(delay) {
2
+ let debounceTimeout;
3
+ return function (fn) {
4
+ clearTimeout(debounceTimeout);
5
+ debounceTimeout = setTimeout(() => fn(), delay);
6
+ };
7
+ }
package/package.json CHANGED
@@ -1,18 +1,21 @@
1
1
  {
2
2
  "name": "uni-run",
3
+ "version": "1.0.6",
3
4
  "description": "Universal Runner for many language",
4
- "version": "1.0.4",
5
- "type": "commonjs",
6
5
  "scripts": {
7
- "ts": "tsx --watch ./src/__lab__/index.ts",
8
- "js": "node --watch ./dist/__lab__/index.js",
6
+ "dev": "npmize dev",
7
+ "build": "npmize build",
9
8
  "tsc": "tsc --watch --noEmit",
10
- "dev": "tsc --watch",
11
- "build": "node ./build.cjs"
9
+ "lab": "run ./src/__lab__/index.ts",
10
+ "ts": "tsx --watch ./src/__lab__/index.ts",
11
+ "cjs": "node --watch ./dist/__lab__/index.cjs",
12
+ "mjs": "node --watch ./dist/__lab__/index.mjs"
12
13
  },
14
+ "main": "./dist/index.cjs",
15
+ "module": "./dist/index.mjs",
13
16
  "bin": {
14
- "run": "./dist/bin.js",
15
- "uni-run": "./dist/bin.js"
17
+ "run": "./dist/bin.cjs",
18
+ "uni-run": "./dist/bin.cjs"
16
19
  },
17
20
  "dependencies": {
18
21
  "ansi-colors": "^4.1.3",
@@ -23,8 +26,9 @@
23
26
  },
24
27
  "devDependencies": {
25
28
  "@types/cross-spawn": "^6.0.6",
26
- "@types/node": "^22.5.0",
27
- "typescript": "^5.5.4"
29
+ "@types/node": "^22.5.5",
30
+ "npmize": "^1.1.3",
31
+ "typescript": "^5.6.2"
28
32
  },
29
33
  "repository": {
30
34
  "type": "git",
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = default_1;
4
- const fs = require("fs");
5
- const path = require("path");
6
- const ignore_1 = require("ignore");
7
- function default_1(baseDir, extraIgnore = []) {
8
- const gitignorePath = path.resolve(path.join(baseDir, '.gitignore'));
9
- const ig = (0, ignore_1.default)({ ignorecase: true }).add(extraIgnore);
10
- if (fs.existsSync(gitignorePath)) {
11
- return ig.add(fs.readFileSync(gitignorePath).toString());
12
- }
13
- return ig;
14
- }
@@ -1,2 +0,0 @@
1
- import * as colors from 'ansi-colors';
2
- export default colors;
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const colors = require("ansi-colors");
4
- exports.default = colors;
File without changes
File without changes
File without changes
File without changes