@fnet/cli 0.114.0 → 0.116.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.
Files changed (49) hide show
  1. package/dist/fnet/index.BZuqvTVt.js +1 -0
  2. package/dist/fnet/index.js +1 -1
  3. package/dist/fnode/index.B_0ZxySP.js +1 -0
  4. package/dist/fnode/{index.Cl6LPgIY.js → index.D3C-8oZW.js} +1 -1
  5. package/dist/fnode/index.D4sPJLOP.js +1 -0
  6. package/dist/fnode/index.DIZA_GzC.js +1 -0
  7. package/dist/fnode/{index.mC936qdY.js → index.DMkgR1Dh.js} +1 -1
  8. package/dist/fnode/index.js +1 -1
  9. package/dist/fnode/{index.qJ6fWMSj.js → index.uPDSav7E.js} +1 -1
  10. package/package.json +2 -1
  11. package/template/fnet/bun/src/cli/index.js.njk +1 -1
  12. package/template/fnet/node/package.json.njk +1 -0
  13. package/template/fnet/node/rollup.config.mjs.njk +144 -11
  14. package/template/fnet/node/src/cli/index.js.njk +322 -39
  15. package/template/fnode/bun/src/cli/index.js.njk +2 -2
  16. package/template/fnode/node/package.json.njk +10 -1
  17. package/template/fnode/node/rollup.config.mjs.njk +144 -11
  18. package/template/fnode/node/src/cli/index.js.njk +289 -46
  19. package/dist/fnet/index.PNP2oTpU.js +0 -1
  20. package/dist/fnode/index.6_yfJqit.js +0 -1
  21. package/dist/fnode/index.BlhtGEKB.js +0 -1
  22. package/dist/fnode/index.CLPC6OJN.js +0 -1
  23. package/template/fnet/bun/fnet/flows.yaml.njk +0 -1
  24. package/template/fnet/bun/fnet.yaml.njk +0 -1
  25. package/template/fnet/node/fnet/flows.yaml.njk +0 -1
  26. package/template/fnet/node/fnet.yaml.njk +0 -1
  27. package/template/fnet/node/rollup_config_external.njk +0 -8
  28. package/template/fnet/node/rollup_config_onwarn.njk +0 -9
  29. package/template/fnet/node/rollup_config_output_banner.njk +0 -3
  30. package/template/fnet/node/rollup_config_output_footer.njk +0 -5
  31. package/template/fnet/node/rollup_config_output_globals.njk +0 -9
  32. package/template/fnet/node/rollup_config_output_name.njk +0 -3
  33. package/template/fnet/node/rollup_config_plugins.njk +0 -90
  34. package/template/fnode/bun/fnode.yaml.njk +0 -1
  35. package/template/fnode/node/fnode.yaml.njk +0 -1
  36. package/template/fnode/node/rollup_config_external.njk +0 -8
  37. package/template/fnode/node/rollup_config_onwarn.njk +0 -9
  38. package/template/fnode/node/rollup_config_output_banner.njk +0 -3
  39. package/template/fnode/node/rollup_config_output_footer.njk +0 -5
  40. package/template/fnode/node/rollup_config_output_globals.njk +0 -9
  41. package/template/fnode/node/rollup_config_output_name.njk +0 -3
  42. package/template/fnode/node/rollup_config_plugins.njk +0 -90
  43. package/template/fnode/python/fnode.yaml.njk +0 -1
  44. /package/template/fnet/bun/src/default/{to.args.js.njk → input.args.js.njk} +0 -0
  45. /package/template/fnet/node/src/default/{to.args.js.njk → input.args.js.njk} +0 -0
  46. /package/template/fnet/project/.vscode/{launch.json → launch.json.njk} +0 -0
  47. /package/template/fnet/project/.vscode/{tasks.json → tasks.json.njk} +0 -0
  48. /package/template/fnode/bun/src/default/{to.args.js.njk → input.args.js.njk} +0 -0
  49. /package/template/fnode/node/src/default/{to.args.js.njk → input.args.js.njk} +0 -0
@@ -1,79 +1,322 @@
1
1
  {% if atom.doc.features.cli.enabled===true %}
2
2
 
3
- {% if atom.doc.features.project.format==='esm' %}
3
+ {# Define macros for reusable code blocks #}
4
+ {% macro importMcpDependencies(format) %}
5
+ {% if format === 'esm' %}
6
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
7
+ import { ListToolsRequestSchema, CallToolRequestSchema } from "@modelcontextprotocol/sdk/types.js";
8
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
9
+ import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
10
+ import express from "express";
11
+ {% else %}
12
+ const { Server } = require("@modelcontextprotocol/sdk/server/index.js");
13
+ const { ListToolsRequestSchema, CallToolRequestSchema } = require("@modelcontextprotocol/sdk/types.js");
14
+ const { StdioServerTransport } = require("@modelcontextprotocol/sdk/server/stdio.js");
15
+ const { StreamableHTTPServerTransport } = require("@modelcontextprotocol/sdk/server/streamableHttp.js");
16
+ const express = require("express");
17
+ {% endif %}
18
+ {% endmacro %}
4
19
 
5
- import argv from '../default/to.args.js';
20
+ {% macro mcpModeCode(nodeFn) %}
21
+ if (cliMode === 'mcp') {
22
+ // MCP mode code
23
+ const server = new Server({
24
+ name: "{{atom.doc.features.cli.mcp.name or atom.doc.name}}",
25
+ version: "{{atom.doc.version or '0.0.1'}}"
26
+ }, {
27
+ capabilities: {
28
+ tools: {}
29
+ }
30
+ });
6
31
 
7
- {% if atom.doc.features.cli.extend===true %}
32
+ // Define available tools
33
+ server.setRequestHandler(ListToolsRequestSchema, async () => {
34
+ return {
35
+ tools: [{
36
+ name: "{{atom.doc.features.cli.mcp.tool.name or atom.doc.name}}",
37
+ description: "{{atom.doc.features.cli.mcp.tool.description or atom.doc.description}}",
38
+ {% if atom.doc.input %}
39
+ inputSchema: {{atom.doc.input | dump | safe}}
40
+ {% else %}
41
+ inputSchema: {
42
+ type: "object",
43
+ properties: {},
44
+ additionalProperties: true
45
+ }
46
+ {% endif %}
47
+ }]
48
+ };
49
+ });
8
50
 
9
- import Node from '../../../cli';
10
- const run=async ()=>await Node(await argv());
51
+ // Handle tool execution
52
+ server.setRequestHandler(CallToolRequestSchema, async (request) => {
53
+ if (request.params.name === "{{atom.doc.features.cli.mcp.tool.name or atom.doc.name}}") {
54
+ try {
55
+ const result = await {{ nodeFn }}(request.params.arguments);
56
+ return {
57
+ content: [{
58
+ type: "text",
59
+ text: JSON.stringify(result)
60
+ }]
61
+ };
62
+ } catch (error) {
63
+ return {
64
+ content: [{
65
+ type: "text",
66
+ text: `Error: ${error.message}`
67
+ }],
68
+ isError: true
69
+ };
70
+ }
71
+ }
72
+ throw new Error("Tool not found");
73
+ });
74
+
75
+ // Get transport type from arguments
76
+ const transportType = args['mcp-transport-type'] || args.mcp_transport_type || 'stdio';
77
+ let transport;
78
+
79
+ if (transportType === 'stdio') {
80
+ // Use stdio transport
81
+ transport = new StdioServerTransport();
82
+ console.log("MCP server started with stdio transport");
83
+ } else if (transportType === 'http') {
84
+ // Use HTTP transport
85
+ const app = express();
86
+ app.use(express.json());
87
+
88
+ const port = args['cli-port'] || args.cli_port || 3000;
89
+ const server = app.listen(port, () => {
90
+ console.log(`MCP server started with HTTP transport on port ${port}`);
91
+ });
92
+
93
+ transport = new StreamableHTTPServerTransport({
94
+ sessionIdGenerator: () => Math.random().toString(36).substring(2, 15),
95
+ });
96
+
97
+ app.post('/mcp', async (req, res) => {
98
+ await transport.handleRequest(req, res, req.body);
99
+ });
100
+
101
+ app.get('/mcp', async (req, res) => {
102
+ await transport.handleRequest(req, res);
103
+ });
104
+
105
+ app.delete('/mcp', async (req, res) => {
106
+ await transport.handleRequest(req, res);
107
+ });
108
+ } else {
109
+ console.error(`Unknown MCP transport type: ${transportType}`);
110
+ console.error(`Supported types: stdio, http`);
111
+ process.exit(1);
112
+ }
113
+
114
+ await server.connect(transport);
115
+ return;
116
+ }
117
+ {% endmacro %}
118
+
119
+ {% macro httpModeCodeExpress(nodeFn) %}
120
+ if (cliMode === 'http') {
121
+ // HTTP mode code
122
+ const app = express();
123
+ app.use(express.json());
124
+
125
+ app.post('/{{atom.doc.features.cli.http.path or atom.doc.name}}', async (req, res) => {
126
+ try {
127
+ const result = await {{ nodeFn }}(req.body);
128
+ res.json(result);
129
+ } catch (error) {
130
+ res.status(500).json({ error: error.message });
131
+ }
132
+ });
133
+
134
+ const port = args['cli-port'] || args.cli_port || 3000;
135
+ app.listen(port, () => {
136
+ console.log(`HTTP server started on port ${port}`);
137
+ });
138
+ return;
139
+ }
140
+ {% endmacro %}
141
+
142
+ {% macro defaultModeExtend(nodeFn) %}
143
+ if (cliMode === 'default') {
144
+ // Default mode code
145
+ return await {{ nodeFn }}(args);
146
+ }
147
+ {% endmacro %}
148
+
149
+ {% macro defaultModeStandard(nodeFn) %}
150
+ if (cliMode === 'default') {
151
+ // Default mode code
152
+ const result = await {{ nodeFn }}(args);
153
+
154
+ if (typeof result !== 'undefined') {
155
+ const stdout_format = args['stdout-format'] || args.stdout_format || null;
156
+
157
+ if (stdout_format === 'json') console.log(JSON.stringify(result, null, 2));
158
+ else console.log(result);
159
+ }
160
+ return;
161
+ }
162
+ {% endmacro %}
163
+
164
+ {% macro runWithCatch() %}
11
165
  run()
12
- .then(() => {
13
- {# process.exit(0); #}
14
- })
15
- .catch((error) => {
166
+ .catch((error) => {
16
167
  console.error(error.message);
17
168
  process.exit(1);
18
169
  });
170
+ {% endmacro %}
19
171
 
20
- {% else %}
21
- import Node from '../../../src';
22
- const run=async ()=>await Node(await argv());
23
-
172
+ {% macro runWithThenCatch() %}
24
173
  run()
25
- .then((result) => {
26
- if (typeof result !== 'undefined')
27
- {
28
- // TODO: REMOVE THIS LINE
29
- const stdout_format=process.argv.slice(2).indexOf()!==-1? process.argv.slice(2)[process.argv.slice(2).indexOf('--stdout_format')+1]:null;
30
- if(stdout_format==='json') console.log(JSON.stringify(result,null,2));
31
- else console.log(result);
32
- }
174
+ .then(() => {
33
175
  {# process.exit(0); #}
34
176
  })
35
177
  .catch((error) => {
36
178
  console.error(error.message);
37
179
  process.exit(1);
38
180
  });
181
+ {% endmacro %}
182
+
183
+ {# Main template starts here #}
184
+ {% if atom.doc.features.project.format==='esm' %}
185
+
186
+ import argv from '../default/input.args.js';
187
+
188
+ {% if atom.doc.features.cli.extend===true %}
189
+
190
+ import Node from '../../../cli';
191
+
192
+ {% if atom.doc.features.cli.mcp.enabled===true %}
193
+ {{ importMcpDependencies('esm') }}
194
+ {% endif %}
195
+
196
+ {% if atom.doc.features.cli.http.enabled===true %}
197
+ // Using express for HTTP mode
198
+ import express from 'express';
199
+ {% endif %}
200
+
201
+ const run = async () => {
202
+ const args = await argv();
203
+ const cliMode = args['cli-mode'] || args.cli_mode || 'default';
204
+
205
+ {{ defaultModeExtend('Node') }}
206
+
207
+ {% if atom.doc.features.cli.mcp.enabled===true %}
208
+ {{ mcpModeCode('Node') }}
209
+ {% endif %}
210
+
211
+ {% if atom.doc.features.cli.http.enabled===true %}
212
+ {{ httpModeCodeBuiltIn('Node') }}
213
+ {% endif %}
214
+
215
+ console.error(`Unknown CLI mode: ${cliMode}`);
216
+ process.exit(1);
217
+ };
218
+
219
+ {{ runWithThenCatch() }}
220
+
221
+ {% else %}
222
+ import Node from '../../../src';
223
+
224
+ {% if atom.doc.features.cli.mcp.enabled===true %}
225
+ {{ importMcpDependencies('esm') }}
226
+ {% endif %}
227
+
228
+ {% if atom.doc.features.cli.http.enabled===true %}
229
+ import express from 'express';
230
+ {% endif %}
231
+
232
+ const run = async () => {
233
+ const args = await argv();
234
+ const cliMode = args['cli-mode'] || args.cli_mode || 'default';
235
+
236
+ {{ defaultModeStandard('Node') }}
237
+
238
+ {% if atom.doc.features.cli.mcp.enabled===true %}
239
+ {{ mcpModeCode('Node') }}
240
+ {% endif %}
241
+
242
+ {% if atom.doc.features.cli.http.enabled===true %}
243
+ {{ httpModeCodeExpress('Node') }}
244
+ {% endif %}
245
+
246
+ console.error(`Unknown CLI mode: ${cliMode}`);
247
+ process.exit(1);
248
+ };
249
+
250
+ {{ runWithCatch() }}
39
251
  {% endif %}
40
252
 
41
253
  {% elif atom.doc.features.project.format==='cjs' %}
42
254
 
43
- const argv = require('../default/to.args.js');
255
+ const argv = require('../default/input.args.js');
44
256
 
45
257
  {% if atom.doc.features.cli.extend===true %}
46
258
 
47
259
  const Node = require('../../../cli');
48
- const run = async () => await Node(await argv());
49
260
 
50
- run()
51
- .then(() => {
52
- {# process.exit(0); #}
53
- })
54
- .catch((error) => {
55
- console.error(error.message);
56
- process.exit(1);
57
- });
261
+ {% if atom.doc.features.cli.mcp.enabled===true %}
262
+ {{ importMcpDependencies('cjs') }}
263
+ {% endif %}
264
+
265
+ {% if atom.doc.features.cli.http.enabled===true %}
266
+ // Using express for HTTP mode
267
+ const express = require('express');
268
+ {% endif %}
269
+
270
+ const run = async () => {
271
+ const args = await argv();
272
+ const cliMode = args['cli-mode'] || args.cli_mode || 'default';
273
+
274
+ {{ defaultModeExtend('Node') }}
275
+
276
+ {% if atom.doc.features.cli.mcp.enabled===true %}
277
+ {{ mcpModeCode('Node') }}
278
+ {% endif %}
279
+
280
+ {% if atom.doc.features.cli.http.enabled===true %}
281
+ {{ httpModeCodeBuiltIn('Node') }}
282
+ {% endif %}
283
+
284
+ console.error(`Unknown CLI mode: ${cliMode}`);
285
+ process.exit(1);
286
+ };
287
+
288
+ {{ runWithThenCatch() }}
58
289
 
59
290
  {% else %}
60
291
  const Node = require('../../../src');
61
- const run = async () => await Node(await argv());
62
292
 
63
- run()
64
- .then((result) => {
65
- if (typeof result !== 'undefined') {
66
- // TODO: REMOVE THIS LINE
67
- const stdout_format=process.argv.slice(2).indexOf()!==-1? process.argv.slice(2)[process.argv.slice(2).indexOf('--stdout_format')+1]:null;
68
- if (stdout_format === 'json') console.log(JSON.stringify(result, null, 2));
69
- else console.log(result);
70
- }
71
- {# process.exit(0); #}
72
- })
73
- .catch((error) => {
74
- console.error(error.message);
75
- process.exit(1);
76
- });
293
+ {% if atom.doc.features.cli.mcp.enabled===true %}
294
+ {{ importMcpDependencies('cjs') }}
295
+ {% endif %}
296
+
297
+ {% if atom.doc.features.cli.http.enabled===true %}
298
+ const express = require('express');
299
+ {% endif %}
300
+
301
+ const run = async () => {
302
+ const args = await argv();
303
+ const cliMode = args['cli-mode'] || args.cli_mode || 'default';
304
+
305
+ {{ defaultModeStandard('Node') }}
306
+
307
+ {% if atom.doc.features.cli.mcp.enabled===true %}
308
+ {{ mcpModeCode('Node') }}
309
+ {% endif %}
310
+
311
+ {% if atom.doc.features.cli.http.enabled===true %}
312
+ {{ httpModeCodeExpress('Node') }}
313
+ {% endif %}
314
+
315
+ console.error(`Unknown CLI mode: ${cliMode}`);
316
+ process.exit(1);
317
+ };
318
+
319
+ {{ runWithCatch() }}
77
320
  {% endif %}
78
321
 
79
322
  {% endif %}
@@ -1 +0,0 @@
1
- import e from"node:path";import t from"node:fs";import o from"@fnet/yaml";import r from"yaml";import{r as i}from"./index.js";import"node:url";import"yargs";import"chalk";import"node:util";import"tree-kill";import"node:child_process";import"@fnet/config";import"node:os";import"@flownet/lib-render-templates-dir";import"@fnet/shelljs";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"lodash.pick";import"lodash.omit";import"@fnet/prompt";import"fs";import"path";import"@fnet/shell-flow";async function n(n){if(n.id)return{id:n.id,buildId:n.buildId,mode:n.mode,protocol:n.protocol||"ac:",templateDir:i("./template/fnode/node"),projectDir:e.resolve(process.cwd(),`./.output/${n.id}`),tags:n.ftag};try{const s=await async function({tags:i}){let n=function(o){const r=e.resolve(o,"node.yaml"),i=e.resolve(o,"fnode.yaml");if(t.existsSync(i))return i;if(t.existsSync(r))try{const e=t.readFileSync(r,"utf8");return t.writeFileSync(i,e,"utf8"),t.unlinkSync(r),console.log(`Migrated node.yaml to fnode.yaml in ${o}`),i}catch(e){return console.error(`Error migrating node.yaml to fnode.yaml: ${e.message}`),r}return i}(process.cwd());if(!t.existsSync(n))throw new Error("fnode.yaml file not found in current directory.");const{raw:s,parsed:m}=await o({file:n,tags:i}),p=e.dirname(n);m.features=m.features||{};const l=m.features;l.runtime=l.runtime||{},l.runtime.type=l.runtime.type||"node","python"===l.runtime.type?l.runtime.template=l.runtime.template||"python":"bun"===l.runtime.type?l.runtime.template=l.runtime.template||"bun":l.runtime.template=l.runtime.template||"node";const a={libraryAtom:{doc:{...m},fileName:"index"},projectDir:p,projectFilePath:n,projectFileContent:s,projectFileParsed:m,runtime:l.runtime};let c=e.resolve(p,"fnet/targets.yaml");if(!t.existsSync(c)&&(c=e.resolve(p,"node.devops.yaml"),t.existsSync(c))){const o=e.resolve(p,"fnet");t.existsSync(o)||t.mkdirSync(o),t.copyFileSync(c,e.resolve(p,"fnet/targets.yaml")),t.unlinkSync(c)}if(t.existsSync(c)){const{raw:e,parsed:n}=await o({file:c,tags:i}),s=r.parseDocument(e);a.devops={filePath:c,fileContent:e,yamlDocument:s,doc:{...n},type:"library.deploy",save:async()=>{t.writeFileSync(a.devops.filePath,s.toString())}}}const d=e.resolve(p,"readme.md");if(t.existsSync(d)){const e=t.readFileSync(d,"utf8");a.readme={filePath:d,fileContent:e,doc:{content:e,"content-type":"markdown"},type:"wiki"}}return a}({tags:n.ftag});return{buildId:n.buildId,mode:n.mode,protocol:n.protocol||"local:",templateDir:i(`./template/fnode/${s.runtime.template}`),projectDir:e.resolve(s.projectDir,"./.workspace"),projectSrcDir:e.resolve(s.projectDir,"./src"),project:s,tags:n.ftag}}catch(e){return console.warn(`Warning: Could not load project: ${e.message}`),{projectDir:process.cwd(),tags:n.ftag}}}export{n as createContext};
@@ -1 +0,0 @@
1
- import e from"node:path";import t from"node:fs";import o from"@fnet/yaml";import r from"yaml";import{r as i}from"./index.js";import"node:url";import"yargs";import"chalk";import"@fnet/config";import"node:util";import"tree-kill";import"node:child_process";import"node:os";import"@flownet/lib-render-templates-dir";import"@fnet/shelljs";import"@fnet/prompt";import"fs";import"path";import"@fnet/shell-flow";async function n(n){if(n.id)return{id:n.id,buildId:n.buildId,mode:n.mode,protocol:n.protocol||"ac:",templateDir:i("./template/fnet/node"),coreDir:i("./template/fnet/core"),projectDir:e.resolve(process.cwd(),`./.output/${n.id}`),tags:n.ftag};try{const s=await async function({tags:i}){let n=(s=process.cwd(),e.resolve(s,"fnet.yaml"));var s;if(!t.existsSync(n))throw new Error("fnet.yaml file not found in current directory.");const{raw:l,parsed:a}=await o({file:n,tags:i}),c=e.dirname(n);a.features=a.features||{};const p=a.features;let m;if(p.runtime=p.runtime||{},p.runtime.type=p.runtime.type||"node","object"==typeof a.flows)m=a.flows;else{let r="flow.main.yaml";t.existsSync(e.join(c,"fnet","flows.yaml"))&&(r=e.join("fnet","flows.yaml"));const n=a.main||r;let s=e.resolve(c,n);if(t.existsSync(s)){const{parsed:e}=await o({file:s,tags:i});m=e}else m={main:{steps:[]}}}const f={workflowAtom:{doc:{...a,content:m}},projectDir:c,projectFilePath:n,projectFileContent:l,projectFileParsed:a,runtime:p.runtime};let d=e.resolve(c,"fnet/targets.yaml");if(t.existsSync(d)){const{raw:e,parsed:n}=await o({file:d,tags:i}),s=r.parseDocument(e);f.devops={filePath:d,fileContent:e,yamlDocument:s,doc:{...n},type:"workflow.deploy",save:async()=>{t.writeFileSync(f.devops.filePath,s.toString())}}}const u=e.resolve(c,"readme.md");if(t.existsSync(u)){const e=t.readFileSync(u,"utf8");f.readme={filePath:u,fileContent:e,doc:{content:e,"content-type":"markdown"},type:"wiki"}}return f}({tags:n.ftag});return{buildId:n.buildId,mode:n.mode,protocol:n.protocol||"local:",templateDir:i("./template/fnet/node"),coreDir:i("./template/fnet/core"),projectDir:e.resolve(s.projectDir,"./.workspace"),projectSrcDir:e.resolve(s.projectDir,"./src"),project:s,tags:n.ftag}}catch(e){return console.warn(`Warning: Could not load project: ${e.message}`),{projectDir:process.cwd(),tags:n.ftag}}}export{n as createContext};
@@ -1 +0,0 @@
1
- import e from"node:fs";import t from"node:path";import{randomUUID as i}from"node:crypto";import o from"yaml";import s from"nunjucks";import r from"chalk";import{Api as a,Atom as n}from"@flownet/lib-atom-api-js";import c from"@fnet/config";import d from"@fnet/list-files";import l from"redis";import p from"@flownet/lib-is-redis-online";import m from"@fnet/yaml";class g{init({config:e,accessToken:t}){return new Promise(((i,o)=>{if(a.set_api_url(e.data.url),t)return a.set_req_token(t),void i(t);fetch(`${e.data.issuer}/protocol/openid-connect/token`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(e.data.grant.params)}).then((async e=>{if(!e.ok)throw new Error(await e.text());return e.json()})).then((e=>{a.set_req_token(e.access_token),i(e.access_token)})).catch((e=>{a.set_req_token(),o(e)}))}))}}var h=async e=>{const{atom:t,packageDependencies:i,context:o,deploymentProjectTarget:s,setProgress:r,deploymentProject:a,yamlTarget:n}=e;if(!0!==s.enabled)return;const c=s.type;try{if("lib"===c)await(await import("./index.DG8TqL-1.js")).default({...e});else if("red"===c)await(await import("./index.CmMM-Ek9.js")).default({...e});else if("npm"===c)await(await import("./index.xPP3GBoc.js")).default({...e});else if("gcs"===c)await(await import("./index.UOds5XLl.js")).default({...e});else if("gitlab"===c)await(await import("./index.DI3yyTtl.js")).default({...e});else if("fnet-package"===c)await(await import("./index.Bfg4lyu-.js")).default({...e});else if("fnet-form"===c)await(await import("./index.Q-CYRcna.js")).default({...e});else if("fnet-node"===c)await(await import("./index.C2S9JYhS.js")).default({...e});else if("fnet-flow"===c)await(await import("./index.BuYxdKtK.js")).default({...e});else if("nextjs"===c)await(await import("./index.CDct_kkF.js")).default({atom:t,target:s,onProgress:r,projectDir:o.projectDir,dependencies:i,context:o,yamlTarget:n}),a.isDirty=!0;else if("webos"===c)await(await import("./index.CMC8mlye.js")).default({atom:t,target:s,onProgress:r,projectDir:o.projectDir,dependencies:i,context:o,yamlTarget:n}),a.isDirty=!0;else if("electron"===c)await(await import("./index.xd8c7XMr.js")).default({atom:t,target:s,onProgress:r,projectDir:o.projectDir,dependencies:i,context:o,yamlTarget:n}),a.isDirty=!0;else if("docker"===c)await(await import("./index.D2N9YZmA.js")).default({atom:t,target:s,onProgress:r,projectDir:o.projectDir,dependencies:i,context:o,yamlTarget:n}),a.isDirty=!0;else if("ios"===c)await(await import("./index.B5XE4ChJ.js")).default({atom:t,target:s,onProgress:r,projectDir:o.projectDir,dependencies:i,context:o,yamlTarget:n}),a.isDirty=!0;else if("macos"===c)await(await import("./index.W6RYgypK.js")).default({atom:t,target:s,onProgress:r,projectDir:o.projectDir,dependencies:i,context:o,yamlTarget:n}),a.isDirty=!0;else if("rust"===c)await(await import("./index.CzAV0S36.js")).default({atom:t,target:s,onProgress:r,projectDir:o.projectDir,dependencies:i,context:o,yamlTarget:n}),a.isDirty=!0;else{if("pypi"!==c)return void console.warn(`No deployer found for type: ${c}`);await(await import("./index.C7saWH6d.js")).default({atom:t,target:s,onProgress:r,projectDir:o.projectDir,dependencies:i,context:o,yamlTarget:n}),a.isDirty=!0}}catch(e){throw console.error(`Error during deployment for type "${c}":`,e),e}};class f{#e;#t;#i;#o;#s;#r;#a;#n;#c;#d;#l;#p;#m;#g;#h;#f;#y;constructor(e){this.#e=new g,this.#t=e,this.#r=[],this.#a=[],this._expire_ttl=3600,this._expire_ttl_short=300,this.#y={packageDependencies:this.#r,packageDevDependencies:this.#a,setProgress:this.setProgress.bind(this),context:this.#t,Atom:n,registerToPackageManager:this.registerToPackageManager.bind(this)}}get apiContext(){return this.#y}get context(){return this.#t}get atom(){return this.#i}get libs(){return this.#s}set libs(e){this.#s=e}get fileMode(){return this.#g}get buildMode(){return this.#h}get deployMode(){return this.#f}async _cache_set(e,t,i){this._redis_client&&await this._redis_client.SETEX(e,i||this._expire_ttl,JSON.stringify(t)).catch(console.error)}async initAuth(){this.#t.id&&(this.#n=await this.#e.init({config:this.#p}),this.#y.atomAccessToken=this.#n)}async initLibrary(){const e=this.#t.id;this.#i=this.#t.project?.libraryAtom||await n.get({id:e});let t=this.#i.doc.bundleName;t=t||(this.#i.doc.name||"").toUpperCase().replace(/[^A-Z0-9]/g,"_"),this.#i.doc.bundleName=t,this.#i.type=this.#i.type||"workflow.lib",this.#y.atom=this.#i}async initLibraryDir(){this.setProgress({message:"Initializing library directory."});const i=this.#t.projectDir;this.setProgress({message:"Cleaning project directory."});const o=d({dir:i,ignore:[".cache","node_modules",".conda",".bin"],absolute:!0});for(const t of o)e.rmSync(t,{recursive:!0,force:!0});this.setProgress({message:"Creating project directory."});let s=i;e.existsSync(s)||e.mkdirSync(s,{recursive:!0}),s=t.join(i,"src"),e.existsSync(s)||e.mkdirSync(s,{recursive:!0}),s=t.join(i,"src","default"),e.existsSync(s)||e.mkdirSync(s,{recursive:!0})}async initNunjucks(){this.setProgress({message:"Initializing nunjucks."});const e=this.#t.templateDir;this.#o=s.configure(e,{watch:!1,dev:!0}),this.#y.njEnv=this.#o}async createProjectYaml(){const i="fnode.yaml",r=`Creating ${i}`;await this.setProgress({message:r});const{content:a,...n}=this.#i.doc,c={content:o.stringify(n)},d=this.#t.templateDir,l=t.resolve(d,`${i}.njk`);if(!e.existsSync(l))throw new Error(`fnode.yaml.njk template not found in ${d}`);const p=s.compile(e.readFileSync(l,"utf8"),this.#o).render(c),m=this.#t.projectDir,g=t.resolve(m,`${i}`);e.writeFileSync(g,p,"utf8")}async deploy(){if(await this.setProgress({message:"Deploying."}),this.#t.project?.devops){const e=[this.#t.project?.devops];for(let t=0;t<e.length;t++){let i=e[t];await this.deployProject({deploymentProject:i}),!0===i.isDirty&&await i.save()}}else if(this.#i.id){const e=await n.list({type:"library.deploy",parent_id:this.#i.id});for(let t=0;t<e.length;t++){let i=e[t];await this.deployProject({deploymentProject:i}),!0===i.isDirty&&(i=await n.update(i,{id:i.id}))}}}async deployProject(e){const{deploymentProject:t}=e,{yamlDocument:i}=t;if(t.doc.targets&&Array.isArray(t.doc.targets))throw new Error("Deployment project targets are deprecated. Please update targets in the yaml file.");const o=Object.keys(t.doc||{}),s=i||{};for(let e=0;e<o.length;e++){const i=t.doc[o[e]];i.name=o[e];const r=s.get(o[e]);await h({...this.#y,deploymentProject:t,deploymentProjectTarget:i,yamlTarget:r})}}async registerToPackageManager(e){const{target:t,packageJSON:i}=e;if(!this.#t.id)return;let o=await n.first({name:t.params.name,parent_id:this.#p.env.ATOM_PACKAGES_ID});o?(o.doc.versions.splice(0,0,{v:i.version}),await n.update(o,{id:o.id})):o=await n.create({parent_id:this.#p.env.ATOM_PACKAGES_ID,doc:{name:t.params.name,type:"pm",versions:[{v:i.version}]}})}async setProgress(e){const t="string"==typeof e?e:e?.message;console.log(r.blue(t)),await this._cache_set(this.#d,{status:"IN_PROGRESS",message:t})}async init(){this._redis_client=await async function(){if(!await p({host:process.env.REDIS_HOST,port:process.env.REDIS_PORT}))return;const e=l.createClient({socket:{host:process.env.REDIS_HOST,port:process.env.REDIS_PORT}});return await e.connect(),e}(),this.#c=this.#t.buildId||i(),this.#y.buildId=this.#c,this.#m=this.#t.mode,this.#g=["all","deploy","build","file"].includes(this.#m),this.#h=["all","deploy","build"].includes(this.#m),this.#f=["all","deploy"].includes(this.#m),this.#l=this.#t.protocol,this.#d="BUILD:"+this.#c,this.#p=(await c({optional:!0,name:this.#t.atomConfig||"atom",dir:this.#t.projectDir,tags:this.#t.tags}))?.data;try{await this.setProgress({message:"Initialization started."}),await this.initAuth(),await this.initLibrary(),await this.initRuntime()}catch(e){throw await this._cache_set(this.#d,{status:"FAILED",message:e?.message||e}),e}}async initRuntime(){throw new Error("initRuntime method must be implemented by runtime-specific builder")}async build(){throw new Error("build method must be implemented by runtime-specific builder")}}async function y({atom:i,setProgress:o,context:r,packageDependencies:a}){await o({message:"Creating .gitignore"});const n={atom:i,packageDependencies:a},c=r.templateDir,d=s.compile(e.readFileSync(t.resolve(c,".gitignore.njk"),"utf8"),s.configure(c)).render(n),l=r.projectDir,p=t.resolve(l,".gitignore");e.writeFileSync(p,d,"utf8")}async function u({atom:i,context:o,setProgress:r,Atom:a}){const n="readme.md",c=`Creating ${n}`;if(await r({message:c}),o.project?.readme){const i=o.projectDir,r={content:o.project.readme.doc.content},a=t.resolve(o.project.projectDir,"fnet/how-to.md");if(e.existsSync(a)){const t=e.readFileSync(a,"utf8");r.howto=t}const c=t.resolve(o.project.projectDir,"fnet/input.yaml");if(e.existsSync(c)){const e=await m({file:c,tags:o.tags});r.input=e.content}const d=t.resolve(o.project.projectDir,"fnet/output.yaml");if(e.existsSync(d)){const e=await m({file:d,tags:o.tags});r.output=e.content}const l=o.templateDir,p=s.compile(e.readFileSync(t.resolve(l,`${n}.njk`),"utf8"),s.configure(l)).render(r),g=t.resolve(i,`${n}`);e.writeFileSync(g,p,"utf8")}else if(i.id){const r=await a.first({type:"wiki",parent_id:i.id});if(!r||"markdown"!==r.doc?.["content-type"])return;const{content:c,...d}=r.doc,l={content:c},p=o.templateDir,m=s.compile(e.readFileSync(t.resolve(p,`${n}.njk`),"utf8"),s.configure(p)).render(l),g=o.projectDir,h=t.resolve(g,`${n}`);e.writeFileSync(h,m,"utf8")}}export{f as B,y as a,u as c};
@@ -1 +0,0 @@
1
- import e from"lodash.merge";import s from"node:fs";import t from"node:path";import a from"@flownet/lib-render-templates-dir";import n from"nunjucks";import o from"@flownet/lib-parse-imports-js";import r from"@fnet/npm-pick-versions";import c from"object-hash";import i from"ajv/dist/2020.js";import p from"ajv/dist/standalone/index.js";import l from"ajv-formats";import f from"@fnet/shelljs";import{w as d}from"./index.js";function u({feature:s,features:t,packageDevDependencies:a}){const{name:n,packages:o,options:r,extraCheck:c,explicit:i}=s,p=`${n}_enabled`,l=t.rollup_output||{},f=Object.keys(l);let d=r||{};const u=t[n]?.options;u&&(d=e(d,u));const m=!t[n]||!1===t[n]?.enabled;f.forEach((e=>{const s=t.rollup_output[e];if(s){if(Reflect.has(s,n)){if(m||!s[n]||!1===s[n]?.enabled)return void delete s[n];!0===s[n]&&(s[n]={enabled:!0,options:d})}else{if(m||i||!1===t[p])return;s[n]={enabled:!0}}s[n]=s[n]||{},s[n].options={...d,...s[n].options}}}));let g=f.some((e=>!0===t.rollup_output[e][n]?.enabled));c&&(g=c()&&g),t[p]=g,g&&o.forEach((e=>a.push({package:e[0],version:e[1]})))}function m(e){const{atom:s,packageDevDependencies:t}=e;u({feature:{name:"string",packages:[["rollup-plugin-string","^3"]]},features:s.doc.features,packageDevDependencies:t})}function g(e){const{atom:s,packageDevDependencies:t}=e;u({feature:{name:"image",packages:[["@rollup/plugin-image","^3"]]},features:s.doc.features,packageDevDependencies:t})}function k(e){const{atom:s,packageDevDependencies:t}=e;u({feature:{name:"json",packages:[["@rollup/plugin-json","^6"]]},features:s.doc.features,packageDevDependencies:t})}function j(e){const{atom:s,packageDevDependencies:t}=e,a=s.doc.features,n={};!0===a.app?.enabled&&(n.targets=n.targets||[],n.targets.push({src:"./src/app/index.html",dest:a.app.dir}),Reflect.has(a.app,"copy")||Reflect.has(a,"copy")||(a.copy=!0)),u({feature:{name:"copy",packages:[["rollup-plugin-copy","^3"],["chokidar","^3"]],options:n},features:a,packageDevDependencies:t})}function v(e){const{atom:s,packageDevDependencies:t}=e,a=s.doc.features,n=a.css&&!1!==a.css.enabled;let o=[];if(n){o.push(["rollup-plugin-postcss","^4"]),o.push(["sass","^1.66"]);(a.css?.options?.plugins||[]).forEach((e=>{switch(e.name){case"postcss-import":o.push(["postcss-import","^15"]);break;case"postcss-url":o.push(["postcss-url","^10"]);break;case"postcss-preset-env":o.push(["postcss-preset-env","^9"]);break;case"autoprefixer":o.push(["autoprefixer","^10"]);break;case"cssnano":o.push(["cssnano","^6"])}}))}u({feature:{name:"css",packages:o},features:a,packageDevDependencies:t})}async function D({atom:e,setProgress:n,context:o,packageDependencies:r}){if(!0!==e.doc.features.app.enabled)return;await n({message:"Creating app folder"});const c={atom:e,packageDependencies:r,ts:Date.now()},i=o.templateDir,p=t.resolve(o.projectDir,"src/app");s.existsSync(p)||s.mkdirSync(p,{recursive:!0});let l=["index.js.njk"];!1!==e.doc.features.app.html&&l.push("index.html.njk"),await a({pattern:l,dir:t.resolve(i,"src/app"),outDir:p,context:c})}async function h({projectDir:e,name:a,setProgress:n,count:o=1}){let i;const p=c(["npm-pick-versions",a,o]),l=t.join(e,".cache"),f=t.join(l,p+".json");return s.existsSync(f)?(n&&n(`Picking npm version of ${a} from cache ...`),i=JSON.parse(s.readFileSync(f,"utf8"))):(n&&n(`Picking npm version of ${a} ...`),i=await r({name:a,count:o}),s.mkdirSync(l,{recursive:!0}),s.writeFileSync(f,JSON.stringify(i),"utf8")),i}async function y({atom:e,context:a,packageDependencies:r,packageDevDependencies:c,setProgress:i}){await i({message:"Creating package.json."});r.filter((e=>!0===e.dev)).forEach((e=>{c.find((s=>s.package===e.package))||c.push(e);const s=r.findIndex((s=>s.package===e.package));r.splice(s,1)}));const p=r.find((e=>"react"===e.package)),l=r.find((e=>"react-dom"===e.package));p&&!l?r.push({package:"react-dom",version:p.version}):p&&l&&(l.version=p.version),p&&e.doc.features.react_version>=17&&(r.find((e=>"@emotion/react"===e.package))||r.push({package:"@emotion/react",version:"^11"}),r.find((e=>"@emotion/styled"===e.package))||r.push({package:"@emotion/styled",version:"^11"}));const f=[];!0===e.doc.features.app.enabled&&f.push({file:t.resolve(a.projectDir,"src/app/index.js"),dev:!1!==e.doc.features.app.dev}),!0===e.doc.features.cli.enabled&&f.push({file:t.resolve(a.projectDir,"src/cli/index.js"),dev:!1!==e.doc.features.cli.dev});for await(const e of f){const t=e.file;if(!s.existsSync(t))throw new Error(`App file not found: ${t}`);const n=(await o({file:t,recursive:!0})).all;for await(const s of n){if("npm"!==s.type)continue;if(r.find((e=>e.package===s.package)))continue;if(c.find((e=>e.package===s.package)))continue;const t=await h({name:s.package,projectDir:a.projectDir,setProgress:i});(!0===e.dev?c:r).push({package:s.package,subpath:s.subpath,version:t.minorRange,type:"npm"})}}const d={atom:e,packageDependencies:r,packageDevDependencies:c},u=a.templateDir,m=n.compile(s.readFileSync(t.resolve(u,"package.json.njk"),"utf8"),n.configure(u)).render(d),g=a.projectDir,k=t.resolve(g,"package.json");s.writeFileSync(k,m,"utf8");const j=t.resolve(a.project.projectDir,"fnet");if(s.existsSync(j)){const e=t.resolve(a.projectDir,"fnet");s.existsSync(e)||s.mkdirSync(e);const n=s.readdirSync(j);for(const a of n){const n=t.resolve(j,a);if(!s.lstatSync(n).isFile())continue;const o=t.resolve(e,a);s.copyFileSync(n,o)}}}async function w({atom:e,setProgress:n,context:o,packageDependencies:r}){if(!0!==e.doc.features.cli.enabled)return;await n({message:"Creating cli."});const c={atom:e,packageDependencies:r},i=o.templateDir,p=t.resolve(o.projectDir,"src/cli");s.existsSync(p)||s.mkdirSync(p,{recursive:!0}),await a({pattern:["index.js.njk"],dir:t.resolve(i,"src/cli"),outDir:p,context:c})}async function b({atom:e,setProgress:a,context:o,njEnv:r}){if(!0!==e.doc.features.cli.enabled)return;await a({message:"Creating yargs."});let c={};if(c=e.doc.input?e.doc.input:{type:"object",properties:{},required:[]},e.doc.features.cli.fargs&&!1!==e.doc.features.cli.fargs?.enabled){const s=e.doc.features.cli.fargs,t={type:"string",description:"Config name to load args",hidden:!1},a={type:"array",description:"Tags to filter the config",hidden:!1};Reflect.has(s,"default")&&(t.default=s.default),c.properties&&(c.properties.fargs=t,c.properties.ftag=a)}const f={options:c,imports:[],atom:e},d=o.templateDir,u=n.compile(s.readFileSync(t.resolve(d,"src/default/to.args.js.njk"),"utf8"),r).render(f),m=o.projectDir,g=t.resolve(m,"src/default/to.args.js");s.writeFileSync(g,u,"utf8");const k=new i({allErrors:!0,useDefaults:!0,formats:{},strict:!1,code:{esm:!0,lines:!0,optimize:!1,source:!0}});l(k);const j=k.compile(c),v=p(k,j);s.writeFileSync(t.resolve(m,"src/default/validate_input.js"),v,"utf8")}async function x({atom:e,setProgress:a,context:o,packageDependencies:r}){await a({message:"Creating tsconfig.json."});const c={atom:e,packageDependencies:r},i=o.templateDir,p=n.compile(s.readFileSync(t.resolve(i,"tsconfig.json.njk"),"utf8"),n.configure(i)).render(c),l=o.projectDir,f=t.resolve(l,"tsconfig.json");s.writeFileSync(f,p,"utf8")}async function S({setProgress:e,context:s}){const a=s.projectDir;await e({message:"Prettifiying source files."});let n=t.join("src","**","*");if(d("bun")){const e=await f(`prettier --write ${n} *.{js,cjs,mjs,json,yaml,html} --no-error-on-unmatched-pattern`,{cwd:a});if(0!==e.code)throw new Error(e.stderr)}else{const e=await f(`prettier --write ${n} *.{js,cjs,mjs,json,yaml,html} --no-error-on-unmatched-pattern`,{cwd:a});if(0!==e.code)throw new Error(e.stderr)}}async function P({setProgress:e,atom:s,context:t}){const a=t.projectDir;if(await e({message:"Installing npm packages."}),d("bun")){if(0!==(await f(`bun install ${s.doc.features.npm_install_flags}`,{cwd:a})).code)throw new Error("Couldnt install npm packages.")}else{if(0!==(await f(`npm install ${s.doc.features.npm_install_flags}`,{cwd:a})).code)throw new Error("Couldnt install npm packages.")}}async function E({setProgress:e,context:s}){const t=s.projectDir;await e({message:"Building main project."});if(0!==(await f("npm run build",{cwd:t})).code)throw new Error("Couldnt build project.")}export{j as a,k as b,m as c,g as d,x as e,u as f,b as g,w as h,v as i,D as j,y as k,S as l,P as m,h as p,E as r};
@@ -1 +0,0 @@
1
- {{content | safe}}
@@ -1 +0,0 @@
1
- {{content | safe}}
@@ -1 +0,0 @@
1
- {{content | safe}}
@@ -1 +0,0 @@
1
- {{content | safe}}
@@ -1,8 +0,0 @@
1
-
2
- {% if value.external_enabled %}
3
- external: [
4
- {% for external in value.external %}
5
- "{{external}}" {% if not loop.last %},{% endif %}
6
- {% endfor %}
7
- ],
8
- {% endif %}
@@ -1,9 +0,0 @@
1
- onwarn(warning, warn) {
2
- switch (warning.code) {
3
- case 'MODULE_LEVEL_DIRECTIVE':
4
- case 'CIRCULAR_DEPENDENCY':
5
- return;
6
- default:
7
- warn(warning);
8
- }
9
- },
@@ -1,3 +0,0 @@
1
- {% if value.banner %}
2
- banner:'{{value.banner}}',
3
- {% endif %}
@@ -1,5 +0,0 @@
1
- {% if value.format==='iife' %}
2
- {% if atom.type==='workflow'%}
3
- {# footer: "new {{atom.doc.bundleName}}().run().catch(e=>{});" #}
4
- {% endif %}
5
- {% endif %}
@@ -1,9 +0,0 @@
1
- {% if value.browser===true %}
2
- {% if value.globals.length %}
3
- globals: {
4
- {% for global in value.globals %}
5
- "{{global.key}}":"{{global.value}}" {% if not loop.last %},{% endif %}
6
- {% endfor %}
7
- },
8
- {% endif %}
9
- {% endif %}
@@ -1,3 +0,0 @@
1
- {% if value.format==='iife' or value.format==='umd'%}
2
- name: "{{atom.doc.bundleName}}",
3
- {% endif %}
@@ -1,90 +0,0 @@
1
- plugins: await initPlugins({
2
- delete:{ targets: [path.normalize(groupDir + '{{key}}')], runOnce: DEVELOPMENT },
3
-
4
- format:"{{ value.format }}",
5
-
6
- {% if value.babel===true %}
7
- babel:{{value.babel_options | dump | safe}},
8
- {% endif %}
9
-
10
- {% if value.replace ===true %}
11
- replace:{{value.replace_options | dump | safe}},
12
- {% endif %}
13
-
14
- {% if value.browser===true %}
15
- browser:true,
16
- {% endif %}
17
-
18
- {% if value.browsersync===true and atom.doc.features.browsersync_enabled===true%}
19
- browsersync: {{value.browsersync_options | dump | safe}},
20
- {% endif %}
21
-
22
- {% if value.alias_enabled===true %}
23
- alias:{{value.alias | dump | safe}},
24
- {% endif %}
25
-
26
- {# OK #}
27
- {% if value.css %}
28
- postcss:{{value.css | dump | safe}},
29
- {% endif %}
30
-
31
- {# OK #}
32
- {% if value.copy %}
33
- copy:{{value.copy | dump | safe}},
34
- {% endif %}
35
-
36
- {# OK #}
37
- {% if value.terser%}
38
- terser:{{value.terser | dump | safe}},
39
- {% endif %}
40
-
41
- {# OK #}
42
- {% if value.json %}
43
- json:{{value.json | dump | safe}},
44
- {% endif %}
45
-
46
- {# OK #}
47
- {% if value.wasm %}
48
- wasm: {{value.wasm | dump | safe}},
49
- {% endif %}
50
-
51
- {# OK #}
52
- {% if value.string %}
53
- string:{{value.string | dump | safe}},
54
- {% endif %}
55
-
56
- {# OK #}
57
- {% if value.image %}
58
- image:{{value.image | dump | safe}},
59
- {% endif %}
60
-
61
- {# OK #}
62
- {% if value.analyzer %}
63
- analyzer:{{value.analyzer | dump | safe}},
64
- {% endif %}
65
-
66
- {# OK #}
67
- {% if value.visualizer %}
68
- visualizer:{{value.visualizer | dump | safe}},
69
- {% endif %}
70
-
71
- {# OK #}
72
- {% if value.polyfill %}
73
- polyfill:{{value.polyfill | dump | safe}},
74
- {% endif %}
75
-
76
- {# OK #}
77
- {% if value.nunjucks %}
78
- nunjucks:{{value.nunjucks | dump | safe}},
79
- {% endif %}
80
-
81
- {# OK #}
82
- {% if value.workbox %}
83
- workbox:{{value.workbox | dump | safe}},
84
- {% endif %}
85
-
86
- {# OK #}
87
- {% if value.gzip %}
88
- gzip:{{value.gzip | dump | safe}},
89
- {% endif %}
90
- }),
@@ -1 +0,0 @@
1
- {{content | safe}}
@@ -1 +0,0 @@
1
- {{content | safe}}
@@ -1,8 +0,0 @@
1
-
2
- {% if value.external_enabled %}
3
- external: [
4
- {% for external in value.external %}
5
- "{{external}}" {% if not loop.last %},{% endif %}
6
- {% endfor %}
7
- ],
8
- {% endif %}
@@ -1,9 +0,0 @@
1
- onwarn(warning, warn) {
2
- switch (warning.code) {
3
- case 'MODULE_LEVEL_DIRECTIVE':
4
- case 'CIRCULAR_DEPENDENCY':
5
- return;
6
- default:
7
- warn(warning);
8
- }
9
- },
@@ -1,3 +0,0 @@
1
- {% if value.banner %}
2
- banner:'{{value.banner}}',
3
- {% endif %}
@@ -1,5 +0,0 @@
1
- {% if value.format==='iife' %}
2
- {% if atom.type==='workflow'%}
3
- {# footer: "new {{atom.doc.bundleName}}().run().catch(e=>{});" #}
4
- {% endif %}
5
- {% endif %}
@@ -1,9 +0,0 @@
1
- {% if value.browser===true %}
2
- {% if value.globals.length %}
3
- globals: {
4
- {% for global in value.globals %}
5
- "{{global.key}}":"{{global.value}}" {% if not loop.last %},{% endif %}
6
- {% endfor %}
7
- },
8
- {% endif %}
9
- {% endif %}
@@ -1,3 +0,0 @@
1
- {% if value.format==='iife' or value.format==='umd'%}
2
- name: "{{atom.doc.bundleName}}",
3
- {% endif %}