Skip to content

Commit dae7970

Browse files
author
Will Mitchell
committed
Merge branch 'release-0.7.0' into release
Conflicts: src/Grammar/dist/Grammar.js
2 parents 209fb9b + 50c119b commit dae7970

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+17074
-5263
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
node_modules/
22
dist/sip*
33
.grunt
4-
_SpecRunner.html
4+
_SpecRunner.html
5+
src/Grammar/dist/Grammar.js

.jshintrc

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"browser": true,
2+
"node": true,
33
"curly": true,
44
"eqeqeq": true,
55
"immed": true,
@@ -13,9 +13,5 @@
1313
"onecase": true,
1414
"unused": true,
1515
"supernew": true,
16-
"globals": {
17-
"module": true,
18-
"require": true,
19-
"global": true
20-
}
16+
"expr": true
2117
}

.travis.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
# Doc: http://manuel.manuelles.nl/blog/2012/06/22/integrate-travis-ci-into-grunt/
22

3+
sudo: false
4+
35
language: node_js
46

57
node_js:
68
- "0.10"
79

10+
cache:
11+
directories:
12+
- node_modules
13+
814
notifications:
915
email:
1016
recipients:

Gruntfile.js

Lines changed: 20 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
module.exports = function(grunt) {
55

66
var pkg = grunt.file.readJSON('package.json');
7+
var year = new Date().getFullYear()
78
var banner = '\
89
/*\n\
9-
* SIP version <%= pkg.version %>\n\
10-
* Copyright (c) 2014-<%= grunt.template.today("yyyy") %> Junction Networks, Inc <http://www.onsip.com>\n\
10+
* SIP version ' + pkg.version + '\n\
11+
* Copyright (c) 2014-' + year + ' Junction Networks, Inc <http://www.onsip.com>\n\
1112
* Homepage: http://sipjs.com\n\
1213
* License: http://sipjs.com/license/\n\
1314
*\n\
@@ -23,10 +24,10 @@ module.exports = function(grunt) {
2324
* distribute, sublicense, and/or sell copies of the Software, and to\n\
2425
* permit persons to whom the Software is furnished to do so, subject to\n\
2526
* the following conditions:\n\
26-
* \n\
27+
*\n\
2728
* The above copyright notice and this permission notice shall be\n\
2829
* included in all copies or substantial portions of the Software.\n\
29-
* \n\
30+
*\n\
3031
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\n\
3132
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\
3233
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n\
@@ -47,41 +48,36 @@ module.exports = function(grunt) {
4748
},
4849
browserify: {
4950
devel: {
50-
src: 'src/SIP.js',
51+
src: pkg.main,
5152
dest: 'dist/<%= name %>-<%= pkg.version %>.js'
5253
},
5354
options: {
5455
bundleOptions: {
5556
standalone: 'SIP'
5657
},
5758
postBundleCB: function (err, src, next) {
58-
// prepend the banner and fill in placeholders
59-
src = (banner + src).replace(/<%=(.*)%>/g, function (match, expr) {
60-
// jshint evil:true
61-
return eval(expr);
62-
});
63-
next(err, src);
59+
// prepend the banner
60+
next(err, banner + src);
6461
}
6562
}
6663
},
6764
copy: {
65+
min: {
66+
src: 'dist/<%= name %>-<%= pkg.version %>.min.js',
67+
dest: 'dist/<%= name %>.min.js'
68+
},
6869
dist: {
6970
src: 'dist/<%= name %>-<%= pkg.version %>.js',
7071
dest: 'dist/<%= name %>.js'
7172
}
7273
},
7374
jshint: {
74-
src: 'src/**/*.js',
75+
src: ['src/**/*.js', "!src/polyfills/**/*.js", "!src/Grammar/dist/Grammar.js"],
7576
options: {
7677
jshintrc: true
7778
}
7879
},
7980
uglify: {
80-
dist: {
81-
files: {
82-
'dist/<%= name %>.min.js': ['dist/<%= name %>.js']
83-
}
84-
},
8581
devel: {
8682
files: {
8783
'dist/<%= name %>-<%= pkg.version %>.min.js': ['dist/<%= name %>-<%= pkg.version %>.js']
@@ -102,6 +98,7 @@ module.exports = function(grunt) {
10298
options: {
10399
specs: 'test/spec/*.js',
104100
keepRunner : true,
101+
vendor: 'test/polyfills/*.js',
105102
helpers: 'test/helpers/*.js'
106103
}
107104
}
@@ -110,38 +107,7 @@ module.exports = function(grunt) {
110107
grammar: {
111108
src: 'src/Grammar/src/Grammar.pegjs',
112109
dest: 'src/Grammar/dist/Grammar.js',
113-
options: {
114-
optimize: 'size',
115-
allowedStartRules: [
116-
'Contact',
117-
'Name_Addr_Header',
118-
'Record_Route',
119-
'Request_Response',
120-
'SIP_URI',
121-
'Subscription_State',
122-
'Via',
123-
'absoluteURI',
124-
'Call_ID',
125-
'Content_Disposition',
126-
'Content_Length',
127-
'Content_Type',
128-
'CSeq',
129-
'displayName',
130-
'Event',
131-
'From',
132-
'host',
133-
'Max_Forwards',
134-
'Proxy_Authenticate',
135-
'quoted_string',
136-
'Refer_To',
137-
'stun_URI',
138-
'To',
139-
'turn_URI',
140-
'uuid',
141-
'WWW_Authenticate',
142-
'challenge'
143-
]
144-
}
110+
options: require('./src/Grammar/peg.json')
145111
}
146112
},
147113
trimtrailingspaces: {
@@ -166,46 +132,24 @@ module.exports = function(grunt) {
166132
grunt.loadNpmTasks('grunt-peg');
167133
grunt.loadNpmTasks('grunt-trimtrailingspaces');
168134

169-
170-
// Task for building SIP.js Grammar.js and Grammar.min.js files.
171-
grunt.registerTask('post_peg', function(){
172-
// Modify the generated Grammar.js file with custom changes.
173-
console.log('"grammar" task: applying custom changes to Grammar.js ...');
174-
var fs = require('fs');
175-
var grammar = fs.readFileSync('src/Grammar/dist/Grammar.js').toString();
176-
var modified_grammar = grammar.replace(/throw peg.*maxFailPos.*/, 'return -1;');
177-
modified_grammar = modified_grammar.replace(/return peg.*result.*/, 'return data;');
178-
modified_grammar = modified_grammar.replace(/parse:( *)parse/, 'parse:$1function (input, startRule) {return parse(input, {startRule: startRule});}');
179-
modified_grammar = modified_grammar.replace(/\(function\(\)/, 'function(SIP)').replace(/\}\)\(\)/, '}');
180-
181-
// Don't jshint this big chunk of minified code
182-
modified_grammar =
183-
"/* jshint ignore:start */\n" +
184-
modified_grammar +
185-
"\n/* jshint ignore:end */\n";
186-
187-
fs.writeFileSync('src/Grammar/dist/Grammar.js', modified_grammar);
188-
console.log('OK');
189-
});
190-
191-
grunt.registerTask('grammar', ['peg', 'post_peg']);
135+
grunt.registerTask('grammar', ['peg']);
192136

193137
// Task for building sip-devel.js (uncompressed), sip-X.Y.Z.js (uncompressed)
194138
// and sip-X.Y.Z.min.js (minified).
195139
// Both sip-devel.js and sip-X.Y.Z.js are the same file with different name.
196-
grunt.registerTask('build', ['trimtrailingspaces:main', 'devel', 'copy', 'uglify']);
140+
grunt.registerTask('build', ['trimtrailingspaces:main', 'devel', 'uglify', 'copy']);
197141

198142
// Task for building sip-devel.js (uncompressed).
199-
grunt.registerTask('devel', ['jshint', 'browserify']);
143+
grunt.registerTask('devel', ['jshint', 'quick']);
200144

201-
grunt.registerTask('quick', ['browserify']);
145+
grunt.registerTask('quick', ['grammar', 'browserify']);
202146

203147
// Test tasks.
204148
grunt.registerTask('test',['jasmine']);
205149

206150
// Travis CI task.
207151
// Doc: http://manuel.manuelles.nl/blog/2012/06/22/integrate-travis-ci-into-grunt/
208-
grunt.registerTask('travis', ['grammar', 'devel', 'test']);
152+
grunt.registerTask('travis', ['devel', 'test']);
209153

210154
// Default task is an alias for 'build'.
211155
// I know this is annoying... but you could always do grunt build. This encourages better code testing! --Eric Green

RELEASE.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# How To version release SIP.js
2+
3+
(These are developer notes.)
4+
5+
(These may not be entirely accurate.)
6+
7+
(Eric Green demands credit for these.)
8+
9+
(So remember that if it's broken, you know who to contact.)
10+
11+
(If you don't know, it's Eric Green.)
12+
13+
1. On your own github, checkout last tagged release on a new branch
14+
2. remove all dist files
15+
3. cherry pick commits you want using -x flag (for "hot patch" releases)
16+
4. once ready, test.
17+
5. update version number on master
18+
6. cherry pick version number commit to new branch
19+
7. build and test.
20+
8. test again
21+
9. add new dist files (git add -f if it complains)
22+
10. test npm and bower (bower might require push to local github)
23+
11. push to local github
24+
12. merge
25+
13. git tag (your version number)
26+
14. git push --tags
27+
15. get a clean release
28+
16. npm publish
29+
17. do release notes on github and release!
30+
18. update website

THANKS.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ Thank you to all of the contributors with code and patches to the SIP.js project
55

66
* [Sándor Balázs](https://github.com/sanyatuning)
77
* The [LiveNinja](https://www.liveninja.com) Team ([GitHub](https://github.com/liveninja))
8+
* [Philipp Weissensteiner](https://github.com/wpp)
9+
* [Rob Wu](https://github.com/Rob--W)
10+
* [Sam Metson](https://github.com/Bat-o-matic)
11+
* [Mike Chacon](https://github.com/sicdigital)
12+
* [Sean Bright](https://github.com/seanbright)
13+
* [Carlos Ruiz Diaz](https://github.com/caruizdiaz)
14+
* [Destreyf](https://github.com/Destreyf)
815

916
Much credit goes to the original authors of the JsSIP project. Thank you to all.
1017

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sip.js",
3-
"version": "0.6.4",
3+
"version": "0.7.0",
44
"authors": [
55
"Will Mitchell <[email protected]>",
66
"James Criscuolo <[email protected]>",

cordova_package.json.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/* TODO remove once Cordova is released with
2+
https://github.com/apache/cordova-lib/pull/71
3+
*/
4+
// This file contains the "title" and "version" of package.json. This allows
5+
// src/SIP.js to require('../package.json'), but still be used as a Cordova
6+
// module. cordova.require doesn't support json files, but plugin.xml tells
7+
// Cordova that package.json is actually this file, so src/SIP.js still has
8+
// access to the fields it needs.
9+
module.exports = {
10+
title: "SIP.js",
11+
version: "0.6.2"
12+
};

0 commit comments

Comments
 (0)