flowdular 0.1.0 → 0.2.0
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 +55 -12
- package/assets/flowdular-banner.png +0 -0
- package/dist/distribution.js +30 -48
- package/dist/index.js +41 -51
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -1,30 +1,73 @@
|
|
|
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)
|
|
28
72
|
|
|
29
|
-
|
|
30
|
-
`flowdular/distribution`. See [Flowdular](https://github.com/Flowdular/flowdular).
|
|
73
|
+
Licensed under MIT. Repository documentation and source require repository access while the repositories are private.
|
|
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.
|
|
3408
|
+
var SDK_VERSION = "0.2.0";
|
|
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
|
{
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,11 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
8
|
var __commonJS = (cb, mod) => function __require() {
|
|
9
|
-
|
|
9
|
+
try {
|
|
10
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
11
|
+
} catch (e) {
|
|
12
|
+
throw mod = 0, e;
|
|
13
|
+
}
|
|
10
14
|
};
|
|
11
15
|
var __copyProps = (to, from, except, desc) => {
|
|
12
16
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
@@ -2619,10 +2623,7 @@ var project_schema_default = {
|
|
|
2619
2623
|
specs: {
|
|
2620
2624
|
type: "object",
|
|
2621
2625
|
additionalProperties: false,
|
|
2622
|
-
required: [
|
|
2623
|
-
"platformRoot",
|
|
2624
|
-
"moduleDirectory"
|
|
2625
|
-
],
|
|
2626
|
+
required: ["platformRoot", "moduleDirectory"],
|
|
2626
2627
|
properties: {
|
|
2627
2628
|
platformRoot: {
|
|
2628
2629
|
type: "string",
|
|
@@ -2637,10 +2638,7 @@ var project_schema_default = {
|
|
|
2637
2638
|
modules: {
|
|
2638
2639
|
type: "object",
|
|
2639
2640
|
additionalProperties: false,
|
|
2640
|
-
required: [
|
|
2641
|
-
"roots",
|
|
2642
|
-
"enabled"
|
|
2643
|
-
],
|
|
2641
|
+
required: ["roots", "enabled"],
|
|
2644
2642
|
properties: {
|
|
2645
2643
|
roots: {
|
|
2646
2644
|
type: "array",
|
|
@@ -2673,11 +2671,7 @@ var project_schema_default = {
|
|
|
2673
2671
|
agent: {
|
|
2674
2672
|
type: "object",
|
|
2675
2673
|
additionalProperties: false,
|
|
2676
|
-
required: [
|
|
2677
|
-
"policy",
|
|
2678
|
-
"blueprints",
|
|
2679
|
-
"modelRouting"
|
|
2680
|
-
],
|
|
2674
|
+
required: ["policy", "blueprints", "modelRouting"],
|
|
2681
2675
|
properties: {
|
|
2682
2676
|
policy: {
|
|
2683
2677
|
type: "string",
|
|
@@ -2729,17 +2723,10 @@ var project_schema_default = {
|
|
|
2729
2723
|
$ref: "#/$defs/gitName"
|
|
2730
2724
|
},
|
|
2731
2725
|
provider: {
|
|
2732
|
-
enum: [
|
|
2733
|
-
"github",
|
|
2734
|
-
"none"
|
|
2735
|
-
]
|
|
2726
|
+
enum: ["github", "none"]
|
|
2736
2727
|
},
|
|
2737
2728
|
mode: {
|
|
2738
|
-
enum: [
|
|
2739
|
-
"auto",
|
|
2740
|
-
"direct",
|
|
2741
|
-
"fork"
|
|
2742
|
-
]
|
|
2729
|
+
enum: ["auto", "direct", "fork"]
|
|
2743
2730
|
},
|
|
2744
2731
|
forkOwner: {
|
|
2745
2732
|
$ref: "#/$defs/githubAccount"
|
|
@@ -2765,9 +2752,7 @@ var project_schema_default = {
|
|
|
2765
2752
|
web: {
|
|
2766
2753
|
type: "object",
|
|
2767
2754
|
additionalProperties: false,
|
|
2768
|
-
required: [
|
|
2769
|
-
"mounts"
|
|
2770
|
-
],
|
|
2755
|
+
required: ["mounts"],
|
|
2771
2756
|
properties: {
|
|
2772
2757
|
mounts: {
|
|
2773
2758
|
type: "array",
|
|
@@ -2775,13 +2760,7 @@ var project_schema_default = {
|
|
|
2775
2760
|
items: {
|
|
2776
2761
|
type: "object",
|
|
2777
2762
|
additionalProperties: false,
|
|
2778
|
-
required: [
|
|
2779
|
-
"id",
|
|
2780
|
-
"moduleId",
|
|
2781
|
-
"surfaceId",
|
|
2782
|
-
"path",
|
|
2783
|
-
"tenantId"
|
|
2784
|
-
],
|
|
2763
|
+
required: ["id", "moduleId", "surfaceId", "path", "tenantId"],
|
|
2785
2764
|
properties: {
|
|
2786
2765
|
id: {
|
|
2787
2766
|
type: "string",
|
|
@@ -2816,9 +2795,7 @@ var project_schema_default = {
|
|
|
2816
2795
|
application: {
|
|
2817
2796
|
type: "object",
|
|
2818
2797
|
additionalProperties: false,
|
|
2819
|
-
required: [
|
|
2820
|
-
"path"
|
|
2821
|
-
],
|
|
2798
|
+
required: ["path"],
|
|
2822
2799
|
properties: {
|
|
2823
2800
|
path: {
|
|
2824
2801
|
type: "string",
|
|
@@ -2832,20 +2809,21 @@ var project_schema_default = {
|
|
|
2832
2809
|
"/sign-up",
|
|
2833
2810
|
"/forgot-password",
|
|
2834
2811
|
"/reset-password",
|
|
2835
|
-
"/accept-invitation"
|
|
2812
|
+
"/accept-invitation",
|
|
2813
|
+
"/setup",
|
|
2814
|
+
"/health",
|
|
2815
|
+
"/ready",
|
|
2816
|
+
"/assets"
|
|
2836
2817
|
]
|
|
2837
|
-
}
|
|
2818
|
+
},
|
|
2819
|
+
maxLength: 64
|
|
2838
2820
|
}
|
|
2839
2821
|
}
|
|
2840
2822
|
}
|
|
2841
2823
|
},
|
|
2842
2824
|
$defs: {
|
|
2843
2825
|
deliveryTarget: {
|
|
2844
|
-
enum: [
|
|
2845
|
-
"workspace",
|
|
2846
|
-
"git-pr",
|
|
2847
|
-
"official-modules"
|
|
2848
|
-
]
|
|
2826
|
+
enum: ["workspace", "git-pr", "official-modules"]
|
|
2849
2827
|
},
|
|
2850
2828
|
gitName: {
|
|
2851
2829
|
type: "string",
|
|
@@ -3145,6 +3123,7 @@ var ModuleDistributionError = class extends Error {
|
|
|
3145
3123
|
super(message);
|
|
3146
3124
|
this.code = code;
|
|
3147
3125
|
}
|
|
3126
|
+
code;
|
|
3148
3127
|
};
|
|
3149
3128
|
function distributionAssert(condition, code, message) {
|
|
3150
3129
|
if (!condition) throw new ModuleDistributionError(code, message);
|
|
@@ -3520,12 +3499,11 @@ import { dirname as dirname6, join as join5, relative as relative5 } from "node:
|
|
|
3520
3499
|
import { createRequire } from "node:module";
|
|
3521
3500
|
import { readFile as readFile4 } from "node:fs/promises";
|
|
3522
3501
|
import { dirname as dirname4, join as join2 } from "node:path";
|
|
3523
|
-
var SDK_VERSION = "0.
|
|
3502
|
+
var SDK_VERSION = "0.2.0";
|
|
3524
3503
|
var LIBRARIES = /* @__PURE__ */ new Set([
|
|
3525
3504
|
"ai-provider",
|
|
3526
3505
|
"cli-protocol",
|
|
3527
3506
|
"client",
|
|
3528
|
-
"coding-agent",
|
|
3529
3507
|
"contracts",
|
|
3530
3508
|
"database",
|
|
3531
3509
|
"database-pglite",
|
|
@@ -3533,7 +3511,6 @@ var LIBRARIES = /* @__PURE__ */ new Set([
|
|
|
3533
3511
|
"dev-console",
|
|
3534
3512
|
"harness",
|
|
3535
3513
|
"kernel",
|
|
3536
|
-
"sandbox",
|
|
3537
3514
|
"server",
|
|
3538
3515
|
"ui"
|
|
3539
3516
|
]);
|
|
@@ -4514,6 +4491,7 @@ var DatabaseError = class extends Error {
|
|
|
4514
4491
|
this.code = code;
|
|
4515
4492
|
this.name = "DatabaseError";
|
|
4516
4493
|
}
|
|
4494
|
+
code;
|
|
4517
4495
|
};
|
|
4518
4496
|
function assertStatement(statement) {
|
|
4519
4497
|
if (statement.text.trim().length === 0) {
|
|
@@ -4687,6 +4665,8 @@ var DatabaseMigrationError = class extends Error {
|
|
|
4687
4665
|
this.migrationId = migrationId;
|
|
4688
4666
|
this.name = "DatabaseMigrationError";
|
|
4689
4667
|
}
|
|
4668
|
+
code;
|
|
4669
|
+
migrationId;
|
|
4690
4670
|
};
|
|
4691
4671
|
function assertMigrationId(id) {
|
|
4692
4672
|
if (!/^[0-9]{4}_[a-z][a-z0-9_]{0,122}$/.test(id)) {
|
|
@@ -5030,6 +5010,9 @@ var PostgresSchemaIntrospector = class {
|
|
|
5030
5010
|
this.baseSignal = baseSignal;
|
|
5031
5011
|
this.ensureActive = ensureActive;
|
|
5032
5012
|
}
|
|
5013
|
+
client;
|
|
5014
|
+
baseSignal;
|
|
5015
|
+
ensureActive;
|
|
5033
5016
|
async hasTable(name, options = {}) {
|
|
5034
5017
|
this.ensureActive();
|
|
5035
5018
|
assertSchemaName(name);
|
|
@@ -5091,6 +5074,10 @@ var PostgresSession = class {
|
|
|
5091
5074
|
ensureActive
|
|
5092
5075
|
);
|
|
5093
5076
|
}
|
|
5077
|
+
client;
|
|
5078
|
+
baseSignal;
|
|
5079
|
+
ensureActive;
|
|
5080
|
+
capabilities;
|
|
5094
5081
|
adapterId = DATABASE_ADAPTER_IDS.postgresql;
|
|
5095
5082
|
dialectId = DATABASE_DIALECT_IDS.postgresql;
|
|
5096
5083
|
schema;
|
|
@@ -6352,9 +6339,10 @@ function generateServerComposition(modules, sdk = false, mounts = [], applicatio
|
|
|
6352
6339
|
PlatformServerComposition,
|
|
6353
6340
|
PlatformServerContext,
|
|
6354
6341
|
} from '${sdk ? "@flowdular/sdk/modules/auth" : "@flowdular/module-auth"}/server';
|
|
6342
|
+
import type { WebMount } from '${sdk ? "@flowdular/sdk/server" : "@flowdular/server"}';
|
|
6355
6343
|
`;
|
|
6356
6344
|
if (server.length === 0) {
|
|
6357
|
-
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";
|
|
6345
|
+
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";
|
|
6358
6346
|
}
|
|
6359
6347
|
const imports = server.map(
|
|
6360
6348
|
(module) => platformImport(module.id, module.package, "createServerComposition")
|
|
@@ -6365,7 +6353,7 @@ function generateServerComposition(modules, sdk = false, mounts = [], applicatio
|
|
|
6365
6353
|
agentDefinitions: context.agentDefinitions.forModule('${module.id}'),
|
|
6366
6354
|
}), moduleId: '${module.id}' },`
|
|
6367
6355
|
).join("\n");
|
|
6368
|
-
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";
|
|
6356
|
+
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";
|
|
6369
6357
|
}
|
|
6370
6358
|
function generateClientComposition(modules, sdk = false, applicationPath = "/app") {
|
|
6371
6359
|
const client = modules.filter((module) => module.client);
|
|
@@ -6492,7 +6480,8 @@ async function restoreSnapshots(snapshots) {
|
|
|
6492
6480
|
async function syncPlatformModules(workspace, apply, enabledOverride) {
|
|
6493
6481
|
if (workspace.config.web !== void 0 && !validators.web(workspace.config.web))
|
|
6494
6482
|
throw new Error("Invalid web mount configuration in flowdular.json.");
|
|
6495
|
-
if (workspace.config.application !== void 0 && !validators.application(workspace.config.application))
|
|
6483
|
+
if (workspace.config.application !== void 0 && !validators.application(workspace.config.application))
|
|
6484
|
+
throw new Error("Invalid application path in flowdular.json.");
|
|
6496
6485
|
const applicationPath = workspace.config.application?.path ?? "/app";
|
|
6497
6486
|
const enabled = enabledOverride ?? enabledModules(workspace);
|
|
6498
6487
|
const sdk = (await sdkModules(workspace)).size > 0;
|
|
@@ -6505,7 +6494,8 @@ async function syncPlatformModules(workspace, apply, enabledOverride) {
|
|
|
6505
6494
|
content: generateServerComposition(
|
|
6506
6495
|
modules,
|
|
6507
6496
|
sdk,
|
|
6508
|
-
workspace.config.web?.mounts ?? []
|
|
6497
|
+
workspace.config.web?.mounts ?? [],
|
|
6498
|
+
applicationPath
|
|
6509
6499
|
)
|
|
6510
6500
|
},
|
|
6511
6501
|
{
|
|
@@ -7549,7 +7539,7 @@ function packageJson(model) {
|
|
|
7549
7539
|
...hasClient ? { "@tsrx/typescript-plugin": "0.3.120" } : {},
|
|
7550
7540
|
"@types/node": "24.13.3",
|
|
7551
7541
|
typescript: "5.9.3",
|
|
7552
|
-
vitest: "4.1.
|
|
7542
|
+
vitest: "4.1.11"
|
|
7553
7543
|
}
|
|
7554
7544
|
});
|
|
7555
7545
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flowdular",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"flowdular": "./dist/index.js",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"ajv": "8.20.0",
|
|
16
16
|
"pg": "8.23.0",
|
|
17
17
|
"yaml": "2.9.0",
|
|
18
|
-
"@flowdular/sdk": "0.
|
|
18
|
+
"@flowdular/sdk": "0.2.0"
|
|
19
19
|
},
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"repository": {
|
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
"files": [
|
|
27
27
|
"dist",
|
|
28
28
|
"README.md",
|
|
29
|
-
"LICENSE"
|
|
29
|
+
"LICENSE",
|
|
30
|
+
"assets"
|
|
30
31
|
],
|
|
31
32
|
"publishConfig": {
|
|
32
33
|
"access": "public"
|