Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
111 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "airbnb-base" | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
module.exports = function tasks() { | ||
// Project configuration | ||
const pkg = this.file.readJSON('package.json'); | ||
const repo = pkg.repository.url.replace('git://', `https://${process.env.GH_TOKEN}@`); | ||
this.initConfig({ | ||
pkg: this.file.readJSON('package.json'), | ||
// Browser build of NoFlo | ||
noflo_browser: { | ||
build: { | ||
options: { | ||
debug: true, | ||
exposed_modules: { | ||
noflo: 'noflo', | ||
'noflo-runtime-postmessage': 'noflo-runtime-postmessage', | ||
}, | ||
}, | ||
files: { | ||
'browser/<%=pkg.name%>.js': ['package.json'], | ||
}, | ||
}, | ||
}, | ||
// Deployment to GitHub Pages | ||
'gh-pages': { | ||
options: { | ||
base: 'browser', | ||
clone: 'gh-pages', | ||
message: `Release ${pkg.name} ${process.env.TRAVIS_TAG}`, | ||
repo, | ||
user: { | ||
name: 'NoFlo bot', | ||
email: 'bot@noflo.org', | ||
}, | ||
silent: true, | ||
}, | ||
src: '**/*', | ||
}, | ||
}); | ||
// Grunt plugins used for building | ||
this.loadNpmTasks('grunt-noflo-browser'); | ||
// Grunt plugins used for deploying | ||
this.loadNpmTasks('grunt-gh-pages'); | ||
// Our local tasks | ||
this.registerTask('build', 'Build NoFlo for the chosen target platform', (target = 'all') => { | ||
if (target === 'all' || target === 'browser') { | ||
this.task.run('noflo_browser'); | ||
} | ||
}); | ||
this.registerTask('default', ['build']); | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
const noflo = require('noflo'); | ||
|
||
exports.getComponent = () => { | ||
const c = new noflo.Component(); | ||
// Define a meaningful icon for component from http://fontawesome.io/icons/ | ||
c.icon = 'cog'; | ||
// Provide a description on component usage | ||
c.description = 'do X'; | ||
// Add input ports | ||
c.inPorts.add('in', { | ||
datatype: 'string', | ||
}); | ||
// Add output ports | ||
c.outPorts.add('out', { | ||
datatype: 'string', | ||
}); | ||
// What to do when port receives a packet | ||
c.process((input, output) => { | ||
// Check that input has received data packet | ||
if (!input.hasData('in')) { | ||
return; | ||
} | ||
// Read the contents of the data packet | ||
const data = input.getData('in'); | ||
// Send the contents to output port | ||
output.send({ | ||
out: data, | ||
}); | ||
// Finish processing | ||
output.done(); | ||
}); | ||
return c; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
topic: "DoSomething" | ||
cases: | ||
- | ||
name: 'sending a boolean' | ||
assertion: 'should repeat the same' | ||
inputs: | ||
in: true | ||
expect: | ||
out: | ||
equals: true | ||
- | ||
name: 'sending a number' | ||
assertion: 'should repeat the same' | ||
inputs: | ||
in: 1000 | ||
expect: | ||
out: | ||
equals: 1000 | ||
- | ||
name: 'sending a string' | ||
assertion: 'should repeat the same' | ||
inputs: | ||
in: "my string" | ||
expect: | ||
out: | ||
equals: "my string" |