Skip to content

Commit

Permalink
cleanup before release
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Oberstein committed May 15, 2016
1 parent 48db08c commit 10e21c2
Show file tree
Hide file tree
Showing 20 changed files with 109 additions and 546 deletions.
6 changes: 3 additions & 3 deletions DEVELOPERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ Update 'package/package.json' with the new release number.

### Build for browsers

In the root directory, do
In the root directory, do

```
make all
```
```

which will package the library for browser use into the `build` directory.

Expand Down Expand Up @@ -61,7 +61,7 @@ In the `package` directory do
make publish
```

(This requires your npm user to have publishing priviledges for the package on npm.)
(This requires your npm user to have publishing privileges for the package on npm.)


### Copy over to AutobahnJSbuilt
Expand Down
2 changes: 1 addition & 1 deletion LICENSE → LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2011-2014 Tavendo GmbH.
Copyright (C) Tavendo GmbH and contributors.

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
Expand Down
58 changes: 19 additions & 39 deletions SConstruct
Original file line number Diff line number Diff line change
@@ -1,21 +1,3 @@
###############################################################################
##
## Copyright (C) 2012-2014 Tavendo GmbH
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
##
###############################################################################

import os
import json
import pkg_resources
Expand All @@ -26,71 +8,69 @@ env = Environment(tools = ['default', 'taschenmesser'],
toolpath = [taschenmesser],
ENV = os.environ)

## Get package version
##
# Get package version
version = json.load(open('package/package.json'))['version']
print("Building AutobahnJS {}".format(version))

env['JS_DEFINES'] = {
# 'AUTOBAHNJS_VERSION': "'%s'" % version
}

## Source for Autobahn package
##
# Source for Autobahn package
sourcedir = 'package/lib'
sources = [os.path.join(sourcedir, d) for d in os.listdir(sourcedir)]

## browserified
# browserified
ab = env.Command("build/autobahn.js",
"package/lib/autobahn.js",
"browserify $SOURCE --standalone autobahn -o $TARGET")
Depends(ab, sources)

## minimized (with Google Closure)
# minimized (with Google Closure)
ab_min = env.JavaScript("build/autobahn.min.js",
ab,
#JS_COMPILATION_LEVEL = "ADVANCED_OPTIMIZATIONS")
JS_COMPILATION_LEVEL = "SIMPLE_OPTIMIZATIONS")

## minimized & compressed
# minimized & compressed
ab_min_gz = env.GZip("build/autobahn.min.jgz",
ab_min)


## List of generated artifacts
##
# list of generated artifacts
artifacts = [ab,
ab_min,
ab_min_gz]

## Generate checksum files
##
# generate checksum files
checksums = []
checksums.append(env.MD5("build/CHECKSUM.MD5", artifacts))
checksums.append(env.SHA1("build/CHECKSUM.SHA1", artifacts))
checksums.append(env.SHA256("build/CHECKSUM.SHA256", artifacts))

## The default target consists of all artifacts that
## would get published
##
uploads = artifacts + checksums
# fixed static files to be included
statics = []
for f in ["LICENSE.md", "package.json"]:
statics.append(Command("build/{}".format(f), [], Copy("$TARGET", f)))

# The default target consists of all artifacts that
# would get published
uploads = artifacts + checksums + statics
Default(uploads)
#Default(ab)

## Upload to Amazon S3
##
# Upload to Amazon S3
env['S3_BUCKET'] = 'autobahn'
env['S3_OBJECT_ACL'] = 'public-read'

published = []

for s in ['latest', version]:
e = env.Clone(S3_BUCKET_PREFIX = 'autobahnjs/{}/'.format(s)) # note the trailing slash!
published.append(AlwaysBuild(e.S3("build/.S3UploadDone_{}".format(s), uploads)))
e = env.Clone(S3_BUCKET_PREFIX = 'autobahnjs/{}/'.format(s)) # note the trailing slash!
published.append(AlwaysBuild(e.S3("build/.S3UploadDone_{}".format(s), uploads)))


## The uploaded stuff is always considered stale
##
# The uploaded stuff is always considered stale
Depends(published, uploads)

Alias("publish", published)
21 changes: 0 additions & 21 deletions autobahnjs.sublime-project

This file was deleted.

5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "autobahn",
"version": "0.10.0",
"main": "autobahn.js"
}
36 changes: 12 additions & 24 deletions package/Makefile
Original file line number Diff line number Diff line change
@@ -1,34 +1,22 @@
## http://dontkry.com/posts/code/browserify-and-the-universal-module-definition.html
## http://addyosmani.com/writing-modular-js/
.PHONY: test

##
## ~/.npmrc
## npm config edit
## npm adduser
##

all: bundle

clean:
rm -rf ./build

bundle:
mkdir -p ./build
browserify lib/autobahn.js --standalone autobahn -o build/autobahn.js
default:
@echo "Targets: test, clean, dependencies, publish"

test:
npm test

test_connect:
nodeunit test/test_connect.js
nodeunit test/test_connect.js

test_msgpack_serialization:
nodeunit test/test_msgpack_serialization.js

clean:
rm -rf ./node_modules

install:
npm install ws
npm install when
npm install crypto-js
npm install browserify
npm install utf-8-validate
npm install bufferutil
dependencies:
npm update

publish:
npm publish
4 changes: 2 additions & 2 deletions package/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# AutobahnJS

AutobahnJS implements **[The Web Application Messaging Protocol V2](http://wamp.ws/)** in JavaScript.
AutobahnJS implements **[The Web Application Messaging Protocol](http://wamp-proto.org)** in JavaScript.

WAMP provides asynchronous **Remote Procedure Calls** and **Publish & Subscribe** for applications in *one* protocol running over [WebSocket](http://tools.ietf.org/html/rfc6455).

Expand All @@ -11,4 +11,4 @@ AutobahnJS runs on both **Web browsers** and **[Node.js](http://nodejs.org/)**,
3. Caller
4. Callee

AutobahnJS is part of the [Autobahn project](http://autobahn.ws/), MIT licensed, and full source code can be found on [GitHub](https://github.com/crossbario/autobahn-js/).
AutobahnJS is part of the [Autobahn project](http://crossbar.io/autobahn/), MIT licensed, and full source code can be found on [GitHub](https://github.com/crossbario/autobahn-js/).
3 changes: 2 additions & 1 deletion package/lib/serializer.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,6 @@ try {

exports.MsgpackSerializer = MsgpackSerializer;
} catch (err) {
// msgpack-lite not installed

exports.MsgpackSerializer = null;
}
13 changes: 6 additions & 7 deletions package/lib/transport/websocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ Factory.prototype.create = function () {

// Test below used to be via the 'window' object in the browser.
// This fails when running in a Web worker.
//
//
// running in Node.js
//
//
if (global.process && global.process.versions.node) {

(function () {
Expand Down Expand Up @@ -145,18 +145,18 @@ Factory.prototype.create = function () {
});

})();
//
//
// running in the browser
//
//
} else {

(function () {

var websocket;

// Chrome, MSIE, newer Firefox
if ("WebSocket" in global) {

if (self._options.protocols) {
websocket = new global.WebSocket(self._options.url, self._options.protocols);
} else {
Expand Down Expand Up @@ -228,5 +228,4 @@ Factory.prototype.create = function () {
};



exports.Factory = Factory;
70 changes: 35 additions & 35 deletions package/package.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
{
"name": "autobahn",
"version": "0.10.0",
"description": "An implementation of The Web Application Messaging Protocol (WAMP).",
"main": "index.js",
"browser": {
"lib/transport/rawsocket.js": false,
"msgpack-lite": "msgpack-lite/global"
},
"scripts": {
"test": "nodeunit test/test.js"
},
"dependencies": {
"bufferutil": ">= 1.2.1",
"crypto-js": ">= 3.1.5",
"utf-8-validate": ">= 1.2.1",
"when": ">= 3.7.3",
"ws": ">= 0.8.0",
"msgpack-lite": ">= 0.1.17"
},
"devDependencies": {
"browserify": ">= 11.0.1",
"nodeunit": ">= 0.9.1"
},
"repository": {
"type": "git",
"url": "git://github.com/crossbario/autobahn-js.git"
},
"keywords": [
"WAMP",
"WebSocket",
"RPC",
"PubSub"
],
"author": "Tavendo GmbH",
"license": "MIT"
"name": "autobahn",
"version": "0.10.0",
"description": "An implementation of The Web Application Messaging Protocol (WAMP).",
"main": "index.js",
"browser": {
"lib/transport/rawsocket.js": false,
"msgpack-lite": "msgpack-lite/global"
},
"scripts": {
"test": "nodeunit test/test.js"
},
"dependencies": {
"bufferutil": ">= 1.2.1",
"crypto-js": ">= 3.1.5",
"utf-8-validate": ">= 1.2.1",
"when": ">= 3.7.3",
"ws": ">= 0.8.0",
"msgpack-lite": ">= 0.1.17"
},
"devDependencies": {
"browserify": ">= 11.0.1",
"nodeunit": ">= 0.9.1"
},
"repository": {
"type": "git",
"url": "git://github.com/crossbario/autobahn-js.git"
},
"keywords": [
"WAMP",
"WebSocket",
"RPC",
"PubSub"
],
"author": "Tavendo GmbH",
"license": "MIT"
}
8 changes: 2 additions & 6 deletions package/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@
// this works via https://github.com/caolan/nodeunit

var connect = require('./test_connect.js');
var msgpack_serialization = require('./test_msgpack_serialization.js');
//var msgpack_serialization = require('./test_msgpack_serialization.js');
var rpc_complex = require('./test_rpc_complex.js');
var rpc_arguments = require('./test_rpc_arguments.js');
var rpc_error = require('./test_rpc_error.js');
var rpc_options = require('./test_rpc_options.js');
var rpc_progress = require('./test_rpc_progress.js');
var rpc_slowsquare = require('./test_rpc_slowsquare.js');
var rpc_routing = require('./test_rpc_routing.js');
var rpc_caller_disclose_me = require('./test_rpc_caller_disclose_me.js');
var pubsub_basic = require('./test_pubsub_basic.js');
var pubsub_complex = require('./test_pubsub_complex.js');
var pubsub_options = require('./test_pubsub_options.js');
Expand All @@ -31,25 +30,22 @@ var pubsub_exclude = require('./test_pubsub_exclude.js');
var pubsub_eligible = require('./test_pubsub_eligible.js');
var pubsub_prefix_sub = require('./test_pubsub_prefix_sub.js');
var pubsub_wildcard_sub = require('./test_pubsub_wildcard_sub.js');
var pubsub_publisher_disclose_me = require('./test_pubsub_publisher_disclose_me.js');


exports.testConnect = connect.testConnect;
exports.testMsgpackSerialization = msgpack_serialization.testMsgpackSerialization;
//exports.testMsgpackSerialization = msgpack_serialization.testMsgpackSerialization;
exports.testRpcArguments = rpc_arguments.testRpcArguments;
exports.testRpcComplex = rpc_complex.testRpcComplex;
exports.testRpcError = rpc_error.testRpcError;
exports.testRpcOptions = rpc_options.testRpcOptions;
exports.testRpcProgress = rpc_progress.testRpcProgress;
exports.testRpcSlowsquare = rpc_slowsquare.testRpcSlowsquare;
exports.testRpcRouting = rpc_routing.testRpcRouting;
exports.testRpcCallerDiscloseMe = rpc_caller_disclose_me.testRpcCallerDiscloseMe;
exports.testPubsubBasic = pubsub_basic.testPubsubBasic;
exports.testPubsubComplex = pubsub_complex.testPubsubComplex;
exports.testPubsubOptions = pubsub_options.testPubsubOptions;
exports.testPubsubExcludeMe = pubsub_excludme.testPubsubExcludeMe;
exports.testPubsubExclude = pubsub_exclude.testPubsubExclude;
exports.testPubsubPrefixSub = pubsub_prefix_sub.testPubsubPrefixSub;
exports.testPubsubWildcardSub = pubsub_wildcard_sub.testPubsubWildcardSub;
exports.testPubsubPublisherDiscloseMe = pubsub_publisher_disclose_me.testPubsubPublisherDiscloseMe;

Loading

0 comments on commit 10e21c2

Please sign in to comment.