flowdular 0.1.0 → 0.2.1
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/README.md +68 -12
- package/assets/flowdular-banner.png +0 -0
- package/dist/distribution.js +30 -48
- package/dist/index.js +591 -281
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -1,30 +1,86 @@
|
|
|
1
|
+
[](https://flowdular.com)
|
|
2
|
+
|
|
1
3
|
# Flowdular CLI
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/flowdular)
|
|
6
|
+
[](https://nodejs.org/)
|
|
7
|
+
[](https://github.com/Flowdular/flowdular/blob/main/LICENSE)
|
|
8
|
+
|
|
9
|
+
Inspect, configure and extend a Flowdular application from your terminal. The CLI manages module validation, source installation, generated composition and workspace diagnostics.
|
|
10
|
+
|
|
11
|
+
## Quick start
|
|
12
|
+
|
|
13
|
+
Use Node.js **22.22.2 or newer**. Create a configured pnpm workspace:
|
|
5
14
|
|
|
6
15
|
```sh
|
|
7
16
|
npm create flowdular@latest my-app
|
|
8
17
|
cd my-app
|
|
9
18
|
pnpm flowdular doctor
|
|
19
|
+
pnpm flowdular help
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
The generator includes the CLI. To add it to an existing Flowdular workspace:
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
pnpm add -Dw flowdular
|
|
10
26
|
```
|
|
11
27
|
|
|
12
|
-
The
|
|
13
|
-
|
|
14
|
-
|
|
28
|
+
The executable is `flowdular`; `fd` is also available as an alias. Run commands from your application workspace.
|
|
29
|
+
|
|
30
|
+
## Everyday commands
|
|
31
|
+
|
|
32
|
+
| Command | Purpose |
|
|
33
|
+
| ----------------------------------------- | ----------------------------------------------- |
|
|
34
|
+
| `pnpm flowdular doctor` | Inspect workspace configuration and diagnostics |
|
|
35
|
+
| `pnpm flowdular help` | List commands and supported flags |
|
|
36
|
+
| `pnpm flowdular module search` | Browse the configured source catalog |
|
|
37
|
+
| `pnpm flowdular module install <id>` | Preview a source installation |
|
|
38
|
+
| `pnpm flowdular module sync --apply` | Regenerate application composition |
|
|
39
|
+
| `pnpm flowdular module validate --locked` | Validate modules against the installation lock |
|
|
40
|
+
|
|
41
|
+
## Install a business module
|
|
42
|
+
|
|
43
|
+
For a catalog containing `expenses.core`:
|
|
15
44
|
|
|
16
45
|
```sh
|
|
17
|
-
|
|
46
|
+
# Inspect the planned source installation.
|
|
18
47
|
pnpm flowdular module install expenses.core
|
|
48
|
+
|
|
49
|
+
# Download and unpack the module source.
|
|
19
50
|
pnpm flowdular module install expenses.core --apply
|
|
51
|
+
|
|
52
|
+
# Enable the module and grant its scopes in the configured application.
|
|
20
53
|
pnpm flowdular module enable expenses.core --apply
|
|
54
|
+
|
|
55
|
+
# Check the installed modules against their lock.
|
|
21
56
|
pnpm flowdular module validate --locked
|
|
22
57
|
```
|
|
23
58
|
|
|
24
|
-
Source installation previews by default and
|
|
25
|
-
|
|
26
|
-
an
|
|
27
|
-
|
|
59
|
+
Source installation previews by default. Applying it writes source under `modules/`; activation is a separate step. Enabling a module updates application composition and can grant scopes against the configured database.
|
|
60
|
+
|
|
61
|
+
[Official Modules](https://github.com/Flowdular/official-modules) requires repository access while private. For an accessible local catalog, pass `--registry /absolute/path/to/index.json` to the search or install command. Catalog availability is independent of npm package installation.
|
|
62
|
+
|
|
63
|
+
## Automation
|
|
64
|
+
|
|
65
|
+
Release tooling can import the source distribution API through `flowdular/distribution`. Command permissions and apply requirements are documented in the [CLI guide](https://github.com/Flowdular/flowdular/blob/main/docs/cli.md).
|
|
66
|
+
|
|
67
|
+
## Packages and support
|
|
68
|
+
|
|
69
|
+
- [@flowdular/sdk](https://www.npmjs.com/package/@flowdular/sdk): shared platform APIs, UI and core modules.
|
|
70
|
+
- [create-flowdular](https://www.npmjs.com/package/create-flowdular): application generator.
|
|
71
|
+
- [Documentation](https://github.com/Flowdular/flowdular/tree/main/docs) · [Source and issues](https://github.com/Flowdular/flowdular) · [Website](https://flowdular.com)
|
|
72
|
+
|
|
73
|
+
Licensed under MIT. Repository documentation and source require repository access while the repositories are private.
|
|
74
|
+
|
|
75
|
+
## Interactive setup
|
|
76
|
+
|
|
77
|
+
Run `pnpm flowdular setup` in a terminal. The wizard offers a local demo, existing
|
|
78
|
+
PostgreSQL connection settings, or a configuration check. Local resets require
|
|
79
|
+
confirmation and a stopped application; custom or hosted databases are refused.
|
|
80
|
+
PostgreSQL URLs are masked and saved to `.env` with TLS verification; this does
|
|
81
|
+
not initialize, reset or connect to the hosted database.
|
|
28
82
|
|
|
29
|
-
|
|
30
|
-
`
|
|
83
|
+
Without an interactive terminal, `setup` remains a configuration check. Use
|
|
84
|
+
`setup check --json` for machine-readable results and
|
|
85
|
+
`setup quick --apply --confirm reset-local-auth` for an explicitly authorized
|
|
86
|
+
local reset in a script. Ctrl+C or declining confirmation leaves data unchanged.
|
|
Binary file
|
package/dist/distribution.js
CHANGED
|
@@ -5,7 +5,11 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __commonJS = (cb, mod) => function __require() {
|
|
8
|
-
|
|
8
|
+
try {
|
|
9
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
+
} catch (e) {
|
|
11
|
+
throw mod = 0, e;
|
|
12
|
+
}
|
|
9
13
|
};
|
|
10
14
|
var __copyProps = (to, from, except, desc) => {
|
|
11
15
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
@@ -2557,10 +2561,7 @@ var project_schema_default = {
|
|
|
2557
2561
|
specs: {
|
|
2558
2562
|
type: "object",
|
|
2559
2563
|
additionalProperties: false,
|
|
2560
|
-
required: [
|
|
2561
|
-
"platformRoot",
|
|
2562
|
-
"moduleDirectory"
|
|
2563
|
-
],
|
|
2564
|
+
required: ["platformRoot", "moduleDirectory"],
|
|
2564
2565
|
properties: {
|
|
2565
2566
|
platformRoot: {
|
|
2566
2567
|
type: "string",
|
|
@@ -2575,10 +2576,7 @@ var project_schema_default = {
|
|
|
2575
2576
|
modules: {
|
|
2576
2577
|
type: "object",
|
|
2577
2578
|
additionalProperties: false,
|
|
2578
|
-
required: [
|
|
2579
|
-
"roots",
|
|
2580
|
-
"enabled"
|
|
2581
|
-
],
|
|
2579
|
+
required: ["roots", "enabled"],
|
|
2582
2580
|
properties: {
|
|
2583
2581
|
roots: {
|
|
2584
2582
|
type: "array",
|
|
@@ -2611,11 +2609,7 @@ var project_schema_default = {
|
|
|
2611
2609
|
agent: {
|
|
2612
2610
|
type: "object",
|
|
2613
2611
|
additionalProperties: false,
|
|
2614
|
-
required: [
|
|
2615
|
-
"policy",
|
|
2616
|
-
"blueprints",
|
|
2617
|
-
"modelRouting"
|
|
2618
|
-
],
|
|
2612
|
+
required: ["policy", "blueprints", "modelRouting"],
|
|
2619
2613
|
properties: {
|
|
2620
2614
|
policy: {
|
|
2621
2615
|
type: "string",
|
|
@@ -2667,17 +2661,10 @@ var project_schema_default = {
|
|
|
2667
2661
|
$ref: "#/$defs/gitName"
|
|
2668
2662
|
},
|
|
2669
2663
|
provider: {
|
|
2670
|
-
enum: [
|
|
2671
|
-
"github",
|
|
2672
|
-
"none"
|
|
2673
|
-
]
|
|
2664
|
+
enum: ["github", "none"]
|
|
2674
2665
|
},
|
|
2675
2666
|
mode: {
|
|
2676
|
-
enum: [
|
|
2677
|
-
"auto",
|
|
2678
|
-
"direct",
|
|
2679
|
-
"fork"
|
|
2680
|
-
]
|
|
2667
|
+
enum: ["auto", "direct", "fork"]
|
|
2681
2668
|
},
|
|
2682
2669
|
forkOwner: {
|
|
2683
2670
|
$ref: "#/$defs/githubAccount"
|
|
@@ -2703,9 +2690,7 @@ var project_schema_default = {
|
|
|
2703
2690
|
web: {
|
|
2704
2691
|
type: "object",
|
|
2705
2692
|
additionalProperties: false,
|
|
2706
|
-
required: [
|
|
2707
|
-
"mounts"
|
|
2708
|
-
],
|
|
2693
|
+
required: ["mounts"],
|
|
2709
2694
|
properties: {
|
|
2710
2695
|
mounts: {
|
|
2711
2696
|
type: "array",
|
|
@@ -2713,13 +2698,7 @@ var project_schema_default = {
|
|
|
2713
2698
|
items: {
|
|
2714
2699
|
type: "object",
|
|
2715
2700
|
additionalProperties: false,
|
|
2716
|
-
required: [
|
|
2717
|
-
"id",
|
|
2718
|
-
"moduleId",
|
|
2719
|
-
"surfaceId",
|
|
2720
|
-
"path",
|
|
2721
|
-
"tenantId"
|
|
2722
|
-
],
|
|
2701
|
+
required: ["id", "moduleId", "surfaceId", "path", "tenantId"],
|
|
2723
2702
|
properties: {
|
|
2724
2703
|
id: {
|
|
2725
2704
|
type: "string",
|
|
@@ -2754,9 +2733,7 @@ var project_schema_default = {
|
|
|
2754
2733
|
application: {
|
|
2755
2734
|
type: "object",
|
|
2756
2735
|
additionalProperties: false,
|
|
2757
|
-
required: [
|
|
2758
|
-
"path"
|
|
2759
|
-
],
|
|
2736
|
+
required: ["path"],
|
|
2760
2737
|
properties: {
|
|
2761
2738
|
path: {
|
|
2762
2739
|
type: "string",
|
|
@@ -2770,20 +2747,21 @@ var project_schema_default = {
|
|
|
2770
2747
|
"/sign-up",
|
|
2771
2748
|
"/forgot-password",
|
|
2772
2749
|
"/reset-password",
|
|
2773
|
-
"/accept-invitation"
|
|
2750
|
+
"/accept-invitation",
|
|
2751
|
+
"/setup",
|
|
2752
|
+
"/health",
|
|
2753
|
+
"/ready",
|
|
2754
|
+
"/assets"
|
|
2774
2755
|
]
|
|
2775
|
-
}
|
|
2756
|
+
},
|
|
2757
|
+
maxLength: 64
|
|
2776
2758
|
}
|
|
2777
2759
|
}
|
|
2778
2760
|
}
|
|
2779
2761
|
},
|
|
2780
2762
|
$defs: {
|
|
2781
2763
|
deliveryTarget: {
|
|
2782
|
-
enum: [
|
|
2783
|
-
"workspace",
|
|
2784
|
-
"git-pr",
|
|
2785
|
-
"official-modules"
|
|
2786
|
-
]
|
|
2764
|
+
enum: ["workspace", "git-pr", "official-modules"]
|
|
2787
2765
|
},
|
|
2788
2766
|
gitName: {
|
|
2789
2767
|
type: "string",
|
|
@@ -3005,6 +2983,7 @@ var ModuleDistributionError = class extends Error {
|
|
|
3005
2983
|
super(message);
|
|
3006
2984
|
this.code = code;
|
|
3007
2985
|
}
|
|
2986
|
+
code;
|
|
3008
2987
|
};
|
|
3009
2988
|
function distributionAssert(condition, code, message) {
|
|
3010
2989
|
if (!condition) throw new ModuleDistributionError(code, message);
|
|
@@ -3426,7 +3405,7 @@ import { dirname as dirname6, join as join6, relative as relative5 } from "node:
|
|
|
3426
3405
|
import { createRequire } from "node:module";
|
|
3427
3406
|
import { readFile as readFile5 } from "node:fs/promises";
|
|
3428
3407
|
import { dirname as dirname4, join as join3 } from "node:path";
|
|
3429
|
-
var SDK_VERSION = "0.1
|
|
3408
|
+
var SDK_VERSION = "0.2.1";
|
|
3430
3409
|
function npmPackage(specifier) {
|
|
3431
3410
|
return specifier.startsWith("@") ? specifier.split("/").slice(0, 2).join("/") : specifier.split("/")[0];
|
|
3432
3411
|
}
|
|
@@ -4285,9 +4264,10 @@ function generateServerComposition(modules, sdk = false, mounts = [], applicatio
|
|
|
4285
4264
|
PlatformServerComposition,
|
|
4286
4265
|
PlatformServerContext,
|
|
4287
4266
|
} from '${sdk ? "@flowdular/sdk/modules/auth" : "@flowdular/module-auth"}/server';
|
|
4267
|
+
import type { WebMount } from '${sdk ? "@flowdular/sdk/server" : "@flowdular/server"}';
|
|
4288
4268
|
`;
|
|
4289
4269
|
if (server.length === 0) {
|
|
4290
|
-
return GENERATED_HEADER + typeImport + "\nexport function composeModuleServer(\n _context: PlatformServerContext,\n): readonly PlatformServerComposition[] {\n return [];\n}\n\nexport const moduleWebMounts = " + JSON.stringify(mounts) + " as const;\nexport const applicationBasePath = " + JSON.stringify(applicationPath) + ";\n";
|
|
4270
|
+
return GENERATED_HEADER + typeImport + "\nexport function composeModuleServer(\n _context: PlatformServerContext,\n): readonly PlatformServerComposition[] {\n return [];\n}\n\nexport const moduleWebMounts: readonly WebMount[] = " + JSON.stringify(mounts) + " as const;\nexport const applicationBasePath = " + JSON.stringify(applicationPath) + ";\n";
|
|
4291
4271
|
}
|
|
4292
4272
|
const imports = server.map(
|
|
4293
4273
|
(module) => platformImport(module.id, module.package, "createServerComposition")
|
|
@@ -4298,7 +4278,7 @@ function generateServerComposition(modules, sdk = false, mounts = [], applicatio
|
|
|
4298
4278
|
agentDefinitions: context.agentDefinitions.forModule('${module.id}'),
|
|
4299
4279
|
}), moduleId: '${module.id}' },`
|
|
4300
4280
|
).join("\n");
|
|
4301
|
-
return GENERATED_HEADER + typeImport + imports + "\n\nexport function composeModuleServer(\n context: PlatformServerContext,\n): readonly PlatformServerComposition[] {\n return [\n" + calls + "\n ];\n}\n\nexport const moduleWebMounts = " + JSON.stringify(mounts) + " as const;\nexport const applicationBasePath = " + JSON.stringify(applicationPath) + ";\n";
|
|
4281
|
+
return GENERATED_HEADER + typeImport + imports + "\n\nexport function composeModuleServer(\n context: PlatformServerContext,\n): readonly PlatformServerComposition[] {\n return [\n" + calls + "\n ];\n}\n\nexport const moduleWebMounts: readonly WebMount[] = " + JSON.stringify(mounts) + " as const;\nexport const applicationBasePath = " + JSON.stringify(applicationPath) + ";\n";
|
|
4302
4282
|
}
|
|
4303
4283
|
function generateClientComposition(modules, sdk = false, applicationPath = "/app") {
|
|
4304
4284
|
const client = modules.filter((module) => module.client);
|
|
@@ -4425,7 +4405,8 @@ async function restoreSnapshots(snapshots) {
|
|
|
4425
4405
|
async function syncPlatformModules(workspace, apply, enabledOverride) {
|
|
4426
4406
|
if (workspace.config.web !== void 0 && !validators.web(workspace.config.web))
|
|
4427
4407
|
throw new Error("Invalid web mount configuration in flowdular.json.");
|
|
4428
|
-
if (workspace.config.application !== void 0 && !validators.application(workspace.config.application))
|
|
4408
|
+
if (workspace.config.application !== void 0 && !validators.application(workspace.config.application))
|
|
4409
|
+
throw new Error("Invalid application path in flowdular.json.");
|
|
4429
4410
|
const applicationPath = workspace.config.application?.path ?? "/app";
|
|
4430
4411
|
const enabled = enabledOverride ?? enabledModules(workspace);
|
|
4431
4412
|
const sdk = (await sdkModules(workspace)).size > 0;
|
|
@@ -4438,7 +4419,8 @@ async function syncPlatformModules(workspace, apply, enabledOverride) {
|
|
|
4438
4419
|
content: generateServerComposition(
|
|
4439
4420
|
modules,
|
|
4440
4421
|
sdk,
|
|
4441
|
-
workspace.config.web?.mounts ?? []
|
|
4422
|
+
workspace.config.web?.mounts ?? [],
|
|
4423
|
+
applicationPath
|
|
4442
4424
|
)
|
|
4443
4425
|
},
|
|
4444
4426
|
{
|