From 982a8152a3d7d6cb363fc90630ea3fa4fcefa0dc Mon Sep 17 00:00:00 2001 From: Kevin Jahns Date: Tue, 23 Feb 2016 15:55:40 +0100 Subject: [PATCH] updated package.json, major version upgrade, added peerDependencies --- .gitignore | 1 + LICENSE | 21 ++++++++++++++++++++ README.md | 56 ++++++++++++++++++++-------------------------------- bower.json | 27 ------------------------- dist | 2 +- package.json | 9 +++++++-- 6 files changed, 51 insertions(+), 65 deletions(-) create mode 100644 LICENSE delete mode 100644 bower.json diff --git a/.gitignore b/.gitignore index 383bd88..13da293 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ build_test /y.js /y.js.map /y-* +.vscode \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..fa48ced --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Kevin Jahns . + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 88096ff..8b53b84 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ # WebRTC Connector for [Yjs](https://github.com/y-js/yjs) - It propagates document updates directly to all users via WebRTC. While WebRTC is not the most reliable connector, messages are propagated with almost no delay. * Very fast message propagation (not noticeable) @@ -18,52 +17,39 @@ Retrieve this with bower or npm, and use it as a js library or as a custom polym ``` npm install y-webrtc --save ``` -and put it on the `Y` object. - -``` -Y.WebRTC = require("y-webrtc"); -``` ##### Bower ``` bower install y-webrtc --save ``` -##### Polymer -On the website you find a bunch of examples on how you can use Yjs as polymer element. -``` - - -``` - -### Create the connection object -This connector uses [SimpleWebRTC](https://simplewebrtc.com/) as an underlaying WebRTC framework, which supports the concept of rooms. - -``` -var options = {}; -var conn = new Y.WebRTC("my_room_name", options); // will connect to the default signaling server -``` - -On the options object you can put the following properties: -* url (optional) - * Set the url of your signaling server. E.g. url = "https://yatta.ninja:8888" (which is the default endpoint) -* debug (optional) - * Whether to enable debugging mode (defaults to false) - # Start Hacking This connector is also a nice starting point to build your own connector. The only 75 SLOCs of code are pretty well documented and understandable. If you have any troubles, don't hesitate to ask me for help! -### Directory Structure -* lib/ - * Source files -* build/browser - * Unminified, but [browserified](http://browserify.org/) source files -* build/node - * npm modules +### Example +``` +Y({ + db: { + name: 'memory' + }, + connector: { + name: 'webrtc', // choose the webrtc connector + room: 'Textarea-example-dev' + }, + sourceDir: '/bower_components', // location of the y-* modules + share: { + textarea: 'Text' // y.share.textarea is of type Y.Text + } + // types: ['Richtext', 'Array'] // optional list of types you want to import +}).then(function (y) { + // bind the textarea to a shared text element + y.share.textarea.bind(document.getElementById('textfield')) +} +``` ## License -Yjs is licensed under the [MIT License](./LICENSE.txt). +Yjs is licensed under the [MIT License](./LICENSE). diff --git a/bower.json b/bower.json deleted file mode 100644 index c89be21..0000000 --- a/bower.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "y-webrtc", - "main": "y-webrtc.js", - "version": "0.7.2", - "homepage": "http://y-js.org", - "authors": [ - "Kevin Jahns " - ], - "description": "WebRTC connector for Yjs", - "moduleType": [ - "globals", - "node" - ], - "keywords": [ - "Yjs", - "connector", - "webrtc" - ], - "license": "MIT", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ] -} diff --git a/dist b/dist index bdfd830..9b0cd58 160000 --- a/dist +++ b/dist @@ -1 +1 @@ -Subproject commit bdfd830cb9e8c164c1fd8264b849d91643695d50 +Subproject commit 9b0cd580c4e9fe52e28a786dae14c185890d275f diff --git a/package.json b/package.json index e095598..693717e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "y-webrtc", - "version": "0.7.2", + "version": "8.0.0", "description": "WebRTC Connector for Yjs", "main": "./src/WebRTC.js", "scripts": { @@ -25,7 +25,12 @@ }, "keywords": [ "Yjs", - "Connector" + "OT", + "Collaboration", + "Synchronization", + "ShareJS", + "Coweb", + "Concurrency" ], "author": "Kevin Jahns ", "license": "MIT",