jimhigson / oboe.js

A streaming approach to JSON. Oboe.js speeds up web applications by providing parsed objects before the response completes.
http://oboejs.com
Other
4.78k stars 208 forks source link

Development process unclear? #174

Open wilg opened 6 years ago

wilg commented 6 years ago

I'm not certain if I'm doing something dumb, but I was just trying to get set up locally. I cloned and ran npm install and none of the tests seem to work. I'm not exactly sure what the intended dev workflow is. Is there documentation somewhere?

Are there unspecified dependencies or something? Stuff that needs to be installed globally? It's not obvious to me why the various scripts are failing – for example npm run webpack fails but the webpack package is in my node_modules folder but does not have a corresponding entry in .bin.

I have some familiarity with the various test runners that are in use, and I'll keep poking around but if anyone has any guidance that would be helpful!

› npm run test-node          

> oboe@2.1.4 test-node /Users/wil/Code/oboe.js
> jasmine JASMINE_CONFIG_PATH=jasmine.json

platform detection: { isNode: true, isInternetExplorer: false, isPhantom: false }
Started
.(node:56536) [DEP0016] DeprecationWarning: 'GLOBAL' is deprecated, use 'global'
Fevents.js:136
      throw er; // Unhandled 'error' event
      ^

Error: connect ECONNREFUSED 127.0.0.1:4567
    at Object._errnoException (util.js:999:13)
    at _exceptionWithHostPort (util.js:1020:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1207:14)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! oboe@2.1.4 test-node: `jasmine JASMINE_CONFIG_PATH=jasmine.json`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the oboe@2.1.4 test-node script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/wil/.npm/_logs/2018-06-25T23_05_21_281Z-debug.log
› npm run webpack

> oboe@2.1.4 webpack /Users/wil/Code/oboe.js
> webpack

sh: webpack: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! oboe@2.1.4 webpack: `webpack`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the oboe@2.1.4 webpack script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/wil/.npm/_logs/2018-06-25T23_07_00_144Z-debug.log
› npm test

Running "clean:0" (clean) task

Running "clean:1" (clean) task

Running "start-stream-source" task
>> do we have a streaming source already? false

Running "karma:single-dev" (karma) task
25 06 2018 16:07:33.458:ERROR [plugin]: Error during loading "/Users/wil/Code/oboe.js/node_modules/karma-phantomjs-launcher" plugin:
  The "path" argument must be of type string
Hash: de638abdc3d523f0bc87
Version: webpack 3.12.0
Time: 70ms
webpack: Compiled successfully.
webpack: Compiling...
Fatal error: Error parsing /Users/wil/Code/oboe.js/node_modules/webpack/node_modules/watchpack/node_modules/chokidar/node_modules/anymatch/node_modules/micromatch/node_modules/snapdragon/node_modules/define-property/node_modules/is-descriptor/node_modules/kind-of/package.json: Unexpected end of JSON input
npm ERR! Test failed.  See above for more details.
› npm run webpack

> oboe@2.1.4 webpack /Users/wil/Code/oboe.js
> webpack

sh: webpack: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! oboe@2.1.4 webpack: `webpack`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the oboe@2.1.4 webpack script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/wil/.npm/_logs/2018-06-25T23_08_16_692Z-debug.log
Aigeec commented 6 years ago

In general things are actually all run from grunt. The npm scripts are misleading, this I believe being written before npm scripts came into main stream usage. The scripts that are there are actually run by grunt tasks.

The Error: connect ECONNREFUSED 127.0.0.1:4567 errors you see are because the test generally expect there to be a stream source available. You can prefix your grunt tasks with the start-stream-source task

So for example if you were running the main browser build it would be something like:

grunt start-stream-source headless-mode karma:single-dev

Others would be

grunt start-stream-source headless-mode karma:single-dev
grunt start-stream-source headless-mode karma:single-http
grunt start-stream-source headless-mode karma:single-browser-http
grunt start-stream-source headless-mode karma:single-minified
grunt start-stream-source headless-mode browser-build karma:single-minified
grunt start-stream-source headless-mode browser-build karma:single-browser-http

All referring to various grunt tasks.

Checkout the Gruntfile.js for the list of available tasks.

wilg commented 6 years ago

Ah, OK, I'm not super familiar with grunt.

Still some issues: I'm not sure how to get grunt-cli installed. It's in node_modules and I also tried npm install -g grunt-cli and npm install grunt-cli --save-dev and ./node_modules/.bin/grunt start-stream-source headless-mode karma:single-dev.

Is there a particular version of Node that is required? I'm using v9.3.0 but can use nvm to switch to another. Doesn't look like there's an engine in package.json.

› grunt start-stream-source headless-mode karma:single-dev
>> Local Npm module "grunt-cli" not found. Is it installed?

Running "start-stream-source" task
>> do we have a streaming source already? false

Running "headless-mode" task

Running "karma:single-dev" (karma) task
25 06 2018 16:33:13.161:ERROR [plugin]: Error during loading "/Users/wil/Code/oboe.js/node_modules/karma-phantomjs-launcher" plugin:
  The "path" argument must be of type string
Hash: de638abdc3d523f0bc87
Version: webpack 3.12.0
Time: 70ms
webpack: Compiled successfully.
webpack: Compiling...
Fatal error: Error parsing /Users/wil/Code/oboe.js/node_modules/webpack/node_modules/watchpack/node_modules/chokidar/node_modules/anymatch/node_modules/micromatch/node_modules/snapdragon/node_modules/define-property/node_modules/is-descriptor/node_modules/kind-of/package.json: Unexpected end of JSON input
Aigeec commented 6 years ago

The grunt-cli message you can ignore.

v9 would be higher than I was using. Believe I was using v6 at the time.

I will do a clean checkout of it myself tomorrow and see if any updates are causing issues.

A

On Tue 26 Jun 2018, 00:36 Wil Gieseler, notifications@github.com wrote:

Ah, OK, I'm not super familiar with grunt.

Still some issues: I'm not sure how to get grunt-cli installed. It's in node_modules and I also tried npm install -g grunt-cli and npm install grunt-cli --save-dev and ./node_modules/.bin/grunt start-stream-source headless-mode karma:single-dev.

Is there a particular version of Node that is required? I'm using v9.3.0 but can use nvm to switch to another. Doesn't look like there's an engine in package.json.

› grunt start-stream-source headless-mode karma:single-dev

Local Npm module "grunt-cli" not found. Is it installed?

Running "start-stream-source" task

do we have a streaming source already? false

Running "headless-mode" task

Running "karma:single-dev" (karma) task 25 06 2018 16:33:13.161:ERROR [plugin]: Error during loading "/Users/wil/Code/oboe.js/node_modules/karma-phantomjs-launcher" plugin: The "path" argument must be of type string Hash: de638abdc3d523f0bc87 Version: webpack 3.12.0 Time: 70ms webpack: Compiled successfully. webpack: Compiling... Fatal error: Error parsing /Users/wil/Code/oboe.js/node_modules/webpack/node_modules/watchpack/node_modules/chokidar/node_modules/anymatch/node_modules/micromatch/node_modules/snapdragon/node_modules/define-property/node_modules/is-descriptor/node_modules/kind-of/package.json: Unexpected end of JSON input

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jimhigson/oboe.js/issues/174#issuecomment-400128478, or mute the thread https://github.com/notifications/unsubscribe-auth/AE207hYq-_aht07NzHnAYIuN3AK_oKEyks5uAXPfgaJpZM4U2_hQ .

wilg commented 6 years ago

Thanks!

Aigeec commented 6 years ago

With node version v6.11.4 clean install based on oboe.js master the command grunt start-stream-source headless-mode karma:single-dev works

26 06 2018 22:27:31.461:INFO [karma]: Karma v1.3.0 server started at http://localhost:9876/
26 06 2018 22:27:31.466:INFO [launcher]: Launching browser PhantomJS with unlimited concurrency
26 06 2018 22:27:31.482:INFO [launcher]: Starting browser PhantomJS
26 06 2018 22:27:33.045:INFO [PhantomJS 2.1.1 (Linux 0.0.0)]: Connected on socket /#XU6usJp2Cm1DkbMoAAAA with id 87092015
PhantomJS 2.1.1 (Linux 0.0.0) LOG: 'platform detection:', Object{isNode: false, isInternetExplorer: undefined, isPhantom: true}

PhantomJS 2.1.1 (Linux 0.0.0): Executed 436 of 436 SUCCESS (0.535 secs / 0.469 secs)

Done, without errors.