Skip to content

Commit 2c74ed5

Browse files
committed
feat: allow nameless execs with a namespace defined
1 parent 3fcaef8 commit 2c74ed5

File tree

14 files changed

+19
-29
lines changed

14 files changed

+19
-29
lines changed

.execs/build.flow

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ executables:
8080
else
8181
echo "npm dependencies already installed"
8282
fi
83-
npm run generate-types
83+
npm run generate-ts
8484

8585
- verb: generate
8686
name: backend

.execs/desktop.flow

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# yaml-language-server: $schema=https://flowexec.io/schemas/flowfile_schema.json
2+
namespace: desktop
23
imports: ["../desktop/package.json"]

.execs/setup.flow

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,6 @@ executables:
1818
dir: //
1919
cmd: go install ./...
2020

21-
- verb: install
22-
name: npm
23-
aliases: [node, modules]
24-
tags: [npm, desktop]
25-
exec:
26-
dir: //desktop
27-
cmd: npm install
28-
2921
- verb: start
3022
name: site
3123
aliases: [docs]

cmd/internal/exec.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ flow install
418418
419419
**Execute a nameless flow in the 'ws' workspace with the 'test' verb**
420420
421-
flow test ws
421+
flow test ws/
422422
423423
**Execute the 'build' flow in the current workspace and namespace**
424424

desktop/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
"type": "module",
66
"scripts": {
77
"dev": "vite",
8-
"start-desktop": "tauri dev",
9-
"build-desktop": "tsc && vite build",
10-
"lint-ts": "npx eslint src",
11-
"lint-ts:fix": "npx eslint src --fix",
8+
"start": "tauri dev",
9+
"build": "tsc && vite build",
10+
"lint": "npx eslint src",
11+
"lint:fix": "npx eslint src --fix",
1212
"prettier": "npx prettier src --check",
1313
"prettier:fix": "npx prettier src --write",
1414
"storybook": "storybook dev -p 6006",
1515
"build-storybook": "storybook build",
16-
"generate-types": "tsx scripts/generate-ts-types.ts"
16+
"generate-ts": "tsx scripts/generate-ts-types.ts"
1717
},
1818
"dependencies": {
1919
"@mantine/core": "^8.0.2",

desktop/src-tauri/src/types/generated/flowfile.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ impl ::std::default::Default for CommonVisibility {
228228
#[doc = " \"$ref\": \"#/definitions/ExecutableLaunchExecutableType\""]
229229
#[doc = " },"]
230230
#[doc = " \"name\": {"]
231-
#[doc = " \"description\": \"The name of the executable.\\n\\nName is used to reference the executable in the CLI using the format `workspace/namespace:name`.\\n[Verb group + Name] must be unique within the namespace of the workspace.\\nName is required if the executable is defined within a namespace.\\n\","]
231+
#[doc = " \"description\": \"An optional name for the executable.\\n\\nName is used to reference the executable in the CLI using the format `workspace/namespace:name`.\\n[Verb group + Name] must be unique within the namespace of the workspace.\\n\","]
232232
#[doc = " \"default\": \"\","]
233233
#[doc = " \"type\": \"string\""]
234234
#[doc = " },"]
@@ -282,7 +282,7 @@ pub struct Executable {
282282
pub exec: ::std::option::Option<ExecutableExecExecutableType>,
283283
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
284284
pub launch: ::std::option::Option<ExecutableLaunchExecutableType>,
285-
#[doc = "The name of the executable.\n\nName is used to reference the executable in the CLI using the format `workspace/namespace:name`.\n[Verb group + Name] must be unique within the namespace of the workspace.\nName is required if the executable is defined within a namespace.\n"]
285+
#[doc = "An optional name for the executable.\n\nName is used to reference the executable in the CLI using the format `workspace/namespace:name`.\n[Verb group + Name] must be unique within the namespace of the workspace.\n"]
286286
#[serde(default)]
287287
pub name: ::std::string::String,
288288
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]

desktop/src/types/generated/flowfile.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,10 @@ export interface Executable {
100100
exec?: ExecutableExecExecutableType;
101101
launch?: ExecutableLaunchExecutableType;
102102
/**
103-
* The name of the executable.
103+
* An optional name for the executable.
104104
*
105105
* Name is used to reference the executable in the CLI using the format `workspace/namespace:name`.
106106
* [Verb group + Name] must be unique within the namespace of the workspace.
107-
* Name is required if the executable is defined within a namespace.
108107
*
109108
*/
110109
name?: string;

docs/cli/flow_exec.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ flow install
2222

2323
**Execute a nameless flow in the 'ws' workspace with the 'test' verb**
2424

25-
flow test ws
25+
flow test ws/
2626

2727
**Execute the 'build' flow in the current workspace and namespace**
2828

docs/schemas/flowfile_schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"$ref": "#/definitions/ExecutableLaunchExecutableType"
5555
},
5656
"name": {
57-
"description": "The name of the executable.\n\nName is used to reference the executable in the CLI using the format `workspace/namespace:name`.\n[Verb group + Name] must be unique within the namespace of the workspace.\nName is required if the executable is defined within a namespace.\n",
57+
"description": "An optional name for the executable.\n\nName is used to reference the executable in the CLI using the format `workspace/namespace:name`.\n[Verb group + Name] must be unique within the namespace of the workspace.\n",
5858
"type": "string",
5959
"default": ""
6060
},

docs/types/flowfile.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Executables are the building blocks of workflows and are used to define the acti
8585
| `description` | A description of the executable. This description is rendered as markdown in the interactive UI. | `string` | | |
8686
| `exec` | | [ExecutableExecExecutableType](#ExecutableExecExecutableType) | <no value> | |
8787
| `launch` | | [ExecutableLaunchExecutableType](#ExecutableLaunchExecutableType) | <no value> | |
88-
| `name` | The name of the executable. Name is used to reference the executable in the CLI using the format `workspace/namespace:name`. [Verb group + Name] must be unique within the namespace of the workspace. Name is required if the executable is defined within a namespace. | `string` | | |
88+
| `name` | An optional name for the executable. Name is used to reference the executable in the CLI using the format `workspace/namespace:name`. [Verb group + Name] must be unique within the namespace of the workspace. | `string` | | |
8989
| `parallel` | | [ExecutableParallelExecutableType](#ExecutableParallelExecutableType) | <no value> | |
9090
| `render` | | [ExecutableRenderExecutableType](#ExecutableRenderExecutableType) | <no value> | |
9191
| `request` | | [ExecutableRequestExecutableType](#ExecutableRequestExecutableType) | <no value> | |

0 commit comments

Comments
 (0)