Skip to content

Commit

Permalink
Merge 0fb58d6 into 13125c3
Browse files Browse the repository at this point in the history
  • Loading branch information
trustmaster committed Jul 24, 2020
2 parents 13125c3 + 0fb58d6 commit 9558e53
Show file tree
Hide file tree
Showing 97 changed files with 15,746 additions and 14,793 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
bin/*.js
/lib/
/_site/
spec/*.js
spec/browser/*.js
spec/result.xml
spec/runner.html
server/static/js/*.js
Expand Down
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ NoFlo ChangeLog

## 1.2.0 (git master)

* Ported NoFlo from CoffeeScript to ES6
* Deprecated constructing networks with `new noflo.Network`. Use `noflo.createNetwork` instead, with the following options available:
- `subscribeGraph: true`: Uses `LegacyNetwork` which modifies network topology based on changes in graph. This can cause some types of errors to be silent.
- `subscribeGraph: false`: Uses `Network`: network topology can be changed with network's methods (`addNode`, `removeEdge`, etc) and will be also written to the graph.
For backwards compatibility reasons, `subscribeGraph` defaults to `true`. Adapt your applications to use `false` instead and start utilizing Network methods for any changes to a running graph.
* Added support for a more standard `noflo.createNetwork(graph, options, callback)` signature, with backwards compatibility for the legacy `noflo.createNetwork(graph, callback, options)` signature
* Removed support for `noflo.WirePattern`. WirePattern has been deprecated since 1.0, and all code using it should be migrated to the latest Process API
* Removed support for changing component icon and description statically (on class level) at run-time (i.e. `ComponentName::icon = 'new-icon'`). Component icon and description should be set in class constructor or in `getComponent` instead. Changing icon and description for a specific instance (process) is not affected and is fully supported

## 1.1.3 (April 12th 2018)

Expand Down
150 changes: 0 additions & 150 deletions Gruntfile.coffee

This file was deleted.

138 changes: 138 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
module.exports = function() {
// Project configuration
this.initConfig({
pkg: this.file.readJSON('package.json'),

// Copy plain JS files
babel: {
options: {
presets: ['env']
},
dist: {
files: [{
cwd: 'src/lib/',
src: ['**/*.js'],
dest: 'lib/',
expand: true,
ext: '.js'
}
, {
cwd: 'src/components/',
src: ['**/*.js'],
dest: 'components/',
expand: true,
ext: '.js'
}
]
}
},

// Browser build of NoFlo
noflo_browser: {
options: {
baseDir: './',
webpack: {
module: {
rules: [{
test: /\.js$/,
use: [{
loader: 'babel-loader',
options: {
presets: ['env']
}
}
]
}
]
}
}
},
build: {
files: {
'browser/noflo.js': ['spec/fixtures/entry.js']
}
}
},

// BDD tests on Node.js
mochaTest: {
nodejs: {
src: ['spec/*.js'],
options: {
reporter: 'spec',
grep: process.env.TESTS
}
}
},

// Web server for the browser tests
connect: {
server: {
options: {
port: 8000
}
}
},

// Generate runner.html
noflo_browser_mocha: {
all: {
options: {
scripts: [
"../browser/<%=pkg.name%>.js",
"https://cdnjs.cloudflare.com/ajax/libs/coffee-script/1.7.1/coffee-script.min.js"
]
},
files: {
'spec/runner.html': ['spec/*.js']
}
}
},
// BDD tests on browser
mocha_phantomjs: {
all: {
options: {
output: 'spec/result.xml',
reporter: 'spec',
urls: ['http://localhost:8000/spec/runner.html'],
failWithOutput: true
}
}
}
});

// Grunt plugins used for building
this.loadNpmTasks('grunt-babel');
this.loadNpmTasks('grunt-noflo-browser');

// Grunt plugins used for testing
this.loadNpmTasks('grunt-contrib-connect');
this.loadNpmTasks('grunt-mocha-test');
this.loadNpmTasks('grunt-mocha-phantomjs');

// Our local tasks
this.registerTask('build', 'Build NoFlo for the chosen target platform', target => {
if (target == null) { target = 'all'; }
this.task.run('babel');
if ((target === 'all') || (target === 'browser')) {
this.task.run('noflo_browser');
}
});

this.registerTask('test', 'Build NoFlo and run automated tests', target => {
if (target == null) { target = 'all'; }
this.task.run(`build:${target}`);
if ((target === 'all') || (target === 'nodejs')) {
// The components directory has to exist for Node.js 4.x
this.file.mkdir('components');
this.task.run('mochaTest');
}
if ((target === 'all') || (target === 'browser')) {
this.task.run('noflo_browser_mocha');
this.task.run('connect');
// this.task.run('mocha_phantomjs');
}
});

this.registerTask('default', ['test']);
};
19 changes: 0 additions & 19 deletions examples/http/HelloController.coffee

This file was deleted.

25 changes: 25 additions & 0 deletions examples/http/HelloController.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
const noflo = require("noflo");

exports.getComponent = () => {
const c = new noflo.Component;
c.description = "Simple controller that says hello, user";
c.inPorts.add('in',
{datatype: 'object'});
c.outPorts.add('out',
{datatype: 'object'});
c.outPorts.add('data',
{datatype: 'object'});
c.process((input, output) => {
if (!input.hasData('in')) { return; }
const request = input.getData('in');
output.sendDone({
out: request,
data: {
locals: {
string: `Hello, ${request.req.remoteUser}`
}
}
});
});
return c;
};
33 changes: 0 additions & 33 deletions examples/http/hello.coffee

This file was deleted.

Loading

0 comments on commit 9558e53

Please sign in to comment.