@stacksjs/actions 0.70.95 → 0.70.97

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/dev/api.js CHANGED
@@ -4,8 +4,9 @@ import { parseOptions } from "@stacksjs/cli";
4
4
  import { config, overridesReady } from "@stacksjs/config";
5
5
  import { path } from "@stacksjs/path";
6
6
  import { route } from "@stacksjs/router";
7
- import { generateAutoImportFiles, injectGlobalAutoImports } from "@stacksjs/server";
7
+ import { generateAutoImportFiles, generateServerAutoImportTypes, injectGlobalAutoImports } from "@stacksjs/server";
8
8
  const _options = parseOptions();
9
+ await generateServerAutoImportTypes();
9
10
  await overridesReady;
10
11
  const port = Number(process.env.PORT_API) || config.ports?.api || 3008, modelsIndex = path.storagePath("framework/auto-imports/models.ts");
11
12
  if (!existsSync(modelsIndex))
@@ -1,5 +1,6 @@
1
1
  import type { ActionOptions, CommandError, Subprocess } from '@stacksjs/types';
2
2
  import type { Result } from '@stacksjs/error-handling';
3
+ export declare function developmentConditionForProject(projectRoot: string): string;
3
4
  /**
4
5
  * Run an Action the Stacks way.
5
6
  *
@@ -6,6 +6,9 @@ import { buddyOptions, runCommand, runCommands } 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";
9
+ export function developmentConditionForProject(projectRoot) {
10
+ return existsSync(join(projectRoot, "storage/framework/core")) && existsSync(join(projectRoot, "node_modules/@stacksjs/env/src/index.ts")) ? "--conditions development" : "";
11
+ }
9
12
  async function resolveActionFile(action) {
10
13
  const candidates = [];
11
14
  candidates.push(p.actionsPath(`src/${action}.ts`));
@@ -67,7 +70,7 @@ export async function runAction(action, options) {
67
70
  if (!path)
68
71
  return err(`Action '${action}' not found in storage/framework/core/actions/src or @stacksjs/actions`);
69
72
  log.debug(`[action] Resolved: ${action} \u2192 ${path}`);
70
- const isDevAction = action.startsWith("dev/"), watchFlag = isDevAction ? "--watch" : "", opts = isDevAction ? "" : buddyOptions(options) || "", cmd = `bun ${watchFlag} ${path} ${opts}`.trimEnd(), pantryNodePath = p.projectPath("pantry"), existingNodePath = process.env.NODE_PATH, nodePath = existingNodePath ? `${pantryNodePath}:${existingNodePath}` : pantryNodePath, shouldInherit = options?.verbose || isDevAction && !options?.quiet, optionsWithCwd = {
73
+ const isDevAction = action.startsWith("dev/"), watchFlag = isDevAction ? "--watch" : "", developmentCondition = developmentConditionForProject(p.projectPath()), opts = isDevAction ? "" : buddyOptions(options) || "", cmd = ["bun", developmentCondition, watchFlag, path, opts].filter(Boolean).join(" "), pantryNodePath = p.projectPath("pantry"), existingNodePath = process.env.NODE_PATH, nodePath = existingNodePath ? `${pantryNodePath}:${existingNodePath}` : pantryNodePath, shouldInherit = options?.verbose || isDevAction && !options?.quiet, optionsWithCwd = {
71
74
  cwd: options?.cwd || p.projectPath(),
72
75
  ...options,
73
76
  stdout: shouldInherit ? "inherit" : void 0,
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.95",
5
+ "version": "0.70.97",
6
6
  "description": "The Stacks actions.",
7
7
  "author": "Chris Breuer",
8
8
  "contributors": [
@@ -69,23 +69,23 @@
69
69
  "@stacksjs/ts-md": "^0.1.1"
70
70
  },
71
71
  "devDependencies": {
72
- "@stacksjs/api": "0.70.95",
73
- "@stacksjs/cli": "0.70.95",
74
- "@stacksjs/config": "0.70.95",
75
- "@stacksjs/database": "0.70.95",
72
+ "@stacksjs/api": "0.70.97",
73
+ "@stacksjs/cli": "0.70.97",
74
+ "@stacksjs/config": "0.70.97",
75
+ "@stacksjs/database": "0.70.97",
76
76
  "@stacksjs/tlsx": "^0.13.2",
77
77
  "better-dx": "^0.2.16",
78
- "@stacksjs/dns": "0.70.95",
79
- "@stacksjs/enums": "0.70.95",
80
- "@stacksjs/env": "0.70.95",
81
- "@stacksjs/error-handling": "0.70.95",
82
- "@stacksjs/logging": "0.70.95",
83
- "@stacksjs/path": "0.70.95",
84
- "@stacksjs/security": "0.70.95",
85
- "@stacksjs/storage": "0.70.95",
86
- "@stacksjs/strings": "0.70.95",
87
- "@stacksjs/utils": "0.70.95",
88
- "@stacksjs/validation": "0.70.95"
78
+ "@stacksjs/dns": "0.70.97",
79
+ "@stacksjs/enums": "0.70.97",
80
+ "@stacksjs/env": "0.70.97",
81
+ "@stacksjs/error-handling": "0.70.97",
82
+ "@stacksjs/logging": "0.70.97",
83
+ "@stacksjs/path": "0.70.97",
84
+ "@stacksjs/security": "0.70.97",
85
+ "@stacksjs/storage": "0.70.97",
86
+ "@stacksjs/strings": "0.70.97",
87
+ "@stacksjs/utils": "0.70.97",
88
+ "@stacksjs/validation": "0.70.97"
89
89
  },
90
90
  "peerDependencies": {
91
91
  "pickier": "^0.1.28"