Skip to content

Commit

Permalink
Merge branch 'master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
egreenmachine committed Dec 17, 2018
2 parents 9e44ec8 + d6bf452 commit 8cb7505
Show file tree
Hide file tree
Showing 53 changed files with 7,162 additions and 1,060 deletions.
5 changes: 3 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module.exports = {
"env": {
"node": true
"node": true,
"es6": true
},
"globals": {
"Uint8Array": false
Expand Down Expand Up @@ -212,7 +213,7 @@ module.exports = {
}
],
"prefer-numeric-literals": "error",
"prefer-promise-reject-errors": "error",
"prefer-promise-reject-errors": "off",
"prefer-reflect": "off",
"prefer-rest-params": "off",
"prefer-spread": "off",
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
node_modules/
dist/sip*
.grunt
lib/*
_SpecRunner.html
src/Grammar/dist/Grammar.js
npm-debug.log
23 changes: 5 additions & 18 deletions AUTHORS.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,13 @@
# AUTHORS

## James Criscuolo
## James Criscuolo [@james-criscuolo](https://github.com/james-criscuolo)

* <[email protected]>
* GitHub [@james-criscuolo](https://github.com/james-criscuolo)
## Eric Green [@egreenmachine](https://github.com/egreenmachine)

## Eric Green
# Previous Authors

* <[email protected]>
* GitHub [@egreenmachine](https://github.com/egreenmachine)

## Joseph Frazier

* <[email protected]>
* GitHub [@josephfrazier](https://github.com/josephfrazier)
* Twitter [@josephfrazier_](https://twitter.com/josephfrazier_)

## Will Mitchell

* <[email protected]>
* GitHub [@wakamoleguy](https://github.com/wakamoleguy)
* Twitter [@wakamoleguy](https://twitter.com/wakamoleguy)
* Joseph Frazier
* Will Mitchell

## JsSIP Authors

Expand Down
24 changes: 5 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,18 @@ A JavaScript SIP stack for WebRTC, instant messaging, and more!
## Download

* [sipjs.com/download](https://sipjs.com/download/)
* Bower: `bower install sip.js`
* npm: `npm install sip.js`

## Authors

### James Criscuolo
### James Criscuolo [@james-criscuolo](https://github.com/james-criscuolo)

* <[email protected]>
* GitHub [@james-criscuolo](https://github.com/james-criscuolo)
### Eric Green [@egreenmachine](https://github.com/egreenmachine)

### Eric Green
## Previous Authors

* <[email protected]>
* GitHub [@egreenmachine](https://github.com/egreenmachine)

### Joseph Frazier

* <[email protected]>
* GitHub [@josephfrazier](https://github.com/josephfrazier)
* Twitter [@josephfrazier_](https://twitter.com/josephfrazier_)

### Will Mitchell

* <[email protected]>
* GitHub [@wakamoleguy](http://github.com/wakamoleguy)
* Twitter [@wakamoleguy](http://twitter.com/wakamoleguy)
* Joseph Frazier
* Will Mitchell

### JsSIP Authors

Expand Down
23 changes: 0 additions & 23 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,29 +45,6 @@
set +e
```

* test bower:

```shell
#!/usr/bin/env bash
set -e
SIPJS_DIR=`pwd`
SIPJS_HASH=`git rev-parse HEAD`
cd /tmp
rm -rf bower_components
bower install "$SIPJS_DIR/.git#$SIPJS_HASH"
SIPJS_TEST="var session = new SIP.UA({traceSip: true}).invite('[email protected]', new Audio());"
SIPJS_TEST+="session.on('accepted', setTimeout.bind(null, window.close, 5000))"
npm install -g smokestack
cat ./bower_components/sip.js/dist/sip.min.js <(echo $SIPJS_TEST) | smokestack
# more tests
cd $SIPJS_DIR
set +e
```

* push to local github
* merge (this step and the above one can be skipped if you just do it on the the repo's release branch itself)
* git tag (your version number)
Expand Down
31 changes: 0 additions & 31 deletions bower.json

This file was deleted.

20 changes: 5 additions & 15 deletions BUILDING.md → build/BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,6 @@ You just need to have [Node.js](http://nodejs.org/) and [Git](http://git-scm.com

* [Install Git](http://git-scm.com/book/en/Getting-Started-Installing-Git)


### PhantomJS

(optional, just for running unit tests)

* [Install PhantomJS](http://phantomjs.org/download.html)
* In modern Debian/Ubuntu systems PhantomJS can be installed via `apt-get install phantomjs`


## How to build SIP.js

Clone a copy of the main SIP.js git repository by running:
Expand All @@ -35,15 +26,14 @@ $ cd SIP.js && npm install

Build and test
```
$ npm run build && npm run commandLineTest
$ npm run buildAndTest
```

The built version of SIP.js will be available in the `dist/` subdirectory in both flavors: normal (uncompressed) and minified, both linted with [ESLint](https://eslint.org/). There are copies of each file with the version number in the title in that subdirectory as well.
The compiled version of SIP.js will be available in the `lib/` folder. The bundled versions of SIP.js will be available in the `dist/` subdirectory in both flavors: normal (uncompressed) and minified, both linted with [ESLint](https://eslint.org/). There are copies of each file with the version number in the title in that subdirectory as well.

## Development version

Run `npm run build` for just generating the `dist/sip.js` file. An uncompressed SIP.js source file named `sip.js` will be created in `dist` directory.

Run `npm run build-lib` to regenerate the `lib` folder.

## Test units

Expand All @@ -53,7 +43,7 @@ $ npm run commandLineTest
$ npm run browserTest
Running "jasmine:components" (jasmine) task
Testing jasmine specs via phantom
Testing jasmine specs via chromeHeadless
...
672 specs in 2.757s.
>> 0 failures
Expand All @@ -63,5 +53,5 @@ Testing jasmine specs via phantom

If you modify `src/Grammar/src/Grammar.pegjs` then you need to recompile SIP.js grammar files. For that run the following task:
```
$ npm run build
$ npm run generate-grammar
```
73 changes: 73 additions & 0 deletions build/grammarGenerator.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
"use strict";

const fs = require("fs"),
pegjs = require("pegjs");
//tspegjs = require("ts-pegjs");

const thisFolder = "./src/Grammar",
inputFile = thisFolder + "/src/Grammar.pegjs",
outputFolder = thisFolder + "/dist",
outputFile = outputFolder + "/Grammar.js";

const grammarContents = fs.readFileSync(inputFile, "utf8");

const parser = pegjs.generate(grammarContents, {
allowedStartRules: [
"Contact",
"Name_Addr_Header",
"Record_Route",
"Request_Response",
"SIP_URI",
"Subscription_State",
"Supported",
"Require",
"Via",
"absoluteURI",
"Call_ID",
"Content_Disposition",
"Content_Length",
"Content_Type",
"CSeq",
"displayName",
"Event",
"From",
"host",
"Max_Forwards",
"Min_SE",
"Proxy_Authenticate",
"quoted_string",
"Refer_To",
"Replaces",
"Session_Expires",
"stun_URI",
"To",
"turn_URI",
"uuid",
"WWW_Authenticate",
"challenge",
"sipfrag",
"Referred_By"
],
output: "source",
format: "umd",
exportVar: "SIP.Grammar",
optimize: "size",
/* TODO - we want this eventually, but right now it produces ts that makes tsc unhappy
plugins: [tspegjs],
"tspegjs": {
"noTslint": false,
}
*/
});

if (!fs.existsSync(outputFolder)){
fs.mkdirSync(outputFolder);
}

fs.writeFile(outputFile, parser, err => {
if (err) {
console.log(err);
} else {
console.log("Grammar successfully generated.");
}
});
63 changes: 10 additions & 53 deletions webpack.config.js → build/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var webpack = require('webpack');
var UglifyJsPlugin = require('uglifyjs-webpack-plugin');
var TerserPlugin = require('terser-webpack-plugin');

var pkg = require('./package.json');
var pkg = require('../package.json');
var year = new Date().getFullYear();
var banner = '\
\n\
Expand Down Expand Up @@ -37,20 +37,18 @@ var banner = '\
~~~ end JsSIP license ~~~\n\
\n\n\n';



module.exports = function (env) {
var mode = env.buildType === 'prod' ? 'production' : 'none';
var mode = env.buildType === 'min' ? 'production' : 'none';
var mainDir = __dirname + '/../';

var entry = {};
entry['sip' + (env.buildType === 'prod' ? '.min' : '')] = __dirname + '/src/index.js';

entry['sip' + (env.buildType === 'min' ? '.min' : '')] = mainDir + '/src/index.js';

return {
mode: mode,
entry: entry,
output: {
path: __dirname + '/dist',
path: mainDir + '/dist',
filename: '[name].js',
library: 'SIP',
libraryTarget: 'umd',
Expand All @@ -61,58 +59,17 @@ module.exports = function (env) {
{
test: /\.js$/,
exclude: /node_modules/,
loader: "awesome-typescript-loader"
},
{
test: /\.pegjs$/,
loader: 'pegjs-loader',
loader: "awesome-typescript-loader",
options: {
'optimize': 'size',
'allowedStartRules':
[
"Contact",
"Name_Addr_Header",
"Record_Route",
"Request_Response",
"SIP_URI",
"Subscription_State",
"Supported",
"Require",
"Via",
"absoluteURI",
"Call_ID",
"Content_Disposition",
"Content_Length",
"Content_Type",
"CSeq",
"displayName",
"Event",
"From",
"host",
"Max_Forwards",
"Min_SE",
"Proxy_Authenticate",
"quoted_string",
"Refer_To",
"Replaces",
"Session_Expires",
"stun_URI",
"To",
"turn_URI",
"uuid",
"WWW_Authenticate",
"challenge",
"sipfrag",
"Referred_By"
]
"outDir": mainDir + "/dist"
}
}
]
},
optimization: {
minimizer: [
new UglifyJsPlugin({
uglifyOptions: {
new TerserPlugin({
terserOptions: {
output: {
ascii_only: true
}
Expand Down
1 change: 0 additions & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ module.exports = function(config) {

// list of files / patterns to load in the browser
files: [
'test/polyfills/*.js',
'test/helpers/*.js',
'dist/sip.js',
'test/spec/**/*.js',
Expand Down
Loading

0 comments on commit 8cb7505

Please sign in to comment.