From 3f3f67a009abe57a849d84b3884c3398ca9b3707 Mon Sep 17 00:00:00 2001 From: Henrik Vendelbo Date: Sat, 17 Oct 2015 09:53:39 +0200 Subject: [PATCH 01/23] chore(release): Starting v0.4.5-SNAPSHOT --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 61a7cdb3..db815288 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "socketstream", "description": "A framework for Realtime Web Apps", - "version": "0.4.4", + "version": "0.4.5-SNAPSHOT", "license": "MIT", "homepage": "http://www.socketstream.org", "author": "Owen Barnes ", From b88e1bf693982adb3138df30f0becfc6a6f1dacf Mon Sep 17 00:00:00 2001 From: Henrik Vendelbo Date: Sat, 17 Oct 2015 10:24:29 +0200 Subject: [PATCH 02/23] chore(release): v0.4.5 --- CHANGELOG.md | 14 ++++++- Gruntfile.js | 13 ++----- docs/js/docs-setup.js | 37 +++++++------------ .../partials/api/bundler.default.default.html | 18 ++++----- docs/partials/api/bundler.html | 2 +- .../partials/api/bundler.webpack.webpack.html | 21 ----------- docs/partials/api/client.define.html | 2 +- .../api/client.formatters.formatters.html | 4 +- docs/partials/api/client.html | 2 +- docs/partials/api/client.task.html | 2 +- .../client.templateEngine.templateEngine.html | 6 +-- docs/partials/api/events.html | 2 +- docs/partials/api/http.index.index.html | 8 ++-- docs/partials/api/http.router.router.html | 6 +-- docs/partials/api/ss.add.html | 2 +- docs/partials/api/ss.bundler.bundler.html | 12 +++--- docs/partials/api/ss.client.client.html | 4 +- docs/partials/api/ss.env.html | 2 +- docs/partials/api/ss.html | 2 +- docs/partials/api/ss.log.log.html | 12 +++--- docs/partials/api/ss.orchestrator.html | 10 ----- docs/partials/api/ss.publish.publish.html | 6 +-- docs/partials/api/ss.root.html | 2 +- docs/partials/api/ss.server.server.html | 2 +- docs/partials/api/ss.version.html | 2 +- docs/partials/api/start.html | 2 +- docs/partials/api/utils.file.file.html | 10 ++--- docs/partials/api/utils.html | 2 +- docs/partials/api/utils.misc.misc.html | 10 ++--- .../api/utils.unique_set.UniqueSet.html | 12 +++--- docs/partials/tutorials/index.html | 1 + docs/partials/tutorials/modules.html | 12 ++++++ package.json | 5 +-- 33 files changed, 111 insertions(+), 136 deletions(-) delete mode 100644 docs/partials/api/bundler.webpack.webpack.html delete mode 100644 docs/partials/api/ss.orchestrator.html create mode 100644 docs/partials/tutorials/modules.html diff --git a/CHANGELOG.md b/CHANGELOG.md index 3312b46c..424edeac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ + +## [0.4.5](https://github.com/socketstream/socketstream/compare/0.4.4...v0.4.5) (2015-10-17) + + +### Features + +* **bundler:** multi source require of custom bundlers ([4b344a4](https://github.com/socketstream/socketstream/commit/4b344a4)) +* **gulp:** ss.tasks.use(gulp) API for gulpfile integration ([319b6a1](https://github.com/socketstream/socketstream/commit/319b6a1)) +* **test:** added a task for testing transporters 'test-socketstream' ([9ee6721](https://github.com/socketstream/socketstream/commit/9ee6721)) + + + ## [0.4.4](https://github.com/socketstream/socketstream/compare/0.4.3...v0.4.4) (2015-09-27) @@ -226,5 +238,3 @@ the browser, and goes against a principle of simplicity. The require lookup is n * Add task `grunt changelog` ([fa3ebef8](https://github.com/socketstream/socketstream/commit/fa3ebef82cac66c8c41625f131b5c7d7572d1297)) * **lib:** Users can now pass the NODE_ENV to set the environment ([09bb6c0d](https://github.com/socketstream/socketstream/commit/09bb6c0d69fbe4a290d6c6292e590a918ef985ac)) * **utils:** Add `ss.api.log` unified logging API ([5fcd9527](https://github.com/socketstream/socketstream/commit/5fcd952765580e3e7f4cb206e1810028039b2f0a)) - - diff --git a/Gruntfile.js b/Gruntfile.js index 77369aad..a60f4bb5 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -92,7 +92,7 @@ module.exports = function(grunt) { 'grunt build:docs', 'grunt is-clean:master', 'grunt version', //remove "-SNAPSHOT" from the project's version in package.json - 'grunt changelog' + 'npm changelog' ], 'release-complete': [ 'git commit CHANGELOG.md package.json -n -m "chore(release): v%version%"', @@ -112,14 +112,7 @@ module.exports = function(grunt) { 'git merge master', 'git checkout master' ] - }, - changelog: { - options: { - dest: 'CHANGELOG.md', - templateFile: 'src/docs/changelog.tpl.md', - github: 'socketstream/socketstream' - } - }, + } }); // Rename our watch task to 'delta', then make actual 'watch' @@ -236,4 +229,4 @@ module.exports = function(grunt) { grunt.registerTask('release:prepare', 'Run all the tests, generates CHANGELOG.md since laste release and and clean up version to just "major.minor.patch"', ['shell:release-prepare']); grunt.registerTask('release:complete', 'Complete release by commiting CHANGELOG.md and package.json and adding version tag', ['shell:release-complete', 'shell:update-gh-pages']); grunt.registerTask('release:push', 'Push to origin tags, master and gh-pages branches', ['shell:release-push']); -} \ No newline at end of file +} diff --git a/docs/js/docs-setup.js b/docs/js/docs-setup.js index 516caa83..f27c8c62 100644 --- a/docs/js/docs-setup.js +++ b/docs/js/docs-setup.js @@ -12,7 +12,7 @@ NG_DOCS={ "type": "overview", "moduleName": "index", "shortDescription": "Documentation", - "keywords": "app assets best cdns clients code demand developing documentation engine events exceptions experiment extending formats gazillion github handling io low-level message middleware models multiple overview packing practices production protocols reload request responder responders single-page socketstream support template templates tutorials workers wrappers" + "keywords": "app assets best cdns clients code demand developing documentation engine events exceptions experiment extending formats gazillion github handling indirectly io low-level message middleware models modules multiple node overview packing practices production protocols reload request responder responders single-page socketstream support template templates tutorials workers wrappers" }, { "section": "tutorials", @@ -149,6 +149,15 @@ NG_DOCS={ "shortDescription": "Loading Assets On Demand", "keywords": "additional allowing allows app application assets assume asynchronously automatic better blocking browser built-in caching call callback called client client-side code command contacting create default demand directly directory distinct example execute fancy file folder freeze function future good haven icloud ignore inside instantly js large ll load loaded loading module modules mount multiple namespace nature normal note overview pack requested requests require required retrieved returned root sadly safely sake search sections send server small socketstream ss sub-directories subsequent syntax tutorials var ve writing" }, + { + "section": "tutorials", + "id": "modules", + "shortName": "Modules", + "type": "overview", + "moduleName": "Modules", + "shortDescription": "Loading Modules from app", + "keywords": "allows api app assets build built builtin builtinpath bundlers choose code defaultid dependencies development engines extension-less filename formatters function install internal internally isn js load loaded loading main matched modules overview passed path plugins production project relative require socketstream ss supplied template time tutorials" + }, { "section": "tutorials", "id": "production_hosting", @@ -275,15 +284,6 @@ NG_DOCS={ "shortDescription": "The default bundler of HTML, CSS & JS", "keywords": "add allow api arguments array asset assetcss assethtml assetjs assetloader assets assetstart assettype assetworker attempt browser build bundle bundler called case cleancss client client-side code collection config content css default define depending describes dir directory entries entry extension file files function functions html htmltags implementation importedfrom includes initcode javascript js leading lib library libs list load loader local method minified minify module modules multiple names output pack path pre-loaded production pulled relative require resolveassetlink resource return script server service slash source special start started stopped strings system systemassets systemmodule tag tmpl tominifiedcss tominifiedjs type uglify unload vars view worker wrapcode wrapped wrapper" }, - { - "section": "api", - "id": "bundler.webpack:webpack", - "shortName": "webpack", - "type": "service", - "moduleName": "bundler", - "shortDescription": "The webpack bundler of HTML, CSS & JS", - "keywords": "api asset assettype bundler client collection concept css custom demonstration directory entries functions html improved initcode js libs list method modules output pack purposes relative service systemassets type validate view webpack" - }, { "section": "api", "id": "client", @@ -308,8 +308,8 @@ NG_DOCS={ "shortName": "formatters", "type": "service", "moduleName": "client", - "shortDescription": "Formatter registry", - "keywords": "api client formatter formatters registry service" + "shortDescription": "This is for the module returned by require('socketstream').client.formatters.", + "keywords": "add api asset client config configuring define formatter formatters method module nameormodule object parameters rendering require returned service socketstream" }, { "section": "api", @@ -317,8 +317,8 @@ NG_DOCS={ "shortName": "formatters", "type": "service", "moduleName": "client", - "shortDescription": "This is for the module returned by require('socketstream').client.formatters.", - "keywords": "add api asset client config configuring define formatter formatters method module nameormodule object parameters rendering require returned service socketstream" + "shortDescription": "Formatter registry", + "keywords": "api client formatter formatters registry service" }, { "section": "api", @@ -417,15 +417,6 @@ NG_DOCS={ "shortDescription": "Contains method stubs for logging to console (by default) or", "keywords": "api apply arguments assigning calls choose console debug default error fairly function happened info informed keeping level log logging method override parameters plugins provider require service socketstream ss stubs switch sysadmin takes time trace tracing trivial unexpected var wakeup warn winston" }, - { - "section": "api", - "id": "ss.orchestrator", - "shortName": "ss.orchestrator", - "type": "service", - "moduleName": "ss", - "shortDescription": "Internal Orchestrator for starting the server or building resources.", - "keywords": "api building currently experimental internal note orchestrator resources server service ss starting" - }, { "section": "api", "id": "ss.publish:publish", diff --git a/docs/partials/api/bundler.default.default.html b/docs/partials/api/bundler.default.default.html index 40ffb290..efa4f098 100644 --- a/docs/partials/api/bundler.default.default.html +++ b/docs/partials/api/bundler.default.default.html @@ -1,4 +1,4 @@ - Improve this doc View source

default + Improve this doc View source

default
service in module bundler
@@ -7,7 +7,7 @@

The default bundler of HTML, CSS & JS

Methods

-
  • entries(assetType, systemAssets)

    +
    • entries(assetType, systemAssets)

      Provides the view and the pack functions with a list of entries for an asset type relative to the client directory. The default implementation is used.

      @@ -26,41 +26,41 @@
      Returns
      [AssetEntry]

      List of output entries

    • -
    • htmlTags(type, pack)

      +
    • htmlTags(type, pack)

      Function called by view.js to build the view HTML

      Parameters
      ParamTypeDetails
      typeString

      Either start/js/css

      packBoolean

      Pack with resolveAssetLink ?

      Returns
      [String]

      List of script tag strings

    • -
    • load()

      +
    • load()

      Called when the server is started. Does nothing.

    • -
    • system()

      +
    • system()

      Return entries for the loader/start/module depending on includes.system client config and system assets. Multiple arguments will attempt to add module for the name. Special module names are 'loader' and 'start'.

      Returns
      AssetEntry

      Resource entries array

    • -
    • toMinifiedCSS(files)

      +
    • toMinifiedCSS(files)

      Minify JavaScript using CleanCSS

      Parameters
      ParamTypeDetails
      filesArray

      Entries with file path and content to be minified

      Returns
      String

      Minified content

    • -
    • toMinifiedJS(files)

      +
    • toMinifiedJS(files)

      Minify JavaScript using Uglify

      Parameters
      ParamTypeDetails
      filesArray

      Entries with file path and content to be minified

      Returns
      String

      Minified content

    • -
    • unload()

      +
    • unload()

      Called when the server is stopped. Does nothing.

    • -
    • wrapCode(assetType, systemAssets)

      +
    • wrapCode(assetType, systemAssets)

      Before client-side code is sent to the browser any file which is NOT a library (e.g. /client/code/libs) is wrapped in a module wrapper (to keep vars local and allow you to require() one file in another).

      The 'system' directory is a special case - any module placed in this dir will not have a leading slash

      diff --git a/docs/partials/api/bundler.html b/docs/partials/api/bundler.html index bb2011e5..af9ca611 100644 --- a/docs/partials/api/bundler.html +++ b/docs/partials/api/bundler.html @@ -1,4 +1,4 @@ - Improve this doc View source

      bundler + Improve this doc View source

      bundler

      diff --git a/docs/partials/api/bundler.webpack.webpack.html b/docs/partials/api/bundler.webpack.webpack.html deleted file mode 100644 index 4d8760c2..00000000 --- a/docs/partials/api/bundler.webpack.webpack.html +++ /dev/null @@ -1,21 +0,0 @@ - Improve this doc View source

      webpack -
      service in module bundler - -
      -

      -

      Description

      -

      The webpack bundler of HTML, CSS & JS

      -

      This is just for demonstration purposes and to validate the custom bundler concept. It can be improved.

      -
      -

      Methods

      -
      • entries(assetType, systemAssets)

        -

        Provides the view and the pack functions with a -list of entries for an asset type relative to the client directory.

        -
        Parameters
        ParamTypeDetails
        assetTypeString

        js/css/tmpl

        -
        systemAssetsObject

        Collection of libs, modules, initCode

        -
        Returns
        [AssetEntry]

        List of output entries

        -
        -
      • -
      -
      -
      diff --git a/docs/partials/api/client.define.html b/docs/partials/api/client.define.html index a255580c..ae1cc46f 100644 --- a/docs/partials/api/client.define.html +++ b/docs/partials/api/client.define.html @@ -1,4 +1,4 @@ - Improve this doc View source

      define + Improve this doc View source

      define
      service in module client
      diff --git a/docs/partials/api/client.formatters.formatters.html b/docs/partials/api/client.formatters.formatters.html index c22d70c2..7c6502de 100644 --- a/docs/partials/api/client.formatters.formatters.html +++ b/docs/partials/api/client.formatters.formatters.html @@ -1,4 +1,4 @@ - Improve this doc View source

      formatters + Improve this doc View source

      formatters
      service in module client
      @@ -7,7 +7,7 @@

      This is for the module returned by require('socketstream').client.formatters.

      Methods

      -
      • add(nameOrModule, config)

        +
        • add(nameOrModule, config)

          Parameters
          ParamTypeDetails
          nameOrModulestringobject

          the formatter object or name

          configobject

          parameters configuring the formatter

          diff --git a/docs/partials/api/client.html b/docs/partials/api/client.html index e466a9ae..ce187276 100644 --- a/docs/partials/api/client.html +++ b/docs/partials/api/client.html @@ -1,4 +1,4 @@ - Improve this doc View source

          client + Improve this doc View source

          client

          diff --git a/docs/partials/api/client.task.html b/docs/partials/api/client.task.html index d70126a7..fe04c6f5 100644 --- a/docs/partials/api/client.task.html +++ b/docs/partials/api/client.task.html @@ -1,4 +1,4 @@ - Improve this doc View source

          task + Improve this doc View source

          task
          service in module client
          diff --git a/docs/partials/api/client.templateEngine.templateEngine.html b/docs/partials/api/client.templateEngine.templateEngine.html index e40b44d7..00f51874 100644 --- a/docs/partials/api/client.templateEngine.templateEngine.html +++ b/docs/partials/api/client.templateEngine.templateEngine.html @@ -1,4 +1,4 @@ - Improve this doc View source

          templateEngine + Improve this doc View source

          templateEngine
          service in module client
          @@ -7,7 +7,7 @@

          This is for the module returned by require('socketstream').client.templateEngine.

          Methods

          -
          • generate(bundler, files, cb)

            +
            • generate(bundler, files, cb)

              Generate output (as a string) from Template Engines

              function(out) {
                 if (typeof out === 'string') {
              @@ -26,7 +26,7 @@
               

    • -
    • use(name, dirs, config)

      +
    • use(name, dirs, config)

      Use a template engine for the 'dirs' indicated (will use it on all '/' dirs within /client/templates by default)

      To make templates in /client/ember-view available in Ember.

      ss.client.templateEngine.use('ember','./ember-view');
      diff --git a/docs/partials/api/events.html b/docs/partials/api/events.html
      index 9e286439..c38b44ea 100644
      --- a/docs/partials/api/events.html
      +++ b/docs/partials/api/events.html
      @@ -1,4 +1,4 @@
      - Improve this doc View source

      events + Improve this doc View source

      events

      diff --git a/docs/partials/api/http.index.index.html b/docs/partials/api/http.index.index.html index b5c67e06..c1d0c4fd 100644 --- a/docs/partials/api/http.index.index.html +++ b/docs/partials/api/http.index.index.html @@ -1,4 +1,4 @@ - Improve this doc View source

      index + Improve this doc View source

      index
      service in module http
      @@ -9,7 +9,7 @@ which can be used by the application in any way it wishes.

      Methods

      -
      • load(staticPath, sessionStore, sessionOptions)

        +
        • load(staticPath, sessionStore, sessionOptions)

          Attached Middleware, Session store, staticCache, etc, to the this.middleware (var app = connect())

          Parameters
          ParamTypeDetails
          staticPathString

          Static path for connect for serving static assets as *.js, *.css, etc.

          sessionStoreObject

          Session store instance object

          @@ -17,14 +17,14 @@
          Returns
          Object

          Updated, with attached Middleware, this.middleware(var app = connect()) instance

        • -
        • route(url, fn)

          +
        • route(url, fn)

          Expose short-form routing API

          Parameters
          ParamTypeDetails
          urlString

          Url string for routing

          fnFunction

          Callback function for url

          Returns
          Object

          res.serveClient(name) object

        • -
        • set(newSettings)

          +
        • set(newSettings)

          Merge optional settings

          Parameters
          ParamTypeDetails
          newSettingsObject

          Object with settins, @link settings

          diff --git a/docs/partials/api/http.router.router.html b/docs/partials/api/http.router.router.html index f9d8e704..099c420e 100644 --- a/docs/partials/api/http.router.router.html +++ b/docs/partials/api/http.router.router.html @@ -1,4 +1,4 @@ - Improve this doc View source

          router + Improve this doc View source

          router
          service in module http
          @@ -7,13 +7,13 @@

          Right now the router is simply an EventEmitter. This may change in the future

          Methods

          -
          • on(url, cb)

            +
            • on(url, cb)

              Parameters
              ParamTypeDetails
              urlString

              Url to route

              cbFunction

              Callback function for url

              Returns
              Object

              this.ee instance

            • -
            • route(url, req, res)

              +
            • route(url, req, res)

              Try the original route first for speed. If none exists, recursively fall back until we find a route, if possible This allows us to fully support HTML5 pushState 'mock routing' across multiple single-page clients

              Parameters
              ParamTypeDetails
              urlString

              Url to route

              diff --git a/docs/partials/api/ss.add.html b/docs/partials/api/ss.add.html index e7cbd9c1..c1448f24 100644 --- a/docs/partials/api/ss.add.html +++ b/docs/partials/api/ss.add.html @@ -1,4 +1,4 @@ - Improve this doc View source

              add + Improve this doc View source

              add
              service in module ss
              diff --git a/docs/partials/api/ss.bundler.bundler.html b/docs/partials/api/ss.bundler.bundler.html index 10782bf0..cfcbae1f 100644 --- a/docs/partials/api/ss.bundler.bundler.html +++ b/docs/partials/api/ss.bundler.bundler.html @@ -1,4 +1,4 @@ - Improve this doc View source

              bundler + Improve this doc View source

              bundler
              service in module ss
              @@ -8,12 +8,12 @@

              Client bundling API for implementing a custom bundler.

              Methods

              -
              • define(client, args)

                +
                • define(client, args)

                  Parameters
                  ParamTypeDetails
                  clientstring

                  object to store the definition in

                  argsobject

                  arguments passed to define

                • -
                • destsFor(client)

                  +
                • destsFor(client)

                  The define client method of all bundlers must return the file locations for the client.

                  return ss.bundler.destsFor(client);
                   

                  To offer a very different way to define the entry-points for assets the bundler can tweak @@ -22,17 +22,17 @@

              Returns
              object

              Destinations paths, relPaths, dir, containerDir

            • -
            • get(client)

              +
            • get(client)

              Determine the bundler for a client

              Parameters
              ParamTypeDetails
              clientobjectstring

              Query params with client=name or an actual client object

            • -
            • systemLibs()

              +
            • systemLibs()

              A single entry for all system libraries.

              Returns
              AssetEntry

              Entry

            • -
            • systemModule(name, wrap)

              +
            • systemModule(name, wrap)

              Describe a system module.

              Parameters
              ParamTypeDetails
              nameString

              Name of the system module to return in a descriptor

              wrapboolean

              Shall the content be wrapped in require.define. Default is true.

              diff --git a/docs/partials/api/ss.client.client.html b/docs/partials/api/ss.client.client.html index 115c788d..a7a1a8c0 100644 --- a/docs/partials/api/ss.client.client.html +++ b/docs/partials/api/ss.client.client.html @@ -1,4 +1,4 @@ - Improve this doc View source

              client + Improve this doc View source

              client
              service in module ss
              @@ -7,7 +7,7 @@

              Allow other libs to send assets to the client

              Methods

              -
              • send(type, name, content, options)

                +
                • send(type, name, content, options)

                  Allow other libs to send assets to the client. add new System Library or Module

                  Parameters
                  ParamTypeDetails
                  type'code','lib','module'
                  • code, lib, module.
                  • diff --git a/docs/partials/api/ss.env.html b/docs/partials/api/ss.env.html index 3e81ddc4..88d0b9aa 100644 --- a/docs/partials/api/ss.env.html +++ b/docs/partials/api/ss.env.html @@ -1,4 +1,4 @@ - Improve this doc View source

                    env + Improve this doc View source

                    env
                    service in module ss
                    diff --git a/docs/partials/api/ss.html b/docs/partials/api/ss.html index f2b7f47e..04167192 100644 --- a/docs/partials/api/ss.html +++ b/docs/partials/api/ss.html @@ -1,4 +1,4 @@ - Improve this doc View source

                    + Improve this doc View source

                    diff --git a/docs/partials/api/ss.log.log.html b/docs/partials/api/ss.log.log.html index e9848435..69ff3fcb 100644 --- a/docs/partials/api/ss.log.log.html +++ b/docs/partials/api/ss.log.log.html @@ -1,4 +1,4 @@ - Improve this doc View source

                    log + Improve this doc View source

                    log
                    service in module ss
                    @@ -8,7 +8,7 @@ whatever logging provider you choose.

                  Methods

                  -
                  • debug()

                    +
                    • debug()

                      Debug level logging, uses console.log by default. Override by assigning a function that takes the same parameters as console.log:

                      var ss = require('socketstream');
                      @@ -18,7 +18,7 @@
                       
                  -
                • error()

                  +
                • error()

                  Error level logging, uses console.error by default. Override by assigning a function that takes the same parameters as console.error.

                  Example

                  @@ -26,7 +26,7 @@
                • -
                • info()

                  +
                • info()

                  Info level logging, uses console.log by default. Override by assigning a function that takes the same parameters as console.log.

                  Example

                  @@ -34,7 +34,7 @@
                • -
                • trace()

                  +
                • trace()

                  Trace function calls in socketstream and plugins. By default nothing is done. If you want to switch on tracing override the trace method.

                  var ss = require('socketstream');
                  @@ -43,7 +43,7 @@
                   };
                   
                • -
                • warn()

                  +
                • warn()

                  Warn level logging, uses console.log by default. Override by assigning a function that takes the same parameters as console.log:

                  var ss = require('socketstream'),
                  diff --git a/docs/partials/api/ss.orchestrator.html b/docs/partials/api/ss.orchestrator.html
                  deleted file mode 100644
                  index b15c230d..00000000
                  --- a/docs/partials/api/ss.orchestrator.html
                  +++ /dev/null
                  @@ -1,10 +0,0 @@
                  - Improve this doc View source

                  orchestrator -
                  service in module ss - -
                  -

                  -

                  Description

                  -

                  Internal Orchestrator for starting the server or building resources.

                  -

                  Note: currently experimental

                  -
                  -
                  diff --git a/docs/partials/api/ss.publish.publish.html b/docs/partials/api/ss.publish.publish.html index 5963b6d3..15da841d 100644 --- a/docs/partials/api/ss.publish.publish.html +++ b/docs/partials/api/ss.publish.publish.html @@ -1,4 +1,4 @@ - Improve this doc View source

                  publish + Improve this doc View source

                  publish
                  service in module ss
                  @@ -7,13 +7,13 @@

                  Extend the internal API with a publish object you can call from your own server-side code

                  Methods

                  -
                  • all(name, first)

                    +
                    • all(name, first)

                      Publish event to all active client browsers

                      Parameters
                      ParamTypeDetails
                      namestring

                      Name of the event

                      firstany

                      First parameter (open ended)

                    • -
                    • channel(channel, event, first)

                      +
                    • channel(channel, event, first)

                      Publish event to all active client browsers in given channel

                      Parameters
                      ParamTypeDetails
                      channelstringarray

                      Name of the channel(s)

                      eventstring

                      Name of the event

                      diff --git a/docs/partials/api/ss.root.html b/docs/partials/api/ss.root.html index edb8f814..df66c747 100644 --- a/docs/partials/api/ss.root.html +++ b/docs/partials/api/ss.root.html @@ -1,4 +1,4 @@ - Improve this doc View source

                      root + Improve this doc View source

                      root
                      service in module ss
                      diff --git a/docs/partials/api/ss.server.server.html b/docs/partials/api/ss.server.server.html index 2b97a0f4..d043a993 100644 --- a/docs/partials/api/ss.server.server.html +++ b/docs/partials/api/ss.server.server.html @@ -1,4 +1,4 @@ - Improve this doc View source

                      server + Improve this doc View source

                      server
                      service in module ss
                      diff --git a/docs/partials/api/ss.version.html b/docs/partials/api/ss.version.html index f878335e..050fbc55 100644 --- a/docs/partials/api/ss.version.html +++ b/docs/partials/api/ss.version.html @@ -1,4 +1,4 @@ - Improve this doc View source

                      version + Improve this doc View source

                      version
                      service in module ss
                      diff --git a/docs/partials/api/start.html b/docs/partials/api/start.html index cd2911cd..5d9a0e49 100644 --- a/docs/partials/api/start.html +++ b/docs/partials/api/start.html @@ -1,4 +1,4 @@ - Improve this doc View source

                      start + Improve this doc View source

                      start

                      diff --git a/docs/partials/api/utils.file.file.html b/docs/partials/api/utils.file.file.html index 2eba4993..4c101648 100644 --- a/docs/partials/api/utils.file.file.html +++ b/docs/partials/api/utils.file.file.html @@ -1,4 +1,4 @@ - Improve this doc View source

                      file + Improve this doc View source

                      file
                      service in module utils
                      @@ -7,7 +7,7 @@

                      This is used to maintain lists of userIds to socketIds and channelIds to socketIds

                      Methods

                      -
                      • findExtForBasePath(basepath)

                        +
                        • findExtForBasePath(basepath)

                          Given a basename, find a matching file with an extension.

                          Parameters
                          ParamTypeDetails
                          basepathObject

                          Path to directory

                          Returns
                          Array|null

                          Array of files or null

                          @@ -19,17 +19,17 @@
                          -
                        • isDir()

                          +
                        • isDir()

                          In synchronous mode returns if givven filePath is directory or not

                          Returns
                          Boolean

                          TRUE if givven filePath is dorectory

                        • -
                        • loadPackageJSON()

                          +
                        • loadPackageJSON()

                          Loads SocketStream's package.json file from the root directory

                          Returns
                          Object|Error

                          JSON object or thorws an eror if unable to find or parse SocketStream's package.json file

                        • -
                        • readDirSync(start)

                          +
                        • readDirSync(start)

                          Reads the contents of a dir. Adapted from https://gist.github.com/825583

                          Parameters
                          ParamTypeDetails
                          startString

                          Directory absolute path to lookup

                          diff --git a/docs/partials/api/utils.html b/docs/partials/api/utils.html index 7a1e0b7b..e9c542ae 100644 --- a/docs/partials/api/utils.html +++ b/docs/partials/api/utils.html @@ -1,4 +1,4 @@ - Improve this doc View source

                          utils + Improve this doc View source

                          utils

                          diff --git a/docs/partials/api/utils.misc.misc.html b/docs/partials/api/utils.misc.misc.html index bf58f08e..ca8defca 100644 --- a/docs/partials/api/utils.misc.misc.html +++ b/docs/partials/api/utils.misc.misc.html @@ -1,4 +1,4 @@ - Improve this doc View source

                          misc + Improve this doc View source

                          misc
                          service in module utils
                          @@ -7,27 +7,27 @@

                          Module contains misc methods

                          Methods

                          -
                          • defaults(args, defaults)

                            +
                            • defaults(args, defaults)

                              Useful for declaring default parameter

                              Parameters
                              ParamTypeDetails
                              argsObject

                              Arguments

                              defaultsObject

                              Default arguments

                              Returns
                              Object

                              Extended object

                            • -
                            • extend(obj, <objects>)

                              +
                            • extend(obj, <objects>)

                              Taken from underscore.js

                              Parameters
                              ParamTypeDetails
                              objObject

                              Object to extend

                              <Objects>

                              to extend with

                              Returns
                              Object

                              Extended object

                            • -
                            • parseWsMessage(msg)

                              +
                            • parseWsMessage(msg)

                              Parse incoming websocket messages into message type and contents

                              Parameters
                              ParamTypeDetails
                              msgString

                              Message to parse

                              Returns
                              Array

                              Array, where [0] is message type, [1] is message's body

                            • -
                            • randomString(len)

                              +
                            • randomString(len)

                              Parameters
                              ParamTypeDetails
                              lenString

                              Length of the expected string

                              Returns
                              String

                              uuid string

                              diff --git a/docs/partials/api/utils.unique_set.UniqueSet.html b/docs/partials/api/utils.unique_set.UniqueSet.html index 4a82d8a3..e7f7f694 100644 --- a/docs/partials/api/utils.unique_set.UniqueSet.html +++ b/docs/partials/api/utils.unique_set.UniqueSet.html @@ -1,4 +1,4 @@ - Improve this doc View source

                              UniqueSet + Improve this doc View source

                              UniqueSet
                              service in module utils
                              @@ -7,30 +7,30 @@

                              This is used to maintain lists of userIds to socketIds and channelIds to socketIds

                              Methods

                              -
                              • add(key, value)

                                +
                                • add(key, value)

                                  Add specific key/value set

                                  Parameters
                                  ParamTypeDetails
                                  keyString

                                  Key name

                                  valueMixed

                                  Value to be assigned to the key

                                • -
                                • keys()

                                  +
                                • keys()

                                  Returns array of keys

                                  Returns
                                  Array

                                  Array of all the keys names

                                • -
                                • members()

                                  +
                                • members()

                                  Returns array with all the values by certain key

                                  Returns
                                  Array

                                  Array of all the keys for specified key

                                • -
                                • remove(key, value)

                                  +
                                • remove(key, value)

                                  Remove specific key/value set

                                  Parameters
                                  ParamTypeDetails
                                  keyString

                                  Key name

                                  valueMixed

                                  Value related to the key

                                  Returns
                                  Boolean

                                  Remove state

                                • -
                                • removeFromAll(value)

                                  +
                                • removeFromAll(value)

                                  Remove all specific key/value sets accotding to value

                                  Parameters
                                  ParamTypeDetails
                                  valueMixed

                                  Value as a link for removal all the sets

                                  Returns
                                  Boolean

                                  Removal status

                                  diff --git a/docs/partials/tutorials/index.html b/docs/partials/tutorials/index.html index 961f7a3c..2b1364d2 100644 --- a/docs/partials/tutorials/index.html +++ b/docs/partials/tutorials/index.html @@ -28,6 +28,7 @@
                                  Best Practices
                                  Extending SocketStream
                                  diff --git a/docs/partials/tutorials/modules.html b/docs/partials/tutorials/modules.html new file mode 100644 index 00000000..3588e04b --- /dev/null +++ b/docs/partials/tutorials/modules.html @@ -0,0 +1,12 @@ + Improve this doc

                                  +
                                  +
                                  +

                                  +

                                  Loading Modules from app

                                  +

                                  Development Dependencies

                                  +

                                  During development the bundlers, formatters and template engines are loaded as plugins using ss.require. This allows you to not require development time code in your app.js. If you choose to build production assets beforehand, you can keep these dependencies as development dependencies and only install production dependencies.

                                  +

                                  Internal require

                                  +

                                  The internal require is used to load modules that may be built in or supplied by the project. It is a function on the API passed to plugins and used internally.

                                  +

                                  ss.require(id,builtinPath,defaultId) The builtin path is the relative path within socketstream +where the builtin modules are found. The defaultId is the extension-less filename loaded when the main id isn't matched.

                                  +
                                  diff --git a/package.json b/package.json index db815288..7ede7587 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "socketstream", "description": "A framework for Realtime Web Apps", - "version": "0.4.5-SNAPSHOT", + "version": "0.4.5", "license": "MIT", "homepage": "http://www.socketstream.org", "author": "Owen Barnes ", @@ -54,7 +54,7 @@ "chokidar": "~1.1.0", "commander": "2.8.1", "connect-livereload": "~0.5.2", - "conventional-changelog": "^0.4.3", + "conventional-changelog": "^0.5.0", "coveralls": "~2.11.4", "fs-extra": "~0.24.0", "gently": "~0.10.0", @@ -64,7 +64,6 @@ "grunt-contrib-clean": "~0.6.0", "grunt-contrib-connect": "~0.11.2", "grunt-contrib-watch": "~0.6.1", - "grunt-conventional-changelog": "~4.1.0", "grunt-ngdocs": "~0.2.9", "istanbul": "~0.3.18", "jshint": "~2.8.0", From 9aab93a111250af49c949c9096ea4ce62ac3fe57 Mon Sep 17 00:00:00 2001 From: Henrik Vendelbo Date: Sat, 17 Oct 2015 10:26:40 +0200 Subject: [PATCH 03/23] version --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ce679354..6a3ad5a7 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ SocketStream is a framework for Realtime Web Apps -_Latest release: 0.4.4 ([view changelog](https://github.com/socketstream/socketstream/blob/master/HISTORY.md))_ +_Latest release: 0.4.5 ([view changelog](https://github.com/socketstream/socketstream/blob/master/HISTORY.md))_ [Live demo](http://demo.socketstream.com) | [Documentation](http://socketstream.github.io/socketstream/docs/) @@ -86,7 +86,7 @@ This upcoming is expected in late 2015. The current state can be found on the `n *Creator:* Owen Barnes -*Core Contributors:* +*Core Contributors:* - Paul Jensen - Roman Minkin From e7cb63d383dc88ff002312f187445d29a86cd41f Mon Sep 17 00:00:00 2001 From: Henrik Vendelbo Date: Sun, 15 Nov 2015 19:11:56 +0100 Subject: [PATCH 04/23] serving HTTP --- .../tutorials/en/serving_http_resources.ngdoc | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/docs/tutorials/en/serving_http_resources.ngdoc diff --git a/src/docs/tutorials/en/serving_http_resources.ngdoc b/src/docs/tutorials/en/serving_http_resources.ngdoc new file mode 100644 index 00000000..f4e65453 --- /dev/null +++ b/src/docs/tutorials/en/serving_http_resources.ngdoc @@ -0,0 +1,24 @@ +@ngdoc overview +@name Serving HTTP Resources + +@description +# Serving HTTP Resources + +With Mobile phones being the new king of personal communication it is crucial for your website to work more like +and application and less like a centralised portal. It is crucial to work in an online/offline world. + +SocketStream has until now had an event based Router. In 0.5 this is being replaced. Routing will come back in some other form in 1.0 + +The aim is to push assets and content to edge caches and ideally directly onto the client devices. This means that the content of your +application must be identified so it can be push out before it is needed, so the traditional Connect/Express model pulls you in the wrong direction. + +That being said the paradigm of defining REST resources is a very good one and fits into where the we is and will be going with HTTP version 2. +So you should continue to define your content with URL semantics. Go ahead and base your implementation on Connect/Express middleware. +We've prepared some examples for you for +[Express](https://github.com/socketstream/ss-examples/tree/master/express-4-and-js) and +[Connect](https://github.com/socketstream/ss-examples/tree/master/connect-and-engineio). + +In the future Express apps will be extended with semantics for real-time endpoints. Permissions will be span both HTTP, streaming and +client side semantics. + +For this reason the use of middlewares are likely to change. `ss.http.middleware` still mostly works but is deprecated. From 695b956375026bb7e2c5be656038fd979c32d04f Mon Sep 17 00:00:00 2001 From: Mikael Sand Date: Mon, 14 Nov 2016 12:49:52 +0200 Subject: [PATCH 05/23] Fix Issue https://github.com/socketstream/socketstream/issues/609 Call stream(plan.httpServer); after running tasks, such that responders are defined when the WebSocket layer is loaded. Pass the plan as an argument to tasks.defaults(plan); such that the decision to include the start-server task in the load-socketstream task can be based on plan.httpServer instead of ss.server.httpServer. --- lib/socketstream.js | 8 ++++---- lib/tasks/defaults.js | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/socketstream.js b/lib/socketstream.js index 4465d416..9814e49a 100644 --- a/lib/socketstream.js +++ b/lib/socketstream.js @@ -224,15 +224,15 @@ function start() { var plan = tasks.plan(arguments); + tasks.defaults(plan); + + tasks.start(plan.targets,plan.callback); + // Hook in streaming if called with HTTP server if (plan.httpServer) { stream(plan.httpServer); } - tasks.defaults(); - - tasks.start(plan.targets,plan.callback); - if (!exitRegistered) { process.on('exit', api.unload); exitRegistered = true; diff --git a/lib/tasks/defaults.js b/lib/tasks/defaults.js index 0f9e1899..5c19c12c 100644 --- a/lib/tasks/defaults.js +++ b/lib/tasks/defaults.js @@ -11,7 +11,7 @@ var http = require('http'), module.exports = function(ss, router, options, orchestrator) { - return function() { + return function(plan) { ss.defaultTask('start-server',function(done) { var server = http.Server(ss.http.middleware); @@ -48,7 +48,7 @@ module.exports = function(ss, router, options, orchestrator) { }); // if the server was passed in ss.start(httpServer) one shouldn't be started - ss.defaultTask('load-socketstream', (ss.server.httpServer == null)? ['start-server','load-api']:['load-api']); + ss.defaultTask('load-socketstream', (plan.httpServer == null)? ['start-server','load-api']:['load-api']); // task: ondemand // Listen out for requests to async load new assets From 916b173faa3dfad421f00e99907ad70aae71ba97 Mon Sep 17 00:00:00 2001 From: Mikael Sand Date: Mon, 14 Nov 2016 16:15:31 +0200 Subject: [PATCH 06/23] Fix bundling of socketstream transport layer and assignTransport call. Move the ss.stream(plan.httpServer); call to a separate attach-stream task. Ensure that attach-stream task is executed after load-api and before packing. (cherry picked from commit 1e1bb3c) --- lib/socketstream.js | 7 +------ lib/tasks/defaults.js | 9 ++++++--- lib/tasks/index.js | 2 +- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/lib/socketstream.js b/lib/socketstream.js index 9814e49a..fb9740e0 100644 --- a/lib/socketstream.js +++ b/lib/socketstream.js @@ -207,7 +207,7 @@ function unload() { client.unload(); client.assets.unload(); http.unload(); - api.server.responders = undefined; + if (api.server) api.server.responders = undefined; ws.unload(); } @@ -228,11 +228,6 @@ function start() { tasks.start(plan.targets,plan.callback); - // Hook in streaming if called with HTTP server - if (plan.httpServer) { - stream(plan.httpServer); - } - if (!exitRegistered) { process.on('exit', api.unload); exitRegistered = true; diff --git a/lib/tasks/defaults.js b/lib/tasks/defaults.js index 5c19c12c..0db3bdee 100644 --- a/lib/tasks/defaults.js +++ b/lib/tasks/defaults.js @@ -14,13 +14,16 @@ module.exports = function(ss, router, options, orchestrator) { return function(plan) { ss.defaultTask('start-server',function(done) { - var server = http.Server(ss.http.middleware); + var server = plan.httpServer = http.Server(ss.http.middleware); server.listen(3000, function() { - ss.stream(server); done(); }); }); + ss.defaultTask('attach-stream', function() { + ss.stream(plan.httpServer); + }); + ss.defaultTask('load-api', function() { ss.load(); }); @@ -48,7 +51,7 @@ module.exports = function(ss, router, options, orchestrator) { }); // if the server was passed in ss.start(httpServer) one shouldn't be started - ss.defaultTask('load-socketstream', (plan.httpServer == null)? ['start-server','load-api']:['load-api']); + ss.defaultTask('load-socketstream', (plan.httpServer == null)? ['start-server','load-api', 'attach-stream']:['load-api', 'attach-stream']); // task: ondemand // Listen out for requests to async load new assets diff --git a/lib/tasks/index.js b/lib/tasks/index.js index a16d4792..bbcddadb 100644 --- a/lib/tasks/index.js +++ b/lib/tasks/index.js @@ -40,7 +40,7 @@ module.exports = function(ss, router, options) { orchestrator:orchestrator, //TODO remove it from here and ss.api _packTasks: function(all) { - var tasks = all? ['load-api']:['pack-prepare','load-api']; + var tasks = all? ['load-api', 'attach-stream']:['pack-prepare', 'load-api', 'attach-stream']; ss.bundler.forEach(function(bundler){ if (all) { tasks.push(bundler.client.name + ':pack'); From 55077b679f28afd6be5ac105baf3e1b15bd4ea79 Mon Sep 17 00:00:00 2001 From: Mikael Sand Date: Mon, 14 Nov 2016 18:55:04 +0200 Subject: [PATCH 07/23] Fix SS_PACK=1 behaviour. Fix use of lastest packed id bundle when uncaughtException handler is not set. --- lib/client/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/client/index.js b/lib/client/index.js index 2860da32..a91d8388 100644 --- a/lib/client/index.js +++ b/lib/client/index.js @@ -19,7 +19,7 @@ var options = {}; function setDefaultOptions(options) { // Determine if assets should be (re)packed on startup - var packEnv = process.env['SS_PACK']; + var packEnv = process.env['SS_PACK'] && {all: true, keepOldFiles: true, id: shortid.generate()}; options.packedAssets = packEnv || false; @@ -183,6 +183,9 @@ module.exports = function(ss) { options.packedAssets = opts || true; options.servePacked = opts || true; options.liveReload = false; + ss.bundler.forEach(function(bundler) { + bundler.useLatestsPackedId(); + }); // As it's safe to assume we're running in production mode at this point, if your app is not catching uncaught // errors with its own custom error handling code, step in and prevent any exceptions from taking the server down @@ -192,9 +195,6 @@ module.exports = function(ss) { return log.error(err.stack); }); } - ss.bundler.forEach(function(bundler) { - bundler.useLatestsPackedId(); - }); }, // Define a new Single Page Client From 9df128f5ab20a15ec040df69be191f410f4d0c0b Mon Sep 17 00:00:00 2001 From: Mikael Sand Date: Tue, 15 Nov 2016 00:01:42 +0200 Subject: [PATCH 08/23] Fix cross platform EOL and separators in tests. --- lib/tasks/defaults.js | 2 + package.json | 6 +- test/fixtures/index.js | 5 +- test/unit/client/bundler/default.test.js | 61 ++++++++++--------- test/unit/client/bundler/index.test.js | 18 +++--- test/unit/client/constants.test.js | 9 +-- test/unit/client/formatters/html.test.js | 3 +- .../unit/client/formatters/javascript.test.js | 5 +- test/unit/client/index.test.js | 43 ++++++------- test/unit/client/serve/dev.test.js | 5 +- test/unit/client/serve/ondemand.test.js | 5 +- test/unit/client/template_engine.test.js | 5 +- .../client/template_engines/angular.test.js | 29 ++++----- .../client/template_engines/default.test.js | 5 +- .../client/template_engines/ember.test.js | 3 +- test/unit/require.test.js | 4 +- 16 files changed, 111 insertions(+), 97 deletions(-) diff --git a/lib/tasks/defaults.js b/lib/tasks/defaults.js index 0db3bdee..540ae4ea 100644 --- a/lib/tasks/defaults.js +++ b/lib/tasks/defaults.js @@ -13,6 +13,8 @@ module.exports = function(ss, router, options, orchestrator) { return function(plan) { + plan = plan || {}; + ss.defaultTask('start-server',function(done) { var server = plan.httpServer = http.Server(ss.http.middleware); server.listen(3000, function() { diff --git a/package.json b/package.json index 7ede7587..69fd07df 100644 --- a/package.json +++ b/package.json @@ -85,9 +85,9 @@ "lint": "node_modules/.bin/jshint .", "notes": "node_modules/.bin/notes", "changelog": "node_modules/.bin/conventional-changelog -p angular -i CHANGELOG.md -w", - "test": "node_modules/.bin/mocha test/unit/**/* --reporter spec", - "quick-test": "node_modules/.bin/mocha test/unit/**/* --reporter progress", - "test-debug": "node_modules/.bin/mocha --debug-brk test/unit/**/* --reporter spec" + "test": "node_modules/.bin/mocha test/unit/**/*.js --reporter spec", + "quick-test": "node_modules/.bin/mocha test/unit/**/*.js --reporter progress", + "test-debug": "node_modules/.bin/mocha --debug-brk test/unit/**/*.js --reporter spec" }, "pre-commit": [ "lint", diff --git a/test/fixtures/index.js b/test/fixtures/index.js index a8f6ef02..a7f4d149 100644 --- a/test/fixtures/index.js +++ b/test/fixtures/index.js @@ -33,7 +33,8 @@ exports.setAbcPreviousAbcAssets = function() { fs.closeSync(fs.openSync(path.join(__dirname,'project/client/static/assets/abc',id+'.html'),'w')); }; -exports.expected_css = '/* style.css */\nbody {color:red;}\n'; -exports.expected_css_packed = 'body{color:red;}\n'; +var os = require('os'), EOL = os.EOL; +exports.expected_css = '/* style.css */' + EOL + 'body {color:red;}' + EOL; +exports.expected_css_packed = 'body{color:red;}' + EOL; exports.expected_html_packed = fs.readFileSync(path.join(__dirname,'project/client/abc/expected.html'),'utf-8'); exports.expected_js_packed = fs.readFileSync(path.join(__dirname,'project/client/abc/expected.min.js'),'utf-8'); diff --git a/test/unit/client/bundler/default.test.js b/test/unit/client/bundler/default.test.js index c15c6c8c..10ef1f20 100644 --- a/test/unit/client/bundler/default.test.js +++ b/test/unit/client/bundler/default.test.js @@ -7,6 +7,7 @@ var path = require('path'), options = ss.client.options, defineAbcClient = require('../abcClient'), fixtures = require('../../../fixtures'); +var os = require('os'), EOL = os.EOL; describe('default bundler:', function () { @@ -42,9 +43,9 @@ describe('default bundler:', function () { client.id.should.be.type('string'); client.paths.should.be.type('object'); - client.paths.css.should.be.eql(['client/css/main']); - client.paths.code.should.be.eql(['client/code/main/demo.coffee']); - client.paths.view.should.be.eql('client/views/main.jade'); + client.paths.css.should.be.eql([path.join('client', 'css', 'main')]); + client.paths.code.should.be.eql([path.join('client', 'code', 'main', 'demo.coffee')]); + client.paths.view.should.be.eql(path.join('client', 'views', 'main.jade')); client.paths.tmpl.should.be.eql([]); client.entryInitPath.should.be.equal('/client/code/main/demo'); @@ -141,10 +142,10 @@ describe('default bundler:', function () { client.id.should.be.type('string'); client.paths.should.be.type('object'); - client.paths.css.should.be.eql(['client/css/main']); - client.paths.code.should.be.eql(['client/code/main/demo.coffee']); - client.paths.view.should.be.eql('client/views/main.jade'); - client.paths.tmpl.should.be.eql(['client/templates/chat/message.jade']); + client.paths.css.should.be.eql([path.join('client', 'css', 'main')]); + client.paths.code.should.be.eql([path.join('client', 'code', 'main', 'demo.coffee')]); + client.paths.view.should.be.eql(path.join('client', 'views', 'main.jade')); + client.paths.tmpl.should.be.eql([path.join('client', 'templates', 'chat', 'message.jade')]); }); }); @@ -172,10 +173,10 @@ describe('default bundler:', function () { client.id.should.be.type('string'); client.paths.should.be.type('object'); - client.paths.css.should.be.eql(['more/a']); - client.paths.code.should.be.eql(['more/a/a.js']); - client.paths.view.should.be.eql('more/a/a.html'); - client.paths.tmpl.should.be.eql(['more/a/a.html']); + client.paths.css.should.be.eql([path.join('more', 'a')]); + client.paths.code.should.be.eql([path.join('more', 'a', 'a.js')]); + client.paths.view.should.be.eql(path.join('more', 'a', 'a.html')); + client.paths.tmpl.should.be.eql([path.join('more', 'a', 'a.html')]); }); }); @@ -229,9 +230,9 @@ describe('default bundler:', function () { client.id.should.be.type('string'); client.paths.should.be.type('object'); - client.paths.css.should.be.eql(['client/abc/style.css']); - client.paths.code.should.be.eql(['client/abc/index.js']); - client.paths.view.should.be.eql('client/abc/abc.html'); + client.paths.css.should.be.eql([path.join('client', 'abc', 'style.css')]); + client.paths.code.should.be.eql([path.join('client', 'abc', 'index.js')]); + client.paths.view.should.be.eql(path.join('client', 'abc', 'abc.html')); client.paths.tmpl.should.be.eql([]); client.entryInitPath.should.be.equal('/client/abc/index'); @@ -362,7 +363,7 @@ describe('default bundler:', function () { // css entries entriesCSS[0].file.should.be.equal('client/abc/style.css'); - entriesCSS[0].importedBy.should.be.equal('client/abc/style.css'); + entriesCSS[0].importedBy.should.be.equal(path.join('client', 'abc', 'style.css')); }); it('should return no entries for css if not in includes', function() { @@ -407,7 +408,7 @@ describe('default bundler:', function () { // mod TODO entriesJS[4].file.should.be.equal('client/abc/index.js'); - entriesJS[4].importedBy.should.be.equal('client/abc/index.js'); + entriesJS[4].importedBy.should.be.equal(path.join('client', 'abc', 'index.js')); //entriesJS[4].type.should.be.equal('mod'); //entriesJS.should.be.equal([{ path:'./abc.js'}]); @@ -441,7 +442,7 @@ describe('default bundler:', function () { // mod TODO entriesJS[4].file.should.be.equal('client/abc/index.js'); - entriesJS[4].importedBy.should.be.equal('client/abc/index.js'); + entriesJS[4].importedBy.should.be.equal(path.join('client', 'abc', 'index.js')); //entriesJS[4].type.should.be.equal('mod'); // start TODO @@ -464,7 +465,7 @@ describe('default bundler:', function () { // mod TODO entriesJS[0].file.should.be.equal('client/abc/index.js'); - entriesJS[0].importedBy.should.be.equal('client/abc/index.js'); + entriesJS[0].importedBy.should.be.equal(path.join('client', 'abc', 'index.js')); }); it('should render css asset file as empty if includes is false'); @@ -494,7 +495,7 @@ describe('default bundler:', function () { // css entriesCSS[0].file.should.be.equal('client/abc/style.css'); - entriesCSS[0].importedBy.should.be.equal('client/abc'); + entriesCSS[0].importedBy.should.be.equal(path.join('client', 'abc')); entriesCSS[0].assetType.should.be.equal('css'); // libs @@ -511,7 +512,7 @@ describe('default bundler:', function () { // mod TODO entriesJS[4].file.should.be.equal('client/abc/index.js'); - entriesJS[4].importedBy.should.be.equal('client/abc/index.js'); + entriesJS[4].importedBy.should.be.equal(path.join('client', 'abc', 'index.js')); //entriesJS[4].type.should.be.equal('mod'); // start TODO @@ -576,8 +577,8 @@ describe('default bundler:', function () { '', 'ABC', '

                                  ABC

                                  ', - '\n' - ].join('\n')) + '' + EOL + ].join(EOL)) }); }); @@ -599,8 +600,8 @@ describe('default bundler:', function () { '', 'ABC', '

                                  ABC

                                  ', - '\n' - ].join('\n')); + '' + EOL + ].join(EOL)); done(); }); }); @@ -625,8 +626,8 @@ describe('default bundler:', function () { '', 'ABC', '

                                  ABC

                                  ', - '\n' - ].join('\n')) + '' + EOL + ].join(EOL)) }); }); @@ -831,8 +832,8 @@ describe('default bundler:', function () { '', 'ABC', '

                                  ABC

                                  ', - '\n' - ].join('\n')) + '' + EOL + ].join(EOL)) }); }); @@ -851,8 +852,8 @@ describe('default bundler:', function () { '', 'ABC', '

                                  ABC

                                  ', - '\n' - ].join('\n')) + '' + EOL + ].join(EOL)) }); }); diff --git a/test/unit/client/bundler/index.test.js b/test/unit/client/bundler/index.test.js index 60a058b1..33860dba 100644 --- a/test/unit/client/bundler/index.test.js +++ b/test/unit/client/bundler/index.test.js @@ -28,9 +28,9 @@ describe('bundler', function () { tmpl: 'main.html' }); - paths.css.should.eql(['client/css/main.css']); - paths.code.should.eql(['client/code/main.js']); - paths.tmpl.should.eql(['client/templates/main.html']); + paths.css.should.eql([path.join('client', 'css', 'main.css')]); + paths.code.should.eql([path.join('client', 'code', 'main.js')]); + paths.tmpl.should.eql([path.join('client', 'templates', 'main.html')]); }); it('should return bundler given id', function() { @@ -117,7 +117,7 @@ describe('bundler', function () { var templates = ss.api.bundler.entries(client,'tmpl'); templates.should.eql([{ - file: 'client/templates/main.html', importedBy: 'client/templates/main.html', includeType: 'html', ext:'html', bundle:'tmpl', assetType:'html' + file: 'client/templates/main.html', importedBy: path.join('client','templates','main.html'), includeType: 'html', ext:'html', bundle:'tmpl', assetType:'html' }]); @@ -133,9 +133,9 @@ describe('bundler', function () { var templates = ss.api.bundler.entries(client,'tmpl'); templates.should.eql([ - { file: 'client/templates/main.html', importedBy: 'client/templates/main.html', includeType: 'html', ext:'html', bundle:'tmpl', assetType:'html' }, - { file: 'client/templates/abc/1.html', importedBy: 'client/templates/abc/1.html', includeType: 'html', ext:'html', bundle:'tmpl', assetType:'html' }, - { file: 'client/templates/abc/2.html', importedBy: 'client/templates/abc/2.html', includeType: 'html', ext:'html', bundle:'tmpl', assetType:'html' } + { file: 'client/templates/main.html', importedBy: path.join('client','templates','main.html'), includeType: 'html', ext:'html', bundle:'tmpl', assetType:'html' }, + { file: 'client/templates/abc/1.html', importedBy: path.join('client','templates','abc','1.html'), includeType: 'html', ext:'html', bundle:'tmpl', assetType:'html' }, + { file: 'client/templates/abc/2.html', importedBy: path.join('client','templates','abc','2.html'), includeType: 'html', ext:'html', bundle:'tmpl', assetType:'html' } ]); }); @@ -150,8 +150,8 @@ describe('bundler', function () { var templates = ss.api.bundler.entries(client,'tmpl'); templates.should.eql([ - { file: 'client/templates/abc/1.html', importedBy: 'client/templates/abc', includeType: 'html', ext:'html', bundle:'tmpl', assetType:'html' }, - { file: 'client/templates/abc/2.html', importedBy: 'client/templates/abc', includeType: 'html', ext:'html', bundle:'tmpl', assetType:'html' } + { file: 'client/templates/abc/1.html', importedBy: path.join('client', 'templates', 'abc'), includeType: 'html', ext:'html', bundle:'tmpl', assetType:'html' }, + { file: 'client/templates/abc/2.html', importedBy: path.join('client', 'templates', 'abc'), includeType: 'html', ext:'html', bundle:'tmpl', assetType:'html' } ]); }); diff --git a/test/unit/client/constants.test.js b/test/unit/client/constants.test.js index a2f73375..1e288595 100644 --- a/test/unit/client/constants.test.js +++ b/test/unit/client/constants.test.js @@ -5,6 +5,7 @@ var ss = require( '../../../lib/socketstream'), Router = require('../../../lib/http/router').Router, defineAbcClient = require('./abcClient'); +var os = require('os'), EOL = os.EOL; var view = require('../../../lib/client/view'); var responseStub = { @@ -130,12 +131,12 @@ describe('constants',function() { ss.client.formatters.add('html'); }); - var expectedHtml = '\n'+ - 'ABC\n'+ + var expectedHtml = ''+ EOL + + 'ABC'+ EOL + '

                                  ABC

                                  '+ ''+ - '\n'+ - '\n'; + ''+ EOL + + ''+ EOL; view(ss.api, client, options, function(output) { output.should.equal(expectedHtml); diff --git a/test/unit/client/formatters/html.test.js b/test/unit/client/formatters/html.test.js index eb89a71d..c1aa5afc 100644 --- a/test/unit/client/formatters/html.test.js +++ b/test/unit/client/formatters/html.test.js @@ -4,6 +4,7 @@ var path = require('path'), ss = require( '../../../../lib/socketstream'), fixtures = require('../../../fixtures'); +var os = require('os'), EOL = os.EOL; describe('html formatter', function () { @@ -41,7 +42,7 @@ describe('html formatter', function () { var output; concrete.call(path.join(fixtures.project,'client/abc/ss.html'),{},function(out) { output = out; - out.should.be.equal('\nABC\n

                                  ABC

                                  \n\n'); + out.should.be.equal(['', 'ABC', '

                                  ABC

                                  ', '' + EOL].join(EOL)); },function(err) { should(err).be.equal(undefined); }); diff --git a/test/unit/client/formatters/javascript.test.js b/test/unit/client/formatters/javascript.test.js index abf966a6..0dcd01ba 100644 --- a/test/unit/client/formatters/javascript.test.js +++ b/test/unit/client/formatters/javascript.test.js @@ -4,6 +4,7 @@ var path = require('path'), ss = require( '../../../../lib/socketstream'), fixtures = require('../../../fixtures'); +var os = require('os'), EOL = os.EOL; describe('js formatter', function () { @@ -43,7 +44,7 @@ describe('js formatter', function () { var output; concrete.call(path.join(fixtures.project, 'client/abc/index.js'),{},function(out) { output = out; - out.should.be.equal('// test\n'); + out.should.be.equal('// test' + EOL); },function(err) { should(err).be.equal(undefined); }); @@ -60,7 +61,7 @@ describe('js formatter', function () { var output; concrete.call(path.join(fixtures.project, 'client/abc/index.js'), {}, function (out) { output = out; - out.should.be.equal('// test\n'); + out.should.be.equal('// test' + EOL); }, function (err) { should(err).be.equal(undefined); }); diff --git a/test/unit/client/index.test.js b/test/unit/client/index.test.js index 2db122aa..11751691 100644 --- a/test/unit/client/index.test.js +++ b/test/unit/client/index.test.js @@ -8,6 +8,7 @@ var path = require('path'), //defineAbcClient = require('./abcClient'), fixtures = require('../../fixtures'); +var os = require('os'), EOL = os.EOL; describe('client asset manager', function () { @@ -145,7 +146,7 @@ describe('client asset manager', function () { ss.tasks.defaults(); ss.tasks.orchestrator.tasks.default.dep.should.eql(['load-socketstream','pack-if-needed','serve']); - ss.tasks.orchestrator.tasks['pack-if-needed'].dep.should.eql(['pack-prepare','load-api','abc:pack-needed','abc:pack']); + ss.tasks.orchestrator.tasks['pack-if-needed'].dep.should.eql(['pack-prepare','load-api','attach-stream','abc:pack-needed','abc:pack']); logHook.off(); }); }); @@ -256,10 +257,10 @@ describe('client asset manager', function () { }); it('should render the ABC view (with start)', function(done) { - var expectedHtml = '\n' + - 'ABC\n' + - '

                                  ABC

                                  \n' + - '\n'; + var expectedHtml = '' + EOL + + 'ABC' + EOL + + '

                                  ABC

                                  ' + EOL + + '' + EOL; var client = ss.client.define('abc', { css: './abc/style.css', @@ -276,10 +277,10 @@ describe('client asset manager', function () { it('should render the ABC view (without start)', function(done) { - var expectedHtml = '\n' + - 'ABC\n' + - '

                                  ABC

                                  \n' + - '\n'; + var expectedHtml = '' + EOL + + 'ABC' + EOL + + '

                                  ABC

                                  ' + EOL + + '' + EOL; options.startInBundle = true; @@ -303,12 +304,12 @@ describe('client asset manager', function () { }); client.pack = true; - var expectedHtml = ('\n' + + var expectedHtml = ('' + EOL + 'ABC' + '' + - '' + '\n' + - '

                                  ABC

                                  \n' + - '\n').replace(/m1bf9lApd/g, client.id); + '' + '' + EOL + + '

                                  ABC

                                  ' + EOL + + '' + EOL).replace(/m1bf9lApd/g, client.id); view(ss.api, client, options, function (output) { output.should.equal(expectedHtml); @@ -326,12 +327,12 @@ describe('client asset manager', function () { }); client.pack = true; - var expectedHtml = ('\n' + + var expectedHtml = ('' + EOL + 'ABC' + '' + - ''+ '\n' + - '

                                  ABC

                                  \n' + - '\n').replace(/m1bf9lApd/g,client.id); + ''+ '' + EOL + + '

                                  ABC

                                  ' + EOL + + '' + EOL).replace(/m1bf9lApd/g,client.id); view(ss.api, client, options, function(output) { output.should.equal(expectedHtml); @@ -348,11 +349,11 @@ describe('client asset manager', function () { }); client.pack = true; - var expectedHtml = ('\n' + + var expectedHtml = ('' + EOL + 'ABC' + - ''+ '\n' + - '

                                  ABC

                                  \n' + - '\n').replace(/m1bf9lApd/g,client.id); + ''+ '' + EOL + + '

                                  ABC

                                  ' + EOL + + '' + EOL).replace(/m1bf9lApd/g,client.id); view(ss.api, client, options, function(output) { output.should.equal(expectedHtml); diff --git a/test/unit/client/serve/dev.test.js b/test/unit/client/serve/dev.test.js index 9eef5a03..ea724969 100644 --- a/test/unit/client/serve/dev.test.js +++ b/test/unit/client/serve/dev.test.js @@ -8,6 +8,7 @@ var path = require('path'), defineAbcClient = require('../abcClient'), fixtures = require('../../../fixtures'); +var os = require('os'), EOL = os.EOL; var responseStub = { writeHead: function() {}, end: function(body) { @@ -71,12 +72,12 @@ describe('development mode asset server', function () { // dev time URL var req = {url: '/assets/abc/'+client.id+'.js?_=/client/abc/index.js' }; router.route(req.url,req,responseStub).should.equal(true); - responseStub.body.should.equal('require.define("/client/abc/index", function (require, module, exports, __dirname, __filename){\n// test\n\n});'); + responseStub.body.should.equal('require.define("/client/abc/index", function (require, module, exports, __dirname, __filename){\n// test' + EOL + '\n});'); // dev time URL req = {url: '/assets/abc/'+client.id+'.js?_=client/abc/index.js' }; router.route(req.url,req,responseStub).should.equal(true); - responseStub.body.should.equal('require.define("/client/abc/index", function (require, module, exports, __dirname, __filename){\n// test\n\n});'); + responseStub.body.should.equal('require.define("/client/abc/index", function (require, module, exports, __dirname, __filename){\n// test' + EOL + '\n});'); }); diff --git a/test/unit/client/serve/ondemand.test.js b/test/unit/client/serve/ondemand.test.js index 8a631eee..868ad67a 100644 --- a/test/unit/client/serve/ondemand.test.js +++ b/test/unit/client/serve/ondemand.test.js @@ -7,6 +7,7 @@ var path = require('path'), defineAbcClient = require('../abcClient'), fixtures = require('../../../fixtures'); +var os = require('os'), EOL = os.EOL; var responseStub = { writeHead: function() {}, end: function(body) { @@ -36,7 +37,7 @@ describe('production mode asset server', function () { // dev time URL var req = {url: '/_serve/code?extras/e1.js' }; router.route(req.url,req,responseStub).should.equal(true); - responseStub.body.should.equal('var e1 = 1;\n'); + responseStub.body.should.equal('var e1 = 1;' + EOL); }); it('should provide a bundle of javascript code for a directory entry'); @@ -51,7 +52,7 @@ describe('production mode asset server', function () { // dev time URL var req = {url: '/_serve/worker?/pi.js' }; router.route(req.url,req,responseStub).should.equal(true); - responseStub.body.should.equal('// calc pi\n'); + responseStub.body.should.equal('// calc pi' + EOL); }); diff --git a/test/unit/client/template_engine.test.js b/test/unit/client/template_engine.test.js index cc4bcf0c..dd66c068 100644 --- a/test/unit/client/template_engine.test.js +++ b/test/unit/client/template_engine.test.js @@ -6,6 +6,7 @@ var path = require('path'), defineAbcClient = require('./abcClient'), fixtures = require('../../fixtures'); +var os = require('os'), EOL = os.EOL; describe('Template engine', function() { @@ -91,7 +92,7 @@ describe('Template engine', function() { var files = [ bundler.entryFor('tmpl','client/templates/1.html') ]; ss.client.templateEngine.generate(bundler, files, function (tag) { - tag.should.be.equal(''); + tag.should.be.equal(''); done(); }); }); @@ -109,7 +110,7 @@ describe('Template engine', function() { var files = [ bundler.entryFor('tmpl','client/templates/1.html') ]; ss.client.templateEngine.generate(bundler, files, function (tag) { - tag.should.be.equal(''); + tag.should.be.equal(''); done(); }); }); diff --git a/test/unit/client/template_engines/angular.test.js b/test/unit/client/template_engines/angular.test.js index b43ee732..f92b5aaa 100644 --- a/test/unit/client/template_engines/angular.test.js +++ b/test/unit/client/template_engines/angular.test.js @@ -8,6 +8,7 @@ var path = require('path'), fixtures = require('../../../fixtures'); +var os = require('os'), EOL = os.EOL; describe('angular.js template engine', function () { fixtures.setProject('project'); @@ -30,7 +31,7 @@ describe('angular.js template engine', function () { templates.length.should.be.equal(1); ss.client.templateEngine.generate(bundler, templates, function (tag) { - tag.should.be.equal(''); + tag.should.be.equal(''); done(); }); }); @@ -60,7 +61,7 @@ describe('angular.js template engine', function () { var files = [ bundler.entryFor('tmpl','client/templates/1.html') ]; ss.client.templateEngine.generate(bundler, files, function (tag) { - tag.should.be.equal(''); + tag.should.be.equal(''); done(); }); }); @@ -76,7 +77,7 @@ describe('angular.js template engine', function () { var files = [ bundler.entryFor('tmpl','client/templates/1.html') ]; ss.client.templateEngine.generate(bundler, files, function (tag) { - tag.should.be.equal(''); + tag.should.be.equal(''); done(); }); }); @@ -92,8 +93,8 @@ describe('angular.js template engine', function () { var files = [ bundler.entryFor('tmpl','client/abc/abc.html') ]; ss.client.templateEngine.generate(bundler, files, function (tag) { - tag.should.be.equal(''); + tag.should.be.equal(''); done(); }); }); @@ -110,10 +111,10 @@ describe('angular.js template engine', function () { var files1 = [ bundler.entryFor('tmpl','client/templates/1.html') ]; ss.client.templateEngine.generate(bundler, files, function(tag) { - tag.should.be.equal(''); + tag.should.be.equal(''); ss.client.templateEngine.generate(bundler, files1, function(tag) { - tag.should.be.equal(''); + tag.should.be.equal(''); done(); }); }); @@ -133,10 +134,10 @@ describe('angular.js template engine', function () { // console.log('fake', files); ss.client.templateEngine.generate(bundler, files, function(tag) { - tag.should.be.equal(''); + tag.should.be.equal(''); ss.client.templateEngine.generate(bundler, files1, function(tag) { - tag.should.be.equal(''); + tag.should.be.equal(''); done(); }); }); @@ -156,8 +157,8 @@ describe('angular.js template engine', function () { templates.length.should.be.equal(2); ss.client.templateEngine.generate(bundler, templates, function(tag) { - tag.should.be.equal(''); done(); }); @@ -179,8 +180,8 @@ describe('angular.js template engine', function () { // console.log('real',templates); ss.client.templateEngine.generate(bundler, templates, function(tag) { - tag.should.be.equal(''); done(); }); @@ -201,7 +202,7 @@ describe('angular.js template engine', function () { var files = [ bundler.entryFor('tmpl','more/a/a.html') ]; ss.client.templateEngine.generate(bundler, files, function (tag) { - tag.should.be.equal(''); + tag.should.be.equal(''); done(); }); }); diff --git a/test/unit/client/template_engines/default.test.js b/test/unit/client/template_engines/default.test.js index d54c07d9..b0da46a6 100644 --- a/test/unit/client/template_engines/default.test.js +++ b/test/unit/client/template_engines/default.test.js @@ -7,6 +7,7 @@ var path = require('path'), options = ss.client.options, fixtures = require('../../../fixtures'); +var os = require('os'), EOL = os.EOL; describe('default template engine', function () { @@ -36,7 +37,7 @@ describe('default template engine', function () { var files = [ bundler.entryFor('tmpl','client/templates/1.html') ]; ss.client.templateEngine.generate(bundler, files, function(tag) { - tag.should.be.equal(''); + tag.should.be.equal(''); done(); }); @@ -57,7 +58,7 @@ describe('default template engine', function () { var files = [ bundler.entryFor('tmpl','client/templates/abc/1.html') ]; ss.client.templateEngine.generate(bundler, files, function(tag) { - tag.should.be.equal(''); + tag.should.be.equal(''); done(); }); diff --git a/test/unit/client/template_engines/ember.test.js b/test/unit/client/template_engines/ember.test.js index 538bf696..3318d889 100644 --- a/test/unit/client/template_engines/ember.test.js +++ b/test/unit/client/template_engines/ember.test.js @@ -5,6 +5,7 @@ var path = require('path'), options = ss.client.options, fixtures = require('../../../fixtures'); +var os = require('os'), EOL = os.EOL; describe('Ember.js template engine', function () { fixtures.setProject('project'); @@ -33,7 +34,7 @@ describe('Ember.js template engine', function () { var files = [ bundler.entryFor('tmpl','client/templates/1.html') ]; ss.client.templateEngine.generate(bundler, files, function(tag) { - tag.should.be.equal(''); + tag.should.be.equal(''); done(); }); diff --git a/test/unit/require.test.js b/test/unit/require.test.js index 58bebe9b..e38ad805 100644 --- a/test/unit/require.test.js +++ b/test/unit/require.test.js @@ -1,6 +1,6 @@ 'use strict'; -var ss = require( '../../fixtures/socketstream'); +var ss = require( '../fixtures/socketstream'); describe('ss.require', function() { @@ -8,4 +8,4 @@ describe('ss.require', function() { var mod = ss.require('default','client/bundler'); expect(mod).should.be(require('../../../lib/client/bundler/default')); }); -}); \ No newline at end of file +}); From 54c94c4661a0f5dcb4fcbf091d56cfc4768259a6 Mon Sep 17 00:00:00 2001 From: Andrii Melnykov Date: Fri, 24 May 2019 01:03:53 +0300 Subject: [PATCH 09/23] refactor: fix a lint suggestion --- lib/socketstream.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/socketstream.js b/lib/socketstream.js index fb9740e0..b138a13c 100644 --- a/lib/socketstream.js +++ b/lib/socketstream.js @@ -207,7 +207,9 @@ function unload() { client.unload(); client.assets.unload(); http.unload(); - if (api.server) api.server.responders = undefined; + if (api.server) { + api.server.responders = undefined; + } ws.unload(); } From 2fb951c9010143cc4ce034a8f4ddc00173e20839 Mon Sep 17 00:00:00 2001 From: Andrii Melnykov Date: Fri, 24 May 2019 01:06:52 +0300 Subject: [PATCH 10/23] fix(deps): update dependencies --- package.json | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index 69fd07df..fb725647 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "socketstream", "description": "A framework for Realtime Web Apps", - "version": "0.4.5", + "version": "0.4.6", "license": "MIT", "homepage": "http://www.socketstream.org", "author": "Owen Barnes ", @@ -23,28 +23,29 @@ "dependencies": { "apitree": "1.2.0", "async": "1.4.2", - "body-parser": "1.13.3", + "body-parser": "1.19.0", "clean-css": "3.3.9", "colors": "1.1.2", - "compression": "1.5.2", - "connect": "3.4.0", + "compression": "1.7.4", + "connect": "3.7.0", "connect-redis": "2.4.1", - "connect-static": "1.5.0", + "connect-static": "1.5.2", + "conventional-changelog-cli": "^2.0.21", "cookie-parser": "1.3.5", - "cookie-session": "1.2.0", + "cookie-session": "1.3.3", "cookies": "0.5.0", "csurf": "1.8.3", "engine.io": "1.5.2", "escape-html": "1.0.2", "eventemitter2": "= 0.4.14", - "express-session": "1.11.3", + "express-session": "1.16.1", "glob": "5.0.14", "orchestrator": "0.3.7", "parseurl": "1.3.0", "redis": "0.12.1", - "send": "0.13.0", - "serve-favicon": "2.3.0", - "serve-static": "1.10.0", + "send": "0.17.1", + "serve-favicon": "2.5.0", + "serve-static": "1.14.1", "shortid": "2.2.2", "uglify-js": "2.4.24", "uid2": "0.0.3", @@ -54,7 +55,7 @@ "chokidar": "~1.1.0", "commander": "2.8.1", "connect-livereload": "~0.5.2", - "conventional-changelog": "^0.5.0", + "conventional-changelog": "^3.1.8", "coveralls": "~2.11.4", "fs-extra": "~0.24.0", "gently": "~0.10.0", @@ -65,9 +66,9 @@ "grunt-contrib-connect": "~0.11.2", "grunt-contrib-watch": "~0.6.1", "grunt-ngdocs": "~0.2.9", - "istanbul": "~0.3.18", - "jshint": "~2.8.0", - "lolex": "^1.3.1", + "istanbul": "0.4.5", + "jshint": "2.10.2", + "lolex": "1.3.1", "mocha": "~2.3.3", "notes": "0.0.4", "npm-dview": "~2.0.0", From 5750182b195ce8d3710ebd4617387a84241e98f3 Mon Sep 17 00:00:00 2001 From: Andrii Melnykov Date: Fri, 24 May 2019 01:29:02 +0300 Subject: [PATCH 11/23] chore(CI): use LTS and current versions of node See https://nodejs.org/en/about/releases/ - node_modules caching is not reliable with npm - npm upgrade seems breaking older releases - the final newline is a common convention on Unix --- .travis.yml | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 143a34b6..dfe2e15a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,8 @@ language: node_js node_js: - - 0.10 - - 0.12 - - iojs - -cache: - directories: - - node_modules - -before_install: - - npm install --upgrade npm -g + - 8 + - 10 + - 12 script: - npm run cover-test @@ -19,4 +12,4 @@ notifications: urls: - https://webhooks.gitter.im/e/7937aa9d2e9d767d0421 on_success: always - on_failure: always \ No newline at end of file + on_failure: always From 97eda7e0c7de7b35ca3b843ad3c4a01f95bd925b Mon Sep 17 00:00:00 2001 From: Andrii Melnykov Date: Fri, 24 May 2019 04:52:31 +0300 Subject: [PATCH 12/23] feat(deps): update engine.io to 3.3.2 This fixes installation problems related to `bufferutil` and `utf-8-validate` --- lib/websocket/transports/engineio/client.js | 8685 ++++++++++--------- package.json | 2 +- 2 files changed, 4647 insertions(+), 4040 deletions(-) diff --git a/lib/websocket/transports/engineio/client.js b/lib/websocket/transports/engineio/client.js index 9ce215bb..11c1861f 100644 --- a/lib/websocket/transports/engineio/client.js +++ b/lib/websocket/transports/engineio/client.js @@ -1,4040 +1,4647 @@ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.eio=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o