Permalink
Browse files

Move code to src/ dir

  • Loading branch information...
1 parent 197f540 commit b284ce94d60c70866ffe86c8f395c54bb0e604fa jden committed Feb 18, 2016
Showing with 60 additions and 60 deletions.
  1. +5 −5 api/apis/radar.js
  2. +3 −3 { → bin}/server.js
  3. +3 −3 index.js
  4. +12 −12 package.json
  5. 0 { → src}/client/client_session.js
  6. 0 { → src}/client/client_session_state_machine.js
  7. 0 { → src}/client/socket_client_session_adapter.js
  8. 0 { → src}/core/id.js
  9. 0 { → src}/core/index.js
  10. 0 { → src}/core/lib/resources/message_list/index.js
  11. 0 { → src}/core/lib/resources/presence/index.js
  12. 0 { → src}/core/lib/resources/presence/presence_manager.js
  13. 0 { → src}/core/lib/resources/presence/presence_store.js
  14. 0 { → src}/core/lib/resources/presence/readme.md
  15. 0 { → src}/core/lib/resources/presence/sentry.js
  16. 0 { → src}/core/lib/resources/resource.js
  17. 0 { → src}/core/lib/resources/status/index.js
  18. 0 { → src}/core/lib/resources/stream/index.js
  19. 0 { → src}/core/lib/resources/stream/subscriber_state.js
  20. 0 { → src}/core/lib/type.js
  21. 0 { → src}/core/stamper.js
  22. 0 { → src}/middleware/index.js
  23. 0 { → src}/middleware/legacy_auth_manager.js
  24. 0 { → src}/middleware/quota_limiter.js
  25. 0 { → src}/middleware/quota_manager.js
  26. 0 { → src}/middleware/runner.js
  27. 0 { → src}/server/server.js
  28. 0 { → src}/server/service_interface.js
  29. 0 { → src}/server/session_manager.js
  30. 0 {tests → test}/client.auth.test.js
  31. 0 {tests → test}/client.connect.test.js
  32. 0 {tests → test}/client.message.test.js
  33. +2 −2 {tests → test}/client.presence.remote.test.js
  34. +3 −3 {tests → test}/client.presence.sentry.test.js
  35. 0 {tests → test}/client.presence.test.js
  36. 0 {tests → test}/client.rate_limit.test.js
  37. 0 {tests → test}/client.reconnect.test.js
  38. +2 −2 {tests → test}/client.socket_client_session_adapter.test.js
  39. 0 {tests → test}/client.status.test.js
  40. 0 {tests → test}/client.stream.test.js
  41. +2 −2 {tests → test}/client.test.js
  42. +2 −2 {tests → test}/common.js
  43. +1 −1 {tests → test}/configurator.test.js
  44. +1 −1 {tests → test}/core.id.unit.test.js
  45. 0 {tests → test}/integration/service_interface.test.js
  46. +2 −2 {tests → test}/lib/assert_helper.js
  47. 0 {tests → test}/lib/formatter.js
  48. +2 −2 {tests → test}/lib/radar.js
  49. +1 −1 {tests → test}/message_list.unit.test.js
  50. +1 −1 {tests → test}/presence.manager.unit.test.js
  51. 0 {tests → test}/presence.remote.test.js
  52. +1 −1 {tests → test}/presence.unit.test.js
  53. +1 −1 {tests → test}/quota_limiter.test.js
  54. +1 −1 {tests → test}/quota_manager.test.js
  55. +6 −6 {tests → test}/radar_api.test.js
  56. +1 −1 {tests → test}/sentry.unit.test.js
  57. +2 −2 {tests → test}/server.auth.unit.test.js
  58. 0 {tests → test}/server.memory.test.js
  59. 0 {tests → test}/server.middleware.unit.test.js
  60. +2 −2 {tests → test}/server.session_manager.test.js
  61. +1 −1 {tests → test}/server.unit.test.js
  62. +1 −1 {tests → test}/service_interface.test.js
  63. +1 −1 {tests → test}/stamper.test.js
  64. +1 −1 {tests → test}/status.unit.test.js
View
@@ -1,9 +1,9 @@
var url = require('url')
-var Status = require('../../core').Status
-var MessageList = require('../../core').MessageList
-var Presence = require('../../core').Presence
-var PresenceManager = require('../../core').PresenceManager
-var Type = require('../../core').Type
+var Status = require('../../src/core').Status
+var MessageList = require('../../src/core').MessageList
+var Presence = require('../../src/core').Presence
+var PresenceManager = require('../../src/core').PresenceManager
+var Type = require('../../src/core').Type
var hostname = require('os').hostname()
function jsonResponse (response, object) {
@@ -1,7 +1,7 @@
var http = require('http')
-var configuration = require('./configurator.js').load({persistence: true})
-var Radar = require('./server/server.js')
-var Api = require('./api/api.js')
+var configuration = require('../configurator.js').load({persistence: true})
+var Radar = require('../server/server.js')
+var Api = require('../api/api.js')
var Minilog = require('minilog')
// Configure log output
View
@@ -1,7 +1,7 @@
module.exports = {
api: require('./api/api'),
configurator: require('./configurator'),
- core: require('./core'),
- server: require('./server/server'),
- middleware: require('./middleware')
+ core: require('./src/core'),
+ server: require('./src/server/server'),
+ middleware: require('./src/middleware')
}
View
@@ -75,23 +75,23 @@
},
"scripts": {
"prestart": "npm run check-modules",
- "start": "node server.js",
+ "start": "node bin/server.js",
"check-modules": "if [ -z \"$SKIP_PACKAGE_CHECK\" ] && [ ./package.json -nt ./node_modules ]; then echo updating modules && npm install; fi",
"check-clean": "if [[ $(git diff --shortstat 2> /dev/null | tail -n1) != \"\" ]]; then npm run warn-dirty-tree && exit 1; fi",
"warn-dirty-tree": "echo 'Your repo tree is dirty.'",
"lint": "standard",
"pretest": "npm run check-modules && npm run lint",
- "test": "npm run test-sentinel",
- "test:integration": "TEST=\"tests/integration/*\" npm run test-one",
- "test-full": "npm run test-sentinel && npm run test-redis",
- "test-redis": "ls ./tests/*.test.js | xargs -n 1 -t -I {} sh -c 'TEST=\"{}\" npm run test-one'",
- "pretest-sentinel": "./node_modules/.bin/simple_sentinel start",
- "test-sentinel": "ls ./tests/*.test.js | xargs -n 1 -t -I {} sh -c 'TEST=\"{}\" RADAR_SENTINEL_URLS=sentinel://localhost:26379 RADAR_SENTINEL_MASTER_NAME=mymaster npm run test-one'",
- "posttest-sentinel": "./node_modules/.bin/simple_sentinel stop",
- "test-one": "./node_modules/.bin/mocha --ui exports --reporter spec --slow 2000ms --timeout 4000ms --bail \"$TEST\"",
- "test-one-solo": "./node_modules/.bin/mocha --ui exports --reporter spec --slow 2000ms --timeout 4000ms --bail",
- "test-debug": "./node_modules/.bin/mocha debug --ui exports --reporter spec --slow 4000ms --bail \"$TEST\"",
- "test:memory": "mocha --expose-gc tests/*.memory.test.js --ui exports --reporter spec"
+ "test": "npm run test:sentinel",
+ "test:integration": "TEST=\"test/integration/*\" npm run test:one",
+ "test:full": "npm run test:sentinel && npm run test:redis",
+ "test:redis": "ls ./test/*.test.js | xargs -n 1 -t -I {} sh -c 'TEST=\"{}\" npm run test:one'",
+ "pretest:sentinel": "./node_modules/.bin/simple_sentinel start",
+ "test:sentinel": "ls ./test/*.test.js | xargs -n 1 -t -I {} sh -c 'TEST=\"{}\" RADAR_SENTINEL_URLS=sentinel://localhost:26379 RADAR_SENTINEL_MASTER_NAME=mymaster npm run test:one'",
+ "posttest:sentinel": "./node_modules/.bin/simple_sentinel stop",
+ "test:one": "./node_modules/.bin/mocha --ui exports --reporter spec --slow 2000ms --timeout 4000ms --bail \"$TEST\"",
+ "test:one-solo": "./node_modules/.bin/mocha --ui exports --reporter spec --slow 2000ms --timeout 4000ms --bail",
+ "test:debug": "./node_modules/.bin/mocha debug --ui exports --reporter spec --slow 4000ms --bail \"$TEST\"",
+ "test:memory": "mocha --expose-gc test/*.memory.test.js --ui exports --reporter spec"
},
"standard": {
"ignore": [
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,9 +1,9 @@
/* globals describe, it, beforeEach, afterEach, before, after */
var common = require('./common.js')
var assert = require('assert')
-var Persistence = require('../core').Persistence
+var Persistence = require('../src/core').Persistence
var Tracker = require('callback_tracker')
-var PresenceManager = require('../core/lib/resources/presence/presence_manager.js')
+var PresenceManager = require('../src/core/lib/resources/presence/presence_manager.js')
var AssertHelper = require('./lib/assert_helper.js')
var PresenceMessage = AssertHelper.PresenceMessage
var presenceManagerForSentry = AssertHelper.presenceManagerForSentry
@@ -1,12 +1,12 @@
/* globals describe, it, beforeEach, afterEach, before, after */
var common = require('./common.js')
var assert = require('assert')
-var Persistence = require('../core').Persistence
+var Persistence = require('../src/core').Persistence
var Tracker = require('callback_tracker')
-var PresenceManager = require('../core/lib/resources/presence/presence_manager.js')
+var PresenceManager = require('../src/core/lib/resources/presence/presence_manager.js')
var assertHelper = require('./lib/assert_helper.js')
var PresenceMessage = assertHelper.PresenceMessage
-var Sentry = require('../core/lib/resources/presence/sentry.js')
+var Sentry = require('../src/core/lib/resources/presence/sentry.js')
var radar
var client
File renamed without changes.
File renamed without changes.
@@ -1,6 +1,6 @@
/* globals describe, it, beforeEach */
-var SocketClientSessionAdapter = require('../client/socket_client_session_adapter')
-var ClientSession = require('../client/client_session')
+var SocketClientSessionAdapter = require('../src/client/socket_client_session_adapter')
+var ClientSession = require('../src/client/client_session')
var chai = require('chai')
chai.use(require('sinon-chai'))
chai.use(require('chai-interface'))
File renamed without changes.
File renamed without changes.
@@ -1,7 +1,7 @@
/* globals describe, it, beforeEach */
var common = require('./common.js')
var assert = require('assert')
-var ClientSession = require('../client/client_session.js')
+var ClientSession = require('../src/client/client_session.js')
var EventEmitter = require('events').EventEmitter
var sinon = require('sinon')
var proxyquire = require('proxyquire')
@@ -203,7 +203,7 @@ describe('ClientSession', function () {
function logging () { return logging }
logging.info = sinon.spy()
- var ClientSession = proxyquire('../client/client_session.js', {
+ var ClientSession = proxyquire('../src/client/client_session.js', {
minilog: logging
})
var id = Math.random()
@@ -2,9 +2,9 @@ var http = require('http')
var logging = require('minilog')('common')
var formatter = require('./lib/formatter')
var Persistence = require('persistence')
-var RadarServer = require('../index.js').server
+var RadarServer = require('../index').server
var configuration = require('../configurator').load({persistence: true})
-var Sentry = require('../core/lib/resources/presence/sentry')
+var Sentry = require('../src/core/lib/resources/presence/sentry')
var Client = require('radar_client').constructor
var fork = require('child_process').fork
var Tracker = require('callback_tracker')
@@ -3,7 +3,7 @@
var assert = require('assert')
var noArgs = ['', '']
var noEnv = {}
-var Configurator = require('../configurator.js')
+var Configurator = require('../configurator')
// Helper function. It tests multiple features of a given configuration option.
function describeOptionTest (configurator, name, options) {
@@ -6,7 +6,7 @@ var sinon = require('sinon')
chai.use(require('sinon-chai'))
describe('id', function () {
- var id = require('../core/id')
+ var id = require('../src/core/id')
beforeEach(function () {
id.setGenerator(id.defaultGenerator)
@@ -1,8 +1,8 @@
var _ = require('underscore')
var assert = require('assert')
var EE = require('events').EventEmitter
-var Sentry = require('../../core/lib/resources/presence/sentry.js')
-var PresenceManager = require('../../core/lib/resources/presence/presence_manager.js')
+var Sentry = require('../../src/core/lib/resources/presence/sentry.js')
+var PresenceManager = require('../../src/core/lib/resources/presence/presence_manager.js')
var SentryDefaults = {
expiryOffset: 4000,
refreshInterval: 3500,
File renamed without changes.
@@ -1,10 +1,10 @@
var http = require('http')
var Radar = require('../../index.js')
-var Middleware = require('../../middleware')
+var Middleware = require('../../src/middleware')
var QuotaManager = Middleware.QuotaManager
var LegacyAuthManager = Middleware.LegacyAuthManager
var Persistence = require('persistence')
-var Type = require('../../core').Type
+var Type = require('../../src/core').Type
var Minilog = require('minilog')
var logger = Minilog('lib_radar')
var formatter = require('./formatter.js')
@@ -1,7 +1,7 @@
/* globals describe, it, beforeEach, before, after */
var assert = require('assert')
var Common = require('./common')
-var MessageList = require('../core/lib/resources/message_list')
+var MessageList = require('../src/core/lib/resources/message_list')
var Persistence = require('persistence')
describe('For a message list', function () {
@@ -3,7 +3,7 @@ var chai = require('chai')
var expect = chai.expect
describe('PresenceManager', function () {
- var PresenceManager = require('../core/lib/resources/presence/presence_manager')
+ var PresenceManager = require('../src/core/lib/resources/presence/presence_manager')
describe('#disconnectRemoteClient', function () {
it('sends implicit offline message without updating redis', function (done) {
File renamed without changes.
@@ -3,7 +3,7 @@ var assert = require('assert')
var MiniEE = require('miniee')
var Persistence = require('persistence')
var Common = require('./common.js')
-var Presence = require('../core/lib/resources/presence')
+var Presence = require('../src/core/lib/resources/presence')
var sinon = require('sinon')
describe('given a presence resource', function () {
@@ -1,6 +1,6 @@
/* globals describe, it, beforeEach */
var assert = require('assert')
-var QuotaLimiter = require('../middleware').QuotaLimiter
+var QuotaLimiter = require('../src/middleware').QuotaLimiter
var limit = 1
var clientId = '1'
var clientId2 = '2'
@@ -1,6 +1,6 @@
/* globals describe, it, beforeEach */
var assert = require('assert')
-var QuotaManager = require('../middleware').QuotaManager
+var QuotaManager = require('../src/middleware').QuotaManager
var quotaManager
var client = {
id: 1,
@@ -2,12 +2,12 @@ var http = require('http')
var assert = require('assert')
var Api = require('../api/api.js')
var ClientScope = require('../api/lib/client')
-var Persistence = require('../core').Persistence
-var PresenceManager = require('../core').PresenceManager
-var Presence = require('../core').Presence
-var Type = require('../core').Type
-var Status = require('../core').Status
-var MessageList = require('../core').MessageList
+var Persistence = require('../src/core').Persistence
+var PresenceManager = require('../src/core').PresenceManager
+var Presence = require('../src/core').Presence
+var Type = require('../src/core').Type
+var Status = require('../src/core').Status
+var MessageList = require('../src/core').MessageList
var Common = require('./common.js')
var frontend
@@ -1,6 +1,6 @@
/* globals describe, it, beforeEach, afterEach, before */
var assert = require('assert')
-var Sentry = require('../core/lib/resources/presence/sentry.js')
+var Sentry = require('../src/core/lib/resources/presence/sentry.js')
var Persistence = require('persistence')
var configuration = require('../configurator.js').load({persistence: true})
var _ = require('underscore')
@@ -1,7 +1,7 @@
/* globals describe, it, beforeEach */
var common = require('./common.js')
var assert = require('assert')
-var RadarTypes = require('../core/lib/type.js')
+var RadarTypes = require('../src/core/lib/type.js')
var controlMessage = {
to: 'control:/dev/test',
op: 'ctl',
@@ -23,7 +23,7 @@ var authorizedType = {
authProvider: authProvider,
expression: /^control:/
}
-var LegacyAuthManager = require('../middleware').LegacyAuthManager
+var LegacyAuthManager = require('../src/middleware').LegacyAuthManager
var radarServer
var socket
File renamed without changes.
@@ -1,6 +1,6 @@
/* globals describe, it, beforeEach */
-var SessionManager = require('../server/session_manager')
-var ClientSession = require('../client/client_session')
+var SessionManager = require('../src/server/session_manager')
+var ClientSession = require('../src/client/client_session')
var chai = require('chai')
chai.use(require('sinon-chai'))
chai.use(require('chai-interface'))
@@ -3,7 +3,7 @@ var common = require('./common.js')
var assert = require('assert')
var sinon = require('sinon')
var chai = require('chai')
-var Server = require('../server/server')
+var Server = require('../src/server/server')
var expect = chai.expect
var subscribeMessage = {
op: 'subscribe',
@@ -9,7 +9,7 @@ var _ = require('underscore')
var uuid = require('uuid')
describe('ServiceInterface', function () {
- var ServiceInterface = require('../server/service_interface')
+ var ServiceInterface = require('../src/server/service_interface')
var serviceInterface
beforeEach(function () {
serviceInterface = new ServiceInterface()
@@ -1,6 +1,6 @@
/* globals describe, it */
var assert = require('assert')
-var Stamper = require('../core/stamper.js')
+var Stamper = require('../src/core/stamper.js')
var sentryName = 'theSentryName'
var clientId = 'clientId'
@@ -1,6 +1,6 @@
/* globals describe, it, before, after, beforeEach, afterEach */
var assert = require('assert')
-var Status = require('../core/lib/resources/status')
+var Status = require('../src/core/lib/resources/status')
var Persistence = require('persistence')
var Common = require('./common.js')

0 comments on commit b284ce9

Please sign in to comment.