Skip to content

Commit

Permalink
Release 0.2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
bergie committed Sep 17, 2020
1 parent d3ed90e commit 9747f5c
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -82,7 +82,7 @@ It is possible to extend the manifest files with custom runtime-specific informa

## Changes

* 0.2.3 (2020-09-17)
* 0.2.4 (2020-09-17)
- Fixed a minor bug with collecting NoFlo graphs
* 0.2.2 (2020-09-17)
- Added support for finding NoFlo TypeScript components
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "fbp-manifest",
"version": "0.2.3",
"version": "0.2.4",
"description": "Flow-Based Programming Manifest tools",
"main": "index.js",
"scripts": {
Expand Down
17 changes: 17 additions & 0 deletions spec/fixtures/noflo-basic/graphs/ExampleSubgraph.json
@@ -0,0 +1,17 @@
{
"caseSensitive": false,
"properties": {
"name": "ExampleSubgraph",
"description": "",
"icon": "adjust",
"main": false,
"environment": {
"type": "noflo-nodejs"
}
},
"inports": {},
"outports": {},
"groups": [],
"processes": {},
"connections": []
}
17 changes: 17 additions & 0 deletions spec/fixtures/noflo-basic/graphs/ExampleSubgraphBrowser.json
@@ -0,0 +1,17 @@
{
"caseSensitive": false,
"properties": {
"name": "ExampleSubgraph",
"description": "",
"icon": "adjust",
"main": false,
"environment": {
"type": "noflo-browser"
}
},
"inports": {},
"outports": {},
"groups": [],
"processes": {},
"connections": []
}
8 changes: 5 additions & 3 deletions spec/list.js
Expand Up @@ -22,19 +22,21 @@ describe('Listing components', () => {
},
(err, modules) => {
if (err) { return done(err); }
chai.expect(modules.length).to.equal(2);
chai.expect(modules.length).to.equal(3);
const [common] = Array.from(modules.filter(m => m.runtime === 'noflo'));
chai.expect(common).to.be.an('object');
chai.expect(common.components[0].name).to.equal('Foo');
const [nodejs] = Array.from(modules.filter(m => m.runtime === 'noflo-nodejs'));
chai.expect(nodejs).to.be.an('object');
chai.expect(nodejs.components.length).to.equal(3);
chai.expect(nodejs.components.length).to.equal(4);
chai.expect(nodejs.components[0].name).to.equal('Bar');
chai.expect(nodejs.components[0].elementary).to.equal(true);
chai.expect(nodejs.components[1].name).to.equal('Baz');
chai.expect(nodejs.components[1].elementary).to.equal(true);
chai.expect(nodejs.components[2].name).to.equal('Hello');
chai.expect(nodejs.components[2].name).to.equal('ExampleSubgraph');
chai.expect(nodejs.components[2].elementary).to.equal(false);
chai.expect(nodejs.components[3].name).to.equal('Hello');
chai.expect(nodejs.components[3].elementary).to.equal(false);
return done();
});
});
Expand Down
8 changes: 6 additions & 2 deletions src/runtimes/noflo.js
Expand Up @@ -108,7 +108,11 @@ function listGraphs(componentDir, options, callback) {
}
component.runtime = null;
if (graph.properties && graph.properties.environment) {
component.runtime = graph.properties.environment;
if (graph.properties.environment.type) {
component.runtime = graph.properties.environment.type;
} else {
component.runtime = graph.properties.environment;
}
}
if (graph.properties != null ? graph.properties.main : undefined) {
if (!component.noflo) { component.noflo = {}; }
Expand All @@ -126,7 +130,7 @@ function listGraphs(componentDir, options, callback) {
// Don't register "main" graphs as modules
if (c.noflo != null ? c.noflo.main : undefined) { return false; }
// Skip non-supported runtimes
return Array.from(supportedRuntimes).includes(c.runtime);
return supportedRuntimes.includes(c.runtime);
}))).nodeify((err, components) => {
if (err && (err.code === 'ENOENT')) { return callback(null, []); }
if (err) { return callback(err); }
Expand Down

0 comments on commit 9747f5c

Please sign in to comment.