@stacksjs/actions 0.70.138 → 0.70.140
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/helpers/utils.d.ts +1 -0
- package/dist/helpers/utils.js +11 -6
- package/package.json +17 -17
package/dist/helpers/utils.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export declare function runAction(action: Action, options?: ActionOptions): Prom
|
|
|
18
18
|
* @returns The result of the command.
|
|
19
19
|
*/
|
|
20
20
|
export declare function runActions(actions: Action[], options?: ActionOptions): Promise<any>;
|
|
21
|
+
export declare function runActionSequence(actions: Action[], options: ActionOptions | undefined, runner?: typeof runAction): Promise<any>;
|
|
21
22
|
// looks in most common locations
|
|
22
23
|
export declare function hasAction(action: Action): boolean;
|
|
23
24
|
declare type ActionPath = string // TODO: narrow this by automating its generation
|
package/dist/helpers/utils.js
CHANGED
|
@@ -2,7 +2,7 @@ var {require}=import.meta;import { existsSync } from "node:fs";
|
|
|
2
2
|
import { homedir } from "node:os";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import process from "node:process";
|
|
5
|
-
import { buddyOptions, runCommand
|
|
5
|
+
import { buddyOptions, runCommand } from "@stacksjs/cli";
|
|
6
6
|
import { err } from "@stacksjs/error-handling";
|
|
7
7
|
import { log } from "@stacksjs/logging";
|
|
8
8
|
import * as p from "@stacksjs/path";
|
|
@@ -98,11 +98,16 @@ export async function runActions(actions, options) {
|
|
|
98
98
|
for (const action of actions)
|
|
99
99
|
if (!hasAction(action))
|
|
100
100
|
return err(`The specified action "${action}" does not exist`);
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
101
|
+
return await runActionSequence(actions, options);
|
|
102
|
+
}
|
|
103
|
+
export async function runActionSequence(actions, options, runner = runAction) {
|
|
104
|
+
let result;
|
|
105
|
+
for (const action of actions) {
|
|
106
|
+
result = await runner(action, options);
|
|
107
|
+
if (result?.isErr)
|
|
108
|
+
return result;
|
|
109
|
+
}
|
|
110
|
+
return result;
|
|
106
111
|
}
|
|
107
112
|
export function hasAction(action) {
|
|
108
113
|
const userActionPatterns = [
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@stacksjs/actions",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "0.70.
|
|
5
|
+
"version": "0.70.140",
|
|
6
6
|
"description": "The Stacks actions.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"contributors": [
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"prepublishOnly": "bun run build"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@stacksjs/config": "0.70.
|
|
65
|
+
"@stacksjs/config": "0.70.140",
|
|
66
66
|
"@stacksjs/bumpx": "^0.2.6",
|
|
67
67
|
"@stacksjs/bunpress": "^0.1.12",
|
|
68
68
|
"@stacksjs/logsmith": "^0.2.3",
|
|
@@ -70,23 +70,23 @@
|
|
|
70
70
|
"@stacksjs/ts-md": "^0.1.1"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
|
-
"@stacksjs/api": "0.70.
|
|
74
|
-
"@stacksjs/cli": "0.70.
|
|
75
|
-
"@stacksjs/config": "0.70.
|
|
76
|
-
"@stacksjs/database": "0.70.
|
|
73
|
+
"@stacksjs/api": "0.70.140",
|
|
74
|
+
"@stacksjs/cli": "0.70.140",
|
|
75
|
+
"@stacksjs/config": "0.70.140",
|
|
76
|
+
"@stacksjs/database": "0.70.140",
|
|
77
77
|
"@stacksjs/tlsx": "^0.13.2",
|
|
78
78
|
"better-dx": "^0.2.17",
|
|
79
|
-
"@stacksjs/dns": "0.70.
|
|
80
|
-
"@stacksjs/enums": "0.70.
|
|
81
|
-
"@stacksjs/env": "0.70.
|
|
82
|
-
"@stacksjs/error-handling": "0.70.
|
|
83
|
-
"@stacksjs/logging": "0.70.
|
|
84
|
-
"@stacksjs/path": "0.70.
|
|
85
|
-
"@stacksjs/security": "0.70.
|
|
86
|
-
"@stacksjs/storage": "0.70.
|
|
87
|
-
"@stacksjs/strings": "0.70.
|
|
88
|
-
"@stacksjs/utils": "0.70.
|
|
89
|
-
"@stacksjs/validation": "0.70.
|
|
79
|
+
"@stacksjs/dns": "0.70.140",
|
|
80
|
+
"@stacksjs/enums": "0.70.140",
|
|
81
|
+
"@stacksjs/env": "0.70.140",
|
|
82
|
+
"@stacksjs/error-handling": "0.70.140",
|
|
83
|
+
"@stacksjs/logging": "0.70.140",
|
|
84
|
+
"@stacksjs/path": "0.70.140",
|
|
85
|
+
"@stacksjs/security": "0.70.140",
|
|
86
|
+
"@stacksjs/storage": "0.70.140",
|
|
87
|
+
"@stacksjs/strings": "0.70.140",
|
|
88
|
+
"@stacksjs/utils": "0.70.140",
|
|
89
|
+
"@stacksjs/validation": "0.70.140"
|
|
90
90
|
},
|
|
91
91
|
"peerDependencies": {
|
|
92
92
|
"pickier": "^0.1.35"
|