@stacksjs/actions 0.70.138 → 0.70.139

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.
@@ -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
@@ -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, runCommands } from "@stacksjs/cli";
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
- const opts = buddyOptions(options) || "", o = {
102
- cwd: options?.cwd || p.projectPath(),
103
- ...options
104
- }, commands = actions.map((action) => `bun ${p.relativeActionsPath(`src/${action}.ts`)} ${opts}`);
105
- return await runCommands(commands, o);
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.138",
5
+ "version": "0.70.139",
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.138",
65
+ "@stacksjs/config": "0.70.139",
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.138",
74
- "@stacksjs/cli": "0.70.138",
75
- "@stacksjs/config": "0.70.138",
76
- "@stacksjs/database": "0.70.138",
73
+ "@stacksjs/api": "0.70.139",
74
+ "@stacksjs/cli": "0.70.139",
75
+ "@stacksjs/config": "0.70.139",
76
+ "@stacksjs/database": "0.70.139",
77
77
  "@stacksjs/tlsx": "^0.13.2",
78
78
  "better-dx": "^0.2.17",
79
- "@stacksjs/dns": "0.70.138",
80
- "@stacksjs/enums": "0.70.138",
81
- "@stacksjs/env": "0.70.138",
82
- "@stacksjs/error-handling": "0.70.138",
83
- "@stacksjs/logging": "0.70.138",
84
- "@stacksjs/path": "0.70.138",
85
- "@stacksjs/security": "0.70.138",
86
- "@stacksjs/storage": "0.70.138",
87
- "@stacksjs/strings": "0.70.138",
88
- "@stacksjs/utils": "0.70.138",
89
- "@stacksjs/validation": "0.70.138"
79
+ "@stacksjs/dns": "0.70.139",
80
+ "@stacksjs/enums": "0.70.139",
81
+ "@stacksjs/env": "0.70.139",
82
+ "@stacksjs/error-handling": "0.70.139",
83
+ "@stacksjs/logging": "0.70.139",
84
+ "@stacksjs/path": "0.70.139",
85
+ "@stacksjs/security": "0.70.139",
86
+ "@stacksjs/storage": "0.70.139",
87
+ "@stacksjs/strings": "0.70.139",
88
+ "@stacksjs/utils": "0.70.139",
89
+ "@stacksjs/validation": "0.70.139"
90
90
  },
91
91
  "peerDependencies": {
92
92
  "pickier": "^0.1.35"