Skip to content

Commit

Permalink
road to 4.0.0, if tests ok
Browse files Browse the repository at this point in the history
  • Loading branch information
folkvir authored and Callidon committed Oct 17, 2017
1 parent ede5fbd commit dd7668e
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 41 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ Creates a new HTML file and insert the **foglet bundle** in it:
<script src="node_modules/foglet-core/dist/foglet.bundle.js" type="text/javascript"></script>
```

Then, requires the Foglet library:
Then, foglet library is available in the variable `foglet` :
```javascript
const Foglet = require("foglet").Foglet
const FogletClass = foglet.Foglet;
```

If you do not provide a list of **ice servers**, your example will work in localhost but not on the Web.
Expand All @@ -55,10 +55,10 @@ To be begin with, let's write a simple piece of JS code:
localStorage.debug = 'foglet-core:*';
const Foglet = require('foglet').Foglet;
const Foglet = foglet.Foglet;
// let's create a simple application that send message in broadcast
const foglet = new Foglet({
const fog = new Foglet({
rps: {
type: 'spray-wrtc', // we choose Spray as a our RPS
options: {
Expand All @@ -76,17 +76,17 @@ To be begin with, let's write a simple piece of JS code:
});
// connect the foglet to the signaling server
foglet.share();
fog.share();
// Connect the foglet to our network
foglet.connection().then(() => {
fog.connection().then(() => {
// listen for broadcast messages
foglet.onBroadcast((id, message) => {
fog.onBroadcast((id, message) => {
console.log('The peer', id, 'just sent me by broadcast:', message);
});
// send a message in broadcast
foglet.sendBroadcast('Hello World !');
fog.sendBroadcast('Hello World !');
});
</script>
```
Expand Down
3 changes: 2 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ before_test:


test_script:
- npm test
- npm run build
- npm run test

# Don't actually build.
build: off
44 changes: 22 additions & 22 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 4 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
{
"name": "foglet-core",
"version": "3.1.1",
"version": "4.0.0",
"description": "Core of the foglet library",
"main": "./foglet-core.js",
"scripts": {
"lint": "eslint src/",
"esdoc": "esdoc && npm run esdoc:example",
"esdoc:example": "cp -R ./dist ./docs",
"all": "npm run build:foglet && npm run build:foglet-min && npm test && npm run esdoc",
"esdoc": "esdoc",
"all": "npm run build && npm test && npm run esdoc",
"test": "foglet-scripts test",
"server": "foglet-scripts start",
"build:foglet": "mkdir -p dist/ && browserify -r ./foglet-core.js:foglet -t [ babelify --presets [ env ] ] > ./dist/foglet.bundle.js",
"build:watch": "mkdir -p dist/ && watchify -r ./foglet-core.js:foglet -t [ babelify --presets [ env ] ] -o ./dist/foglet.bundle.js -v -d ",
"build:foglet-min": "mkdir -p dist/ && browserify -r ./foglet-core.js:foglet -t [ babelify --presets [ env ] ] | uglifyjs -c > ./dist/foglet.bundle.min.js",
"wbuild:foglet": "browserify -r ./foglet-core.js:foglet -t [ babelify --presets [ env ] ] > ./dist/foglet.bundle.js",
"wbuild:watch": "watchify -r ./foglet-core.js:foglet -t [ babelify --presets [ env ] ] -o ./dist/foglet.bundle.js -v -d ",
"wbuild:foglet-min": "browserify -r ./foglet-core.js:foglet -t [ babelify --presets [ env ] ] | uglifyjs -c > ./dist/foglet.bundle.min.js"
"build": "foglet-scripts build"
},
"repository": {
"type": "git",
Expand Down
File renamed without changes.

0 comments on commit dd7668e

Please sign in to comment.