@fynjs/run 1.1.4 → 1.1.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.
- package/dist/cli/parse-cmd-args.d.ts +2 -2
- package/dist/cli/parse-cmd-args.js +21 -23
- package/dist/lib/xqtor.js +1 -3
- package/package.json +11 -11
|
@@ -13,12 +13,12 @@ import { updateCwd, searchTaskFile, loadTaskFile, processTasks } from "./task-fi
|
|
|
13
13
|
* @returns {ParseResult} Parsed arguments and tasks
|
|
14
14
|
*/
|
|
15
15
|
declare function parseArgs(argv: any, start: any): Promise<{
|
|
16
|
-
opts: Record<string,
|
|
16
|
+
opts: Record<string, unknown>;
|
|
17
17
|
tasks: any[];
|
|
18
18
|
parsed: any;
|
|
19
19
|
searchResult: any;
|
|
20
20
|
} | {
|
|
21
|
-
opts: Record<string,
|
|
21
|
+
opts: Record<string, unknown>;
|
|
22
22
|
tasks: string[];
|
|
23
23
|
parsed: import("@fynjs/cli-args").ParseResult;
|
|
24
24
|
searchResult: any;
|
|
@@ -116,31 +116,29 @@ async function parseArgs(argv, start) {
|
|
|
116
116
|
}
|
|
117
117
|
// Register loaded tasks into subcommand definitions for proper argument & option parsing
|
|
118
118
|
const subCommands = {};
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
catch {
|
|
141
|
-
// ignore lookup errors for invalid task names
|
|
119
|
+
const names = ownInstance.xrun._tasks.names();
|
|
120
|
+
const fullNames = ownInstance.xrun._tasks.fullNames();
|
|
121
|
+
const allTaskNames = new Set([...names, ...fullNames]);
|
|
122
|
+
for (const name of allTaskNames) {
|
|
123
|
+
try {
|
|
124
|
+
const lookupRes = ownInstance.xrun._tasks.lookup(name);
|
|
125
|
+
const taskSpec = getTaskOptionSpec(lookupRes?.item);
|
|
126
|
+
if (Object.keys(taskSpec.options).length > 0 ||
|
|
127
|
+
Object.keys(taskSpec.commands).length > 0) {
|
|
128
|
+
subCommands[name] = {
|
|
129
|
+
desc: lookupRes?.item?.desc || "",
|
|
130
|
+
options: taskSpec.options,
|
|
131
|
+
subCommands: taskSpec.commands,
|
|
132
|
+
commands: taskSpec.commands,
|
|
133
|
+
...(taskSpec.allowUnknownOption !== undefined
|
|
134
|
+
? { allowUnknownOption: taskSpec.allowUnknownOption }
|
|
135
|
+
: {})
|
|
136
|
+
};
|
|
142
137
|
}
|
|
143
138
|
}
|
|
139
|
+
catch {
|
|
140
|
+
// ignore lookup errors for invalid task names
|
|
141
|
+
}
|
|
144
142
|
}
|
|
145
143
|
if (Object.keys(subCommands).length > 0) {
|
|
146
144
|
const nc2 = new NixClap({
|
package/dist/lib/xqtor.js
CHANGED
|
@@ -570,9 +570,7 @@ because value type ${vtype} is unknown and no value.item`));
|
|
|
570
570
|
if (unknownOptions.length > 0) {
|
|
571
571
|
return done(new Error(`Unknown options for task ${qItem.name}: ${unknownOptions.join(", ")}`));
|
|
572
572
|
}
|
|
573
|
-
|
|
574
|
-
return done(new Error(`Error parsing options for task ${qItem.name}: ${otherErrors.join("; ")}`));
|
|
575
|
-
}
|
|
573
|
+
return done(new Error(`Error parsing options for task ${qItem.name}: ${otherErrors.join("; ")}`));
|
|
576
574
|
}
|
|
577
575
|
cliCmd = argp.command;
|
|
578
576
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fynjs/run",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.6",
|
|
4
4
|
"description": "concurrent or serial run npm scripts, javascript tasks, and more",
|
|
5
5
|
"main": "./dist/lib/index.js",
|
|
6
6
|
"types": "./dist/lib/index.d.ts",
|
|
@@ -88,29 +88,29 @@
|
|
|
88
88
|
"homepage": "https://github.com/jchip/fynjs/tree/main/packages/xarc-run",
|
|
89
89
|
"dependencies": {
|
|
90
90
|
"chalk": "^6.0.0",
|
|
91
|
-
"chalker": "^2.1.
|
|
91
|
+
"chalker": "^2.1.5",
|
|
92
92
|
"insync": "^2.1.1",
|
|
93
93
|
"jaro-winkler": "^0.2.8",
|
|
94
|
-
"@fynjs/cli-args": "^1.1.
|
|
94
|
+
"@fynjs/cli-args": "^1.1.5",
|
|
95
95
|
"optional-require": "^2.1.0",
|
|
96
96
|
"read-package-up": "^12.0.0",
|
|
97
|
-
"string-array": "^2.1.
|
|
98
|
-
"unwrap-npm-cmd": "^2.1.
|
|
99
|
-
"xsh": "^1.1.
|
|
97
|
+
"string-array": "^2.1.5",
|
|
98
|
+
"unwrap-npm-cmd": "^2.1.5",
|
|
99
|
+
"xsh": "^1.1.6"
|
|
100
100
|
},
|
|
101
101
|
"devDependencies": {
|
|
102
|
-
"@fynjs/ts-resolve": "^1.0.
|
|
102
|
+
"@fynjs/ts-resolve": "^1.0.3",
|
|
103
103
|
"@types/node": "^26.4.1",
|
|
104
104
|
"@vitest/coverage-v8": "^5.0.0",
|
|
105
|
-
"munchy": "^2.0.
|
|
105
|
+
"munchy": "^2.0.5",
|
|
106
106
|
"prettier": "^3.5.3",
|
|
107
|
-
"publish-util": "^3.1.
|
|
108
|
-
"run-verify": "^2.1.
|
|
107
|
+
"publish-util": "^3.1.5",
|
|
108
|
+
"run-verify": "^2.1.6",
|
|
109
109
|
"strip-ansi": "^7.2.0",
|
|
110
110
|
"typescript": "^7.0.2",
|
|
111
111
|
"vite": "^8.2.2",
|
|
112
112
|
"vitest": "^5.0.0",
|
|
113
|
-
"xaa": "^3.1.
|
|
113
|
+
"xaa": "^3.1.5",
|
|
114
114
|
"xstdout": "^0.1.1"
|
|
115
115
|
},
|
|
116
116
|
"type": "module"
|