@fnet/cli 0.4.5 → 0.4.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/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -16,12 +16,18 @@
|
|
|
16
16
|
|
|
17
17
|
## Overview
|
|
18
18
|
|
|
19
|
-
Flownet is a
|
|
19
|
+
Flownet is a low-level flow framework that separates **Core** (your business logic) from **Layers** (infrastructure, dev, build, runtime, and delivery). This separation allows developers to focus on functional code while Flownet automates the surrounding infrastructure. The `@fnet/cli` package provides command-line tools to create, build, and manage Flownet projects.
|
|
20
|
+
|
|
21
|
+
Flownet provides primitives for composing workflows similar to how React provides components for UI development. It emphasizes a **schema-first approach** with **deterministic core**, enabling **multi-runtime portability**.
|
|
20
22
|
|
|
21
23
|
### Key Features
|
|
22
24
|
|
|
25
|
+
- **Core vs Layers Architecture**: Separate your business logic (Core) from infrastructure (Layers) for cleaner, more maintainable code
|
|
26
|
+
- **Nodes & Flows**: Reusable functional units (Nodes) with explicit I/O schemas, orchestrated by Flows
|
|
27
|
+
- **I/O Contracts**: Schema-first contracts define clear input/output expectations for deterministic behavior
|
|
28
|
+
- **Automatic Dependency Detection**: Simplified dependency management across your project
|
|
29
|
+
- **Multi-Runtime Support**: Deploy to Node.js, Bun, Deno, or Python - choose the best runtime for each task
|
|
23
30
|
- **Language Agnostic**: Support for multiple programming languages (JavaScript, Python) in the same project
|
|
24
|
-
- **Runtime Flexibility**: Choose the best runtime for each task (Node.js, Python, Bun)
|
|
25
31
|
- **Unified Interface**: Consistent commands across different project types
|
|
26
32
|
- **Tag-Based Configuration**: Powerful conditional configuration with `--ftag` parameter
|
|
27
33
|
- **Isolated Workspace**: All build artifacts and dependencies are kept in `.workspace` directory
|
|
@@ -97,54 +103,95 @@ fbin list
|
|
|
97
103
|
fbin uninstall awesome-tool --yes
|
|
98
104
|
```
|
|
99
105
|
|
|
106
|
+
## Core Concepts
|
|
107
|
+
|
|
108
|
+
### Nodes & Flows
|
|
109
|
+
|
|
110
|
+
**Nodes** are reusable functional units that encapsulate business logic with explicit input/output schemas. Each Node:
|
|
111
|
+
|
|
112
|
+
- Has a deterministic, pure function at its core
|
|
113
|
+
- Defines clear I/O contracts (input and output schemas)
|
|
114
|
+
- Can be composed and reused across different Flows
|
|
115
|
+
- Supports automatic dependency detection
|
|
116
|
+
|
|
117
|
+
**Flows** orchestrate Nodes and sub-Flows to create complex workflows. Flows:
|
|
118
|
+
|
|
119
|
+
- Connect multiple Nodes with explicit data contracts
|
|
120
|
+
- Enable multi-runtime portability through schema-first design
|
|
121
|
+
- Support complex data transformations and conditional logic
|
|
122
|
+
- Maintain deterministic behavior across different runtimes
|
|
123
|
+
|
|
124
|
+
### I/O Contracts
|
|
125
|
+
|
|
126
|
+
Flownet uses schema-first contracts to define clear input and output expectations. This approach:
|
|
127
|
+
|
|
128
|
+
- Ensures deterministic behavior across different runtimes
|
|
129
|
+
- Enables automatic validation and type checking
|
|
130
|
+
- Facilitates multi-runtime portability
|
|
131
|
+
- Improves code clarity and maintainability
|
|
132
|
+
|
|
100
133
|
## Project Types
|
|
101
134
|
|
|
102
135
|
Flownet supports two main project types:
|
|
103
136
|
|
|
104
137
|
### fnode Project
|
|
105
138
|
|
|
106
|
-
An **fnode project** (Flow Node Project) is a classic/node-style project that focuses on creating reusable
|
|
139
|
+
An **fnode project** (Flow Node Project) is a classic/node-style project that focuses on creating reusable Nodes or standalone applications. These projects:
|
|
107
140
|
|
|
108
141
|
- Use `fnode.yaml` as their configuration file
|
|
109
142
|
- Typically contain a single code file in the `src` directory
|
|
110
143
|
- Can be built with different runtimes (Node.js, Python, Bun)
|
|
111
144
|
- Support multiple programming languages simultaneously
|
|
145
|
+
- Ideal for creating reusable components with explicit I/O contracts
|
|
112
146
|
|
|
113
147
|
### fnet Project
|
|
114
148
|
|
|
115
|
-
An **fnet project** (Flow Project) is a workflow-oriented project that focuses on orchestrating multiple
|
|
149
|
+
An **fnet project** (Flow Project) is a workflow-oriented project that focuses on orchestrating multiple Nodes and Flows. These projects:
|
|
116
150
|
|
|
117
151
|
- Use `fnet.yaml` as their configuration file
|
|
118
|
-
- Define workflows that connect multiple
|
|
152
|
+
- Define workflows that connect multiple Nodes and sub-Flows
|
|
119
153
|
- Support complex data flows and transformations
|
|
154
|
+
- Enable multi-runtime deployment strategies
|
|
155
|
+
- Ideal for building complex business logic orchestrations
|
|
120
156
|
|
|
121
157
|
## CLI Tools
|
|
122
158
|
|
|
123
|
-
Flownet provides
|
|
159
|
+
Flownet provides five main CLI tools:
|
|
124
160
|
|
|
125
|
-
- **`fnode`**: For Node/classic projects (uses `fnode.yaml`)
|
|
126
|
-
- **`fnet`**: For Workflow projects (uses `fnet.yaml`)
|
|
161
|
+
- **`fnode`**: For Node/classic projects (uses `fnode.yaml`) - create and manage reusable Nodes
|
|
162
|
+
- **`fnet`**: For Workflow projects (uses `fnet.yaml`) - create and manage Flows that orchestrate Nodes
|
|
127
163
|
- **`frun`**: Unified interface that works with both project types (auto-detects project file)
|
|
128
164
|
- **`fbin`**: Binary management system for installing, compiling, and managing CLI tools
|
|
165
|
+
- **`fservice`**: Service management for deploying and running Flownet applications
|
|
129
166
|
|
|
130
|
-
## Multi-Language Support
|
|
167
|
+
## Multi-Language & Multi-Runtime Support
|
|
131
168
|
|
|
132
|
-
Flownet supports multiple programming languages simultaneously within the same project:
|
|
169
|
+
Flownet supports multiple programming languages and runtimes simultaneously within the same project:
|
|
133
170
|
|
|
134
171
|
```text
|
|
135
172
|
my-project/
|
|
136
173
|
├── src/
|
|
137
|
-
│ ├── index.js # JavaScript implementation (used by
|
|
174
|
+
│ ├── index.js # JavaScript implementation (used by Node.js and Bun)
|
|
138
175
|
│ └── index.py # Python implementation
|
|
139
176
|
├── fnode.yaml # Project configuration file
|
|
140
177
|
└── .workspace/ # Build infrastructure (managed by CLI)
|
|
141
178
|
```
|
|
142
179
|
|
|
143
|
-
|
|
180
|
+
### Supported Runtimes
|
|
181
|
+
|
|
182
|
+
- **Node.js**: JavaScript/TypeScript execution with full npm ecosystem support
|
|
183
|
+
- **Bun**: Fast JavaScript runtime with improved performance
|
|
184
|
+
- **Deno**: Secure JavaScript/TypeScript runtime with built-in tooling
|
|
185
|
+
- **Python**: Python 3.x for data processing and scientific computing
|
|
186
|
+
|
|
187
|
+
### Multi-Runtime Portability
|
|
188
|
+
|
|
189
|
+
Thanks to Flownet's schema-first approach and deterministic core:
|
|
144
190
|
|
|
145
|
-
- Write your core logic once and
|
|
146
|
-
- Choose the best
|
|
147
|
-
-
|
|
191
|
+
- Write your core logic once and deploy to multiple runtimes
|
|
192
|
+
- Choose the best runtime for each specific use case
|
|
193
|
+
- Migrate between runtimes without changing your business logic
|
|
194
|
+
- Use JavaScript with Node.js for quick development, Python for data processing, and Bun for improved performance
|
|
148
195
|
|
|
149
196
|
## Tag-Based Configuration
|
|
150
197
|
|