Skip to content

Conversation

@josephfrazier
Copy link
Contributor

(Let's give this another go... see #30 (comment))

This is a squashed cherry-pick of the first three commits of
#30, plus a small fix to the Timers module,
and slight updates to package.json and .npmignore.

The reason this isn't in separate commits is that the first three didn't work
individually. Squashing them together allows:

  • the automated tests to pass

  • <script src="dist/sip.js"></script> to work as usual
  • a Node.js phone to be tested as follows:

    npm install ws
    node
    WebSocket = require('ws')
    var SIP = require('./.');
    var ua = new SIP.UA({traceSip: true});
    ua.message('[email protected]', 'Node says hi!');

For completeness, unsquashed commit messages are listed below:

1: Use require() and browserify to organize dependencies and compilation.

Conflicts:
Gruntfile.js
package.json
src/tail.js

Cherry-picked from:
josephfrazier@df33833

2: Clean up module dependencies.

  • LoggerFactory does not depend on SIP
  • Constants depends only on SIP.name and SIP.version
  • Exceptions does not depend on SIP
  • Timers does not depend on SIP
  • Transport depends on window
  • SIP.MediaHandler depends on EventEmitter, not SIP
  • WebRTC depends on Utils, not SIP
  • Hacks depends on window, not SIP
  • DigestAuthentication depends on Utils, not SIP

Conflicts:
src/Timers.js
src/WebRTC.js

Cherry-picked from:
josephfrazier@9af96e9

3: Grammar module depends on SIP

Cherry-picked from:
josephfrazier@3e0c165

4: Timers module depends on window

See:
josephfrazier@2510347#diff-7f75ad1c8b0a978a180c50fe4c649e8bL25

5: package.json: set "main": "src/SIP.js"

Now that our src/ files are modules, we don't have to compile the module before
require()ing it.

6: .npmignore dist/sip*

There's no need for npm install to bring in dist/ files. Leave that to bower.

This is a squashed cherry-pick of the first three commits of
onsip#30, plus a small fix to the Timers module,
and slight updates to package.json and .npmignore.

The reason this isn't in separate commits is that the first three didn't work
individually. Squashing them together allows:

- the automated tests to pass
- <script src="dist/sip.js"></script> to work as usual
- a Node.js phone to be tested as follows:

    npm install ws
    node
    WebSocket = require('ws')
    var SIP = require('./.');
    var ua = new SIP.UA({traceSip: true});
    ua.message('[email protected]', 'Node says hi!');

For completeness, unsquashed commit messages are listed below:

1: Use require() and browserify to organize dependencies and compilation.

Conflicts:
	Gruntfile.js
	package.json
	src/tail.js

Cherry-picked from:
  df33833

2: Clean up module dependencies.

- LoggerFactory does not depend on SIP
- Constants depends only on SIP.name and SIP.version
- Exceptions does not depend on SIP
- Timers does not depend on SIP
- Transport depends on window
- SIP.MediaHandler depends on EventEmitter, not SIP
- WebRTC depends on Utils, not SIP
- Hacks depends on window, not SIP
- DigestAuthentication depends on Utils, not SIP

Conflicts:
	src/Timers.js
	src/WebRTC.js

Cherry-picked from:
  9af96e9

3: Grammar module depends on SIP

Cherry-picked from:
  3e0c165

4: Timers module depends on window

See:
  2510347#diff-7f75ad1c8b0a978a180c50fe4c649e8bL25

5: package.json: set "main": "src/SIP.js"

Now that our src/ files are modules, we don't have to compile the module before
require()ing it.

6: .npmignore dist/sip*

There's no need for `npm install` to bring in dist/ files. Leave that to bower.
Instead, require() package.json to learn their proper values. Otherwise, they
would remain templates when require()ing the un-browserify'd module, resulting
in this header being sent:

  User-Agent: <%= pkg.title %>/<%= pkg.version %>
wakamoleguy added a commit that referenced this pull request Jul 15, 2014
Use require() and browserify to organize dependencies and compilation.
@wakamoleguy wakamoleguy merged commit 16f20f1 into onsip:master Jul 15, 2014
@josephfrazier josephfrazier deleted the browserify060 branch July 15, 2014 14:28
@markandrus
Copy link
Contributor

I wish you could star pull requests. I gave this a try the other night. Nice work!

@josephfrazier
Copy link
Contributor Author

Thanks @markandrus! I'd really like to make SIP.js more modular, so there'll be more pull requests on the way too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants