@fnet/cli 0.128.3 → 0.129.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/dist/fnet/index.C0YpfQ5j.js +1 -0
- package/dist/fnet/index.DkEl8VOr.js +1 -0
- package/dist/fnet/index.js +1 -1
- package/dist/fnode/index.AkoGqRzv.js +1 -0
- package/dist/fnode/{index.DBxLarjt.js → index.BTXKZRR5.js} +1 -1
- package/dist/fnode/index.CuZwF16z.js +1 -0
- package/dist/fnode/index.N_a5FdgA.js +1 -0
- package/dist/fnode/index.UNoFg95r.js +1 -0
- package/dist/fnode/{index.De_RsTV6.js → index.e2SSlEgE.js} +1 -1
- package/dist/fnode/index.js +1 -1
- package/package.json +1 -1
- package/template/fnet/core/object.js +1 -1
- package/template/fnet/node/package.json.njk +60 -47
- package/template/fnet/node/rollup.config.mjs.njk +4 -2
- package/template/fnet/node/src/app/index.js.njk +2 -2
- package/template/fnet/node/src/cli/index.js.njk +1 -1
- package/template/fnet/node/src/default/blocks/assign.js.njk +1 -0
- package/template/fnet/node/src/default/blocks/call.js.njk +15 -3
- package/template/fnet/node/src/default/blocks/for.js.njk +4 -2
- package/template/fnet/node/src/default/blocks/form.js.njk +4 -0
- package/template/fnet/node/src/default/blocks/modules.js.njk +2 -0
- package/template/fnet/node/src/default/blocks/new.js.njk +87 -0
- package/template/fnet/node/src/default/blocks/next.js.njk +2 -0
- package/template/fnet/node/src/default/blocks/raise.js.njk +2 -0
- package/template/fnet/node/src/default/blocks/return.js.njk +2 -0
- package/template/fnet/node/src/default/blocks/signal.js.njk +2 -0
- package/template/fnet/node/src/default/blocks/steps.js.njk +2 -1
- package/template/fnet/node/src/default/blocks/switch.js.njk +3 -2
- package/template/fnet/node/src/default/blocks/tryexcept.js.njk +5 -3
- package/template/fnet/node/src/default/blocks/wait.js.njk +1 -0
- package/template/fnet/node/src/default/engine.js.njk +2 -2
- package/template/fnet/node/src/default/input.args.js.njk +2 -2
- package/template/fnet/node/src/default/macros/block-header.js.njk +4 -4
- package/template/fnet/node/src/default/macros/block-library-header.js.njk +1 -1
- package/template/fnet/node/src/default/macros/block-modules-header.js.njk +1 -1
- package/template/fnet/node/src/default/macros/block-modules.js.njk +1 -1
- package/template/fnet/node/src/default/macros/block-next-header.js.njk +1 -1
- package/template/fnet/node/src/default/macros/block-next.js.njk +1 -1
- package/template/fnet/node/src/default/macros/block-run-footer.js.njk +7 -0
- package/template/fnet/node/src/default/macros/block-run-header.js.njk +0 -8
- package/template/fnet/node/src/default/macros/workflow-header.js.njk +2 -2
- package/template/fnet/node/src/default/workflow.js.njk +11 -10
- package/template/fnet/project/.vscode/launch.json.njk +1 -1
- package/template/fnode/node/package.json.njk +60 -47
- package/template/fnode/node/rollup.config.mjs.njk +4 -2
- package/dist/fnet/index.BbVrDxY_.js +0 -1
- package/dist/fnet/index.DwUKrF3q.js +0 -1
- package/dist/fnode/index.B_0ZxySP.js +0 -1
- package/dist/fnode/index.BtvzsBtE.js +0 -1
- package/dist/fnode/index.CACMY6jj.js +0 -1
- package/dist/fnode/index.xPP3GBoc.js +0 -1
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
{% if childs.length %}
|
|
9
9
|
{% if not childs[0].definition.dynamic %}
|
|
10
10
|
// FIRST CHILD: {{childs[0].indexKey}}
|
|
11
|
-
import {{childs[0].codeKey}} from "./{{childs[0].codeKey}}";
|
|
11
|
+
import {{childs[0].codeKey}} from "./{{childs[0].codeKey}}.js";
|
|
12
12
|
{% endif %}
|
|
13
13
|
{% endif%}
|
|
14
14
|
|
|
@@ -31,7 +31,7 @@ export default function Block(context) {
|
|
|
31
31
|
{% if childs.length %}
|
|
32
32
|
{% if childs[0].definition.dynamic %}
|
|
33
33
|
// FIRST CHILD: {{childs[0].indexKey}}
|
|
34
|
-
const { default: {{childs[0].codeKey}} } = await import("./{{childs[0].codeKey}}");
|
|
34
|
+
const { default: {{childs[0].codeKey}} } = await import("./{{childs[0].codeKey}}.js");
|
|
35
35
|
{% endif %}
|
|
36
36
|
{% endif%}
|
|
37
37
|
|
|
@@ -76,6 +76,8 @@ export default function Block(context) {
|
|
|
76
76
|
{% else %}
|
|
77
77
|
resolve();
|
|
78
78
|
{% endif %}
|
|
79
|
+
|
|
80
|
+
{% include "src/default/macros/block-run-footer.js.njk" %}
|
|
79
81
|
});
|
|
80
82
|
}
|
|
81
83
|
|
|
@@ -18,6 +18,7 @@ export default function Block(context){
|
|
|
18
18
|
|
|
19
19
|
return new Promise(async (resolve,reject)=>{
|
|
20
20
|
|
|
21
|
+
|
|
21
22
|
try{
|
|
22
23
|
{% include "src/default/macros/block-run-header.js.njk" %}
|
|
23
24
|
|
|
@@ -52,10 +53,13 @@ export default function Block(context){
|
|
|
52
53
|
{% include "src/default/macros/block-assign.js.njk" %}
|
|
53
54
|
|
|
54
55
|
{% include "src/default/macros/block-signal.js.njk" %}
|
|
56
|
+
|
|
57
|
+
{% include "src/default/macros/block-run-footer.js.njk" %}
|
|
55
58
|
}
|
|
56
59
|
catch(error){
|
|
57
60
|
reject(error);
|
|
58
61
|
}
|
|
62
|
+
|
|
59
63
|
});
|
|
60
64
|
}
|
|
61
65
|
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
{% include "src/default/macros/block-header.js.njk" %}
|
|
2
|
+
|
|
3
|
+
{% include "src/default/macros/block-next-header.js.njk" %}
|
|
4
|
+
|
|
5
|
+
{% include "src/default/macros/block-library-header.js.njk" %}
|
|
6
|
+
|
|
7
|
+
{% include "src/default/macros/block-modules-header.js.njk" %}
|
|
8
|
+
|
|
9
|
+
export default function Block(context){
|
|
10
|
+
|
|
11
|
+
{% include "src/default/macros/block-body-header.js.njk" %}
|
|
12
|
+
|
|
13
|
+
this.run= function (){
|
|
14
|
+
|
|
15
|
+
{% include "src/default/macros/block-entry-args.js.njk" %}
|
|
16
|
+
|
|
17
|
+
return new Promise(async (resolve,reject)=>{
|
|
18
|
+
|
|
19
|
+
try{
|
|
20
|
+
{% include "src/default/macros/block-run-header.js.njk" %}
|
|
21
|
+
|
|
22
|
+
{% include "src/default/macros/page.js.njk" %}
|
|
23
|
+
|
|
24
|
+
{% include "src/default/macros/block-modules.js.njk" %}
|
|
25
|
+
|
|
26
|
+
{% if context.next and context.transform.wait==='next' %}
|
|
27
|
+
flow.waitForNext({
|
|
28
|
+
key:'{{indexKey}}',
|
|
29
|
+
next: async () => {
|
|
30
|
+
{% include "src/default/macros/block-next.js.njk" %}
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
{% endif %}
|
|
34
|
+
|
|
35
|
+
{# NEW: Check if 'new' keyword is present for constructor call #}
|
|
36
|
+
{% if context.transform.new !== undefined %}
|
|
37
|
+
{# Constructor instantiation with 'new' keyword #}
|
|
38
|
+
{% if context.lib.type==='atom' and context.lib.atom.protocol!=='use:' %}
|
|
39
|
+
const LibClass=LIBRARY;
|
|
40
|
+
{% elseif context.lib.atom.protocol==='use:' %}
|
|
41
|
+
{# For use:e:: protocol, call value is the class name (e.g., use:e::Map → Map) #}
|
|
42
|
+
const LibClass={{context.transform.import}};
|
|
43
|
+
if(!LibClass) throw new Error('[use] Couldnt find class.');
|
|
44
|
+
{% else %}
|
|
45
|
+
throw new Error('Cannot instantiate: unsupported lib type.');
|
|
46
|
+
{% endif %}
|
|
47
|
+
|
|
48
|
+
{# Create instance with constructor args #}
|
|
49
|
+
{% if context.transform.new %}
|
|
50
|
+
const constructorArgs = {{ context.transform.new | safe }};
|
|
51
|
+
const instance = Array.isArray(constructorArgs) ? new LibClass(...constructorArgs) : new LibClass(constructorArgs);
|
|
52
|
+
{% else %}
|
|
53
|
+
const instance = new LibClass();
|
|
54
|
+
{% endif %}
|
|
55
|
+
|
|
56
|
+
{% endif %}
|
|
57
|
+
|
|
58
|
+
const result = instance;
|
|
59
|
+
|
|
60
|
+
{% for assign in context.transform.result %}
|
|
61
|
+
flow.set({{assign.key | safe}},{{assign.value | safe}});
|
|
62
|
+
{% endfor%}
|
|
63
|
+
|
|
64
|
+
{% include "src/default/macros/block-assign.js.njk" %}
|
|
65
|
+
|
|
66
|
+
{% include "src/default/macros/block-signal.js.njk" %}
|
|
67
|
+
|
|
68
|
+
{% if context.transform.return %}
|
|
69
|
+
resolve({type:'return',value: {{context.transform.return | safe}}});
|
|
70
|
+
{% elseif context.next and context.transform.wait!=='next'%}
|
|
71
|
+
{% include "src/default/macros/block-next.js.njk" %}
|
|
72
|
+
{% elseif not context.next%}
|
|
73
|
+
resolve();
|
|
74
|
+
{% endif %}
|
|
75
|
+
|
|
76
|
+
{% include "src/default/macros/block-run-footer.js.njk" %}
|
|
77
|
+
}
|
|
78
|
+
catch(error){
|
|
79
|
+
onError? onError(error) : reject(error);
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
Object.freeze(this);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
{% include "src/default/macros/block-footer.js.njk" %}
|
|
@@ -20,6 +20,8 @@ export default function Block(context){
|
|
|
20
20
|
{% include "src/default/macros/block-signal.js.njk" %}
|
|
21
21
|
|
|
22
22
|
onError? onError(new Error(raise?.message||raise||"Unknown error")) : reject(new Error(raise?.message||raise||"Unknown error"));
|
|
23
|
+
|
|
24
|
+
{% include "src/default/macros/block-run-footer.js.njk" %}
|
|
23
25
|
});
|
|
24
26
|
}
|
|
25
27
|
|
|
@@ -18,7 +18,7 @@ export default function Block(context){
|
|
|
18
18
|
|
|
19
19
|
// NEXT : {{context.next.indexKey}}
|
|
20
20
|
{% if context.next.definition.dynamic %}
|
|
21
|
-
const { default: {{context.next.codeKey}} } = await import("./{{context.next.codeKey}}");
|
|
21
|
+
const { default: {{context.next.codeKey}} } = await import("./{{context.next.codeKey}}.js");
|
|
22
22
|
{% endif %}
|
|
23
23
|
|
|
24
24
|
let current=new {{context.next.codeKey}}({ parent:_this, engine, flow, caller:c ,onError, error });
|
|
@@ -53,6 +53,7 @@ export default function Block(context){
|
|
|
53
53
|
|
|
54
54
|
resolve();
|
|
55
55
|
|
|
56
|
+
{% include "src/default/macros/block-run-footer.js.njk" %}
|
|
56
57
|
});
|
|
57
58
|
}
|
|
58
59
|
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
{% for child in childs %}
|
|
10
10
|
{% if not child.definition.dynamic %}
|
|
11
11
|
// CHILD: {{child.indexKey}}
|
|
12
|
-
import {{child.codeKey}} from "./{{child.codeKey}}";
|
|
12
|
+
import {{child.codeKey}} from "./{{child.codeKey}}.js";
|
|
13
13
|
{% endif %}
|
|
14
14
|
{% endfor%}
|
|
15
15
|
|
|
@@ -42,7 +42,7 @@ export default function Block(context) {
|
|
|
42
42
|
{
|
|
43
43
|
{% if child.definition.dynamic %}
|
|
44
44
|
// CHILD: {{child.indexKey}}
|
|
45
|
-
const { default: {{child.codeKey}} } = await import("./{{child.codeKey}}");
|
|
45
|
+
const { default: {{child.codeKey}} } = await import("./{{child.codeKey}}.js");
|
|
46
46
|
{% endif %}
|
|
47
47
|
|
|
48
48
|
const current=new {{child.codeKey}}({ parent:_this, engine, flow, caller:c, onError });
|
|
@@ -69,6 +69,7 @@ export default function Block(context) {
|
|
|
69
69
|
{% endif %}
|
|
70
70
|
{% endif %}
|
|
71
71
|
|
|
72
|
+
{% include "src/default/macros/block-run-footer.js.njk" %}
|
|
72
73
|
});
|
|
73
74
|
}
|
|
74
75
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
{% for child in childs %}
|
|
9
9
|
{% if not child.definition.dynamic %}
|
|
10
10
|
// CHILD: {{child.indexKey}}
|
|
11
|
-
import {{child.codeKey}} from "./{{child.codeKey}}";
|
|
11
|
+
import {{child.codeKey}} from "./{{child.codeKey}}.js";
|
|
12
12
|
{% endif %}
|
|
13
13
|
{% endfor%}
|
|
14
14
|
|
|
@@ -32,7 +32,7 @@ export default function Block(context) {
|
|
|
32
32
|
|
|
33
33
|
const onError=error=>{
|
|
34
34
|
{% if context.except.definition.dynamic %}
|
|
35
|
-
const { default: {{context.except.codeKey}} } = await import("./{{context.except.codeKey}}");
|
|
35
|
+
const { default: {{context.except.codeKey}} } = await import("./{{context.except.codeKey}}.js");
|
|
36
36
|
{% endif %}
|
|
37
37
|
|
|
38
38
|
const current=new {{context.except.codeKey}}({ parent:_this, engine, flow, caller:c , error });
|
|
@@ -45,7 +45,7 @@ export default function Block(context) {
|
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
{% if context.try.definition.dynamic %}
|
|
48
|
-
const { default: {{context.try.codeKey}} } = await import("./{{context.try.codeKey}}");
|
|
48
|
+
const { default: {{context.try.codeKey}} } = await import("./{{context.try.codeKey}}.js");
|
|
49
49
|
{% endif %}
|
|
50
50
|
|
|
51
51
|
const current=new {{context.try.codeKey}}({ parent:_this, engine, flow, caller:c ,onError, error });
|
|
@@ -63,6 +63,8 @@ export default function Block(context) {
|
|
|
63
63
|
{% include "src/default/macros/block-assign.js.njk" %}
|
|
64
64
|
|
|
65
65
|
{% include "src/default/macros/block-signal.js.njk" %}
|
|
66
|
+
|
|
67
|
+
{% include "src/default/macros/block-run-footer.js.njk" %}
|
|
66
68
|
});
|
|
67
69
|
}
|
|
68
70
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import Object from "../core/object";
|
|
1
|
+
import Object from "../core/object.js";
|
|
2
2
|
|
|
3
|
-
import { default as Workflow } from "./{{flow.codeKey}}";
|
|
3
|
+
import { default as Workflow } from "./{{flow.codeKey}}.js";
|
|
4
4
|
|
|
5
5
|
{% set form_enabled = false if flow.name === 'cli' else flow.parent.context.atom.doc.features.form_enabled %}
|
|
6
6
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{% if atom.doc.features.project.format === 'esm' %}
|
|
2
2
|
import fnetArgs from '@fnet/args';
|
|
3
|
-
import validate,{schema as inputSchema} from "./validate_input";
|
|
3
|
+
import validate,{schema as inputSchema} from "./validate_input.js";
|
|
4
4
|
|
|
5
5
|
{% elif atom.doc.features.project.format === 'cjs' %}
|
|
6
6
|
const fnetArgs = require('@fnet/args');
|
|
7
|
-
const validate,{schema as inputSchema} = require("./validate_input");
|
|
7
|
+
const validate,{schema as inputSchema} = require("./validate_input.js");
|
|
8
8
|
{% endif %}
|
|
9
9
|
|
|
10
10
|
{% if atom.doc.features.cli.fargs and atom.doc.features.cli.fargs?.enabled !== false %}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
// BLOCK: {{indexKey}}
|
|
2
2
|
|
|
3
|
-
import Message from "../../core/message";
|
|
3
|
+
import Message from "../../core/message.js";
|
|
4
4
|
{% if context.transform.print %}
|
|
5
|
-
import print from "../../core/print";
|
|
5
|
+
import print from "../../core/print.js";
|
|
6
6
|
{% endif %}
|
|
7
7
|
|
|
8
8
|
{% if context.transform.sleep %}
|
|
9
|
-
import sleep from "../../core/sleep";
|
|
9
|
+
import sleep from "../../core/sleep.js";
|
|
10
10
|
{% endif %}
|
|
11
11
|
|
|
12
12
|
{% if context.transform.assert %}
|
|
13
|
-
import assert from "../../core/assert";
|
|
13
|
+
import assert from "../../core/assert.js";
|
|
14
14
|
{% endif %}
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
{% endif %}
|
|
32
32
|
{% elseif context.lib.type==='subworkflow' %}
|
|
33
33
|
// LIBRARY: {{context.lib.indexKey}}
|
|
34
|
-
import { default as {{context.lib.codeKey}} } from "../{{context.lib.codeKey}}";
|
|
34
|
+
import { default as {{context.lib.codeKey}} } from "../{{context.lib.codeKey}}.js";
|
|
35
35
|
{% endif %}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
{% if child.module===true%}
|
|
3
3
|
{% if not child.definition.dynamic %}
|
|
4
4
|
// MODULE : {{child.indexKey}}
|
|
5
|
-
import { default as {{child.codeKey}} } from "./{{child.codeKey}}";
|
|
5
|
+
import { default as {{child.codeKey}} } from "./{{child.codeKey}}.js";
|
|
6
6
|
{% endif %}
|
|
7
7
|
{% endif %}
|
|
8
8
|
{% endfor%}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
// MODULE : {{child.indexKey}}
|
|
6
6
|
{% if child.definition.dynamic %}
|
|
7
|
-
const { default: {{child.codeKey}} } = await import("./{{child.codeKey}}");
|
|
7
|
+
const { default: {{child.codeKey}} } = await import("./{{child.codeKey}}.js");
|
|
8
8
|
{% endif %}
|
|
9
9
|
|
|
10
10
|
m['{{child.name}}']=async function(){
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{% if context.next %}
|
|
2
2
|
{% if not context.next.definition.dynamic %}
|
|
3
3
|
// NEXT : {{context.next.indexKey}}
|
|
4
|
-
import { default as {{context.next.codeKey}} } from "./{{context.next.codeKey}}";
|
|
4
|
+
import { default as {{context.next.codeKey}} } from "./{{context.next.codeKey}}.js";
|
|
5
5
|
{% endif %}
|
|
6
6
|
{% endif %}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
// NEXT : {{context.next.indexKey}}
|
|
4
4
|
{% if context.next.definition.dynamic %}
|
|
5
|
-
const { default: {{context.next.codeKey}} } = await import("./{{context.next.codeKey}}");
|
|
5
|
+
const { default: {{context.next.codeKey}} } = await import("./{{context.next.codeKey}}.js");
|
|
6
6
|
{% endif %}
|
|
7
7
|
|
|
8
8
|
|
|
@@ -26,14 +26,6 @@ console.log(new Date().toLocaleString(),'{{indexKey}}');
|
|
|
26
26
|
debugger;
|
|
27
27
|
{% endif %}
|
|
28
28
|
|
|
29
|
-
{% if context.transform.print %}
|
|
30
|
-
print({{context.transform.print | safe}});
|
|
31
|
-
{% endif%}
|
|
32
|
-
|
|
33
|
-
{% if context.transform.assert %}
|
|
34
|
-
assert({{context.transform.assert | safe}});
|
|
35
|
-
{% endif%}
|
|
36
|
-
|
|
37
29
|
{% if context.transform.sleep %}
|
|
38
30
|
await sleep({{context.transform.sleep}});
|
|
39
31
|
{% endif %}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
{% if context.next %}
|
|
4
4
|
{% if not context.next.definition.dynamic %}
|
|
5
5
|
// NEXT: {{context.next.indexKey}}
|
|
6
|
-
import {{context.next.codeKey}} from "./blocks/{{context.next.codeKey}}";
|
|
6
|
+
import {{context.next.codeKey}} from "./blocks/{{context.next.codeKey}}.js";
|
|
7
7
|
{% endif %}
|
|
8
8
|
{% endif %}
|
|
9
9
|
|
|
@@ -62,14 +62,6 @@ export default class Workflow extends Object {
|
|
|
62
62
|
debugger;
|
|
63
63
|
{% endif %}
|
|
64
64
|
|
|
65
|
-
{% if context.transform.print %}
|
|
66
|
-
print({{context.transform.print | safe}});
|
|
67
|
-
{% endif%}
|
|
68
|
-
|
|
69
|
-
{% if context.transform.assert %}
|
|
70
|
-
assert({{context.transform.assert | safe}});
|
|
71
|
-
{% endif%}
|
|
72
|
-
|
|
73
65
|
{% if context.transform.sleep %}
|
|
74
66
|
await sleep({{context.transform.sleep}});
|
|
75
67
|
{% endif %}
|
|
@@ -80,7 +72,7 @@ export default class Workflow extends Object {
|
|
|
80
72
|
|
|
81
73
|
{% if context.next.definition.dynamic %}
|
|
82
74
|
// NEXT : {{context.next.indexKey}}
|
|
83
|
-
const { default: {{context.next.codeKey}} } = await import("./blocks/{{context.next.codeKey}}");
|
|
75
|
+
const { default: {{context.next.codeKey}} } = await import("./blocks/{{context.next.codeKey}}.js");
|
|
84
76
|
{% endif %}
|
|
85
77
|
|
|
86
78
|
{# closure #}
|
|
@@ -112,6 +104,15 @@ export default class Workflow extends Object {
|
|
|
112
104
|
|
|
113
105
|
{% endif %}
|
|
114
106
|
|
|
107
|
+
|
|
108
|
+
{% if context.transform.print %}
|
|
109
|
+
print({{context.transform.print | safe}});
|
|
110
|
+
{% endif%}
|
|
111
|
+
|
|
112
|
+
{% if context.transform.assert %}
|
|
113
|
+
assert({{context.transform.assert | safe}});
|
|
114
|
+
{% endif%}
|
|
115
|
+
|
|
115
116
|
return this.result;
|
|
116
117
|
}
|
|
117
118
|
}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"skipFiles": [
|
|
12
12
|
"<node_internals>/**"
|
|
13
13
|
],
|
|
14
|
-
"program": "${workspaceFolder}/.workspace/
|
|
14
|
+
"program": "${workspaceFolder}/.workspace/src/cli/index.js",
|
|
15
15
|
"cwd": "${workspaceFolder}/.workspace",
|
|
16
16
|
"preLaunchTask": "fnet-watch",
|
|
17
17
|
"console": "integratedTerminal"
|
|
@@ -8,40 +8,42 @@
|
|
|
8
8
|
],
|
|
9
9
|
{# "sideEffects": false, #}
|
|
10
10
|
{% if atom.doc['npm::author'] %}
|
|
11
|
-
|
|
11
|
+
"author": "{{atom.doc['npm::author'] | safe}}",
|
|
12
12
|
{% endif %}
|
|
13
13
|
|
|
14
14
|
{% if atom.doc['npm::description'] %}
|
|
15
|
-
|
|
15
|
+
"description": "{{atom.doc['npm::description'] | safe}}",
|
|
16
16
|
{% endif %}
|
|
17
17
|
|
|
18
18
|
{% if atom.doc.features.project.format ==='cjs' %}
|
|
19
19
|
{% if atom.doc.features.rollup_output.esm.enabled === true%}
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
"main": "dist/default/esm/index.js",
|
|
21
|
+
"type":"module",
|
|
22
22
|
{% else %}
|
|
23
|
-
|
|
23
|
+
"main": "dist/default/cjs/index.cjs",
|
|
24
24
|
{% endif %}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
|
|
25
|
+
|
|
26
|
+
{% if atom.doc.features.dts_enabled ===true %}
|
|
27
|
+
"types": "dist/default/types/index.d.ts",
|
|
28
|
+
{% endif %}
|
|
29
|
+
|
|
30
|
+
"exports":{
|
|
31
|
+
".":{
|
|
32
|
+
"import":"./dist/default/esm/index.js",
|
|
33
|
+
"require":"./dist/default/cjs/index.cjs"
|
|
34
|
+
}
|
|
33
35
|
},
|
|
34
36
|
{% else %}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
37
|
+
"main": "dist/default/esm/index.js",
|
|
38
|
+
{% if atom.doc.features.dts_enabled ===true %}
|
|
39
|
+
"types": "dist/default/types/index.d.ts",
|
|
40
|
+
{% endif %}
|
|
41
|
+
"type":"module",
|
|
42
|
+
"exports":{
|
|
43
|
+
".":{
|
|
44
|
+
"import":"./dist/default/esm/index.js",
|
|
45
|
+
"require":"./dist/default/cjs/index.cjs"
|
|
46
|
+
}
|
|
45
47
|
},
|
|
46
48
|
{% endif %}
|
|
47
49
|
"flownet": {
|
|
@@ -57,46 +59,57 @@
|
|
|
57
59
|
"scripts": {
|
|
58
60
|
"build": "rollup --config",
|
|
59
61
|
"build:dev": "rollup --config --sourcemap --environment DEVELOPMENT",
|
|
60
|
-
"watch": "rollup --config --watch --sourcemap --environment DEVELOPMENT",
|
|
62
|
+
"watch": "rollup --config --watch --sourcemap --environment DEVELOPMENT --environment FLOWNET_WATCH",
|
|
61
63
|
"serve": "bunx serve ./"
|
|
64
|
+
|
|
62
65
|
{% if atom.doc.features.cli.enabled %}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
66
|
+
{% if atom.doc.features.project.format ==='cjs' %}
|
|
67
|
+
,"cli": "bun {{atom.doc.features.cli.node_options}} {{atom.doc.features.cli.dir}}/index.cjs"
|
|
68
|
+
{% if atom.doc.features.cli.mcp.enabled===true %}
|
|
69
|
+
,"mcp": "bun {{atom.doc.features.cli.node_options}} {{atom.doc.features.cli.dir}}/index.cjs --cli-mode=mcp"
|
|
70
|
+
,"mcp-inspect": "bunx @modelcontextprotocol/inspector bun {{atom.doc.features.cli.node_options}} {{atom.doc.features.cli.dir}}/index.cjs --cli-mode=mcp"
|
|
71
|
+
{% endif %}
|
|
72
|
+
{% else %}
|
|
73
|
+
,"cli": "bun {{atom.doc.features.cli.node_options}} {{atom.doc.features.cli.dir}}/"
|
|
74
|
+
,"cli:dev": "bun {{atom.doc.features.cli.node_options}} {{atom.doc.features.cli.input.file}}"
|
|
75
|
+
{% if atom.doc.features.cli.mcp.enabled===true %}
|
|
76
|
+
,"cli:mcp": "bun {{atom.doc.features.cli.node_options}} {{atom.doc.features.cli.dir}}/ --cli-mode=mcp"
|
|
77
|
+
,"cli:mcp:inspect": "bunx @modelcontextprotocol/inspector bun {{atom.doc.features.cli.node_options}} {{atom.doc.features.cli.dir}}/ --cli-mode=mcp"
|
|
78
|
+
,"cli:mcp:dev": "bun {{atom.doc.features.cli.node_options}} {{atom.doc.features.cli.input.file}} --cli-mode=mcp"
|
|
79
|
+
,"cli:mcp:inspect:dev": "bunx @modelcontextprotocol/inspector bun {{atom.doc.features.cli.node_options}} {{atom.doc.features.cli.input.file}} --cli-mode=mcp"
|
|
80
|
+
{% endif %}
|
|
81
|
+
{% endif %}
|
|
82
|
+
,"cli:compile": "fbin compile {{atom.doc.features.cli.dir}}/index.js -o .bin/{{atom.doc['npm::bin'] or atom.doc['name'] or atom['id']}}"
|
|
83
|
+
,"cli:compile:dev": "fbin compile {{atom.doc.features.cli.input.file}} -o .bin/{{atom.doc['npm::bin'] or atom.doc['name'] or atom['id']}}"
|
|
84
|
+
,"cli:install": "fbin install ./.bin/{{atom.doc['npm::bin'] or atom.doc['name'] or atom['id']}} --yes"
|
|
85
|
+
|
|
86
|
+
,"compile": "fbin compile {{atom.doc.features.cli.dir}}/index.js -o .bin/{{atom.doc['npm::bin'] or atom.doc['name'] or atom['id']}}"
|
|
87
|
+
,"install-bin": "fbin install ./.bin/{{atom.doc['npm::bin'] or atom.doc['name'] or atom['id']}} --yes"
|
|
78
88
|
{% endif %}
|
|
89
|
+
|
|
79
90
|
{% if atom.doc.features.app.enabled %}
|
|
80
|
-
|
|
91
|
+
,"app": "bunx serve {{atom.doc.features.app.dir}}/"
|
|
92
|
+
{# ,"app:dev": "bunx serve {{atom.doc.features.app.input.dir}}" #}
|
|
81
93
|
{% endif %}
|
|
82
94
|
},
|
|
83
95
|
"devDependencies": {
|
|
84
96
|
{% for dep in packageDevDependencies %}
|
|
85
|
-
|
|
97
|
+
"{{dep.package}}":"{{dep.version}}" {% if not loop.last%},{%endif%}
|
|
86
98
|
{% endfor%}
|
|
87
99
|
},
|
|
88
100
|
"dependencies": {
|
|
89
101
|
{% for dep in packageDependencies %}
|
|
90
|
-
|
|
102
|
+
"{{dep.package}}":"{{dep.version}}" {% if not loop.last%},{%endif%}
|
|
91
103
|
{% endfor%}
|
|
92
|
-
|
|
93
|
-
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
{% if atom.doc.features.cli.enabled and atom.doc['npm::bin'] %}
|
|
94
107
|
,"bin":{
|
|
95
108
|
{% if atom.doc.features.project.format ==='cjs' %}
|
|
96
|
-
|
|
109
|
+
"{{atom.doc['npm::bin']}}":"{{atom.doc.features.cli.dir}}/index.cjs"
|
|
97
110
|
{% else %}
|
|
98
|
-
|
|
111
|
+
"{{atom.doc['npm::bin']}}":"{{atom.doc.features.cli.dir}}/index.js"
|
|
99
112
|
{% endif %}
|
|
100
113
|
}
|
|
101
|
-
|
|
114
|
+
{% endif %}
|
|
102
115
|
}
|
|
@@ -6,6 +6,8 @@ import fs from 'fs-extra';
|
|
|
6
6
|
import path from 'path';
|
|
7
7
|
|
|
8
8
|
const DEVELOPMENT = process.env.DEVELOPMENT ? true : false;
|
|
9
|
+
const FLOWNET_WATCH = process.env.FLOWNET_WATCH ? true : false;
|
|
10
|
+
|
|
9
11
|
const extensions = [".ts", ".tsx", ".js", ".jsx", ".json"];
|
|
10
12
|
|
|
11
13
|
{% if atom.doc.features.copy_enabled===true %}
|
|
@@ -88,7 +90,7 @@ const initPlugins = async (options) => {
|
|
|
88
90
|
const {default:copy} = await import('rollup-plugin-copy');
|
|
89
91
|
plugins.push(copy(options.copy.options));
|
|
90
92
|
|
|
91
|
-
if (
|
|
93
|
+
if (FLOWNET_WATCH) watchFiles(options.copy.options.targets);
|
|
92
94
|
}
|
|
93
95
|
{% endif %}
|
|
94
96
|
|
|
@@ -259,7 +261,7 @@ const initPlugins = async (options) => {
|
|
|
259
261
|
|
|
260
262
|
{# BROWSERSYNC #}
|
|
261
263
|
{% if atom.doc.features.browsersync_enabled===true %}
|
|
262
|
-
if (options.browsersync &&
|
|
264
|
+
if (options.browsersync && FLOWNET_WATCH) {
|
|
263
265
|
const {default:browsersync} = await import('@fnet/rollup-plugin-browsersync');
|
|
264
266
|
options.browsersync.middleware = function (req, res, next) {
|
|
265
267
|
if (req.method === 'OPTIONS') {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"node:fs";import t from"node:path";import r from"semver";import o from"@fnet/shelljs";import i from"@fnet/config";import s from"@fnet/object-from-schema";import n from"yaml";import{r as p,w as m}from"./index.js";import{fileURLToPath as a}from"node:url";import"yargs";import"chalk";import"node:util";import"tree-kill";import"node:child_process";import"node:os";import"@flownet/lib-render-templates-dir";import"@fnet/yaml";import"nunjucks";import"lodash.clonedeep";import"isobject";import"redis";import"@flownet/lib-is-redis-online";import"node:crypto";import"@flownet/lib-atom-api-js";import"lodash.merge";import"@flownet/lib-parse-imports-js";import"@fnet/npm-list-versions";import"@fnet/npm-pick-versions";import"object-hash";import"ajv/dist/2020.js";import"ajv/dist/standalone/index.js";import"ajv-formats";import"@flownet/lib-parse-node-url";import"bpmn-moddle";import"dagre";import"@fnet/expression";import"@fnet/list-files";import"@fnet/key-value-transformer";import"@fnet/prompt";import"fs";import"path";import"@fnet/shell-flow";async function l({atom:a,setProgress:l,context:c,deploymentProject:d,deploymentProjectTarget:f,yamlTarget:y}){await l({message:"Deploying it as npm package."});const w=c.projectDir,b=t.resolve(w,"package.json"),j=e.readFileSync(b),u=JSON.parse(j);u.name=f.params.name,u.version=r.inc(f.version,"patch");const g=f.params.bin?.name||f.params.bin;!1!==f.params.bin?.enabled&&g&&"string"==typeof g&&(u.bin={[g]:"dist/cli/esm/index.js"}),delete u.scripts,delete u.devDependencies,u.scripts={serve:"npx serve ."},e.writeFileSync(b,JSON.stringify(u,null,"\t"));const h=f.config||"npm";let v=(await i({name:h,dir:c.projectDir,tags:c.tags,optional:!0}))?.data;if(!v){const r=p("./template/schemas/to-npm.yaml"),o=await s({schema:r,tags:c.tags}),i=c.project.projectDir,m=t.resolve(i,".fnet");e.existsSync(m)||e.mkdirSync(m),e.writeFileSync(t.resolve(m,`${h}.fnet`),n.stringify(o)),v=o}if(e.writeFileSync(t.resolve(w,".npmrc"),`//registry.npmjs.org/:_authToken=${v.env.NPM_TOKEN}`),!0!==f.dryRun){if(m("bun")){if(0!==(await o("bun publish --access public",{cwd:w})).code)throw new Error("Couldnt publish to npm")}else{if(0!==(await o("npm publish --access public",{cwd:w})).code)throw new Error("Couldnt publish to npm")}e.writeFileSync(b,j),d.isDirty=!0,f.version=u.version,y.set("version",u.version)}}t.dirname(a(import.meta.url)),process.cwd();export{l as default};
|