Beta 7 with some repo names changed.

This commit is contained in:
Luis Fernando Molina committed 2020-11-15 13:05:19 +01:00
1 parent 0f7b40cca7
commit 963c19493a
3408 files changed
+462217 -15516

No files matched your search

+298
View File
@@ -0,0 +1,298 @@
module.exports = function (grunt) {
function runNpmScript (command, cb) {
var opts = {
cmd: 'npm',
args: ['run', command],
opts: {
stdio: 'inherit'
}
}
grunt.util.spawn(opts, function (error, result, code) {
if (error) {
grunt.fail.warn(command + ' failed.')
}
cb()
})
}
var autoStartBrowsers = ['Chrome', 'Firefox', 'Safari']
var STREAM_SOURCE_PORT_HTTP = 4567
var FILES_TRIGGERING_KARMA = [
'src/**/*.js',
'test/specs/*.spec.js',
'test/libs/*.js',
'test/*.js'
]
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
clean: ['dist/*.js', 'build/*.js'],
karma: {
options: {
singleRun: true,
proxies: {
'/testServer': 'http://localhost:' + STREAM_SOURCE_PORT_HTTP
},
// test results reporter to use
// possible values: 'dots', 'progress', 'junit'
reporters: ['progress'],
// enable / disable colors in the output (reporters and logs)
colors: true
},
'coverage': {
reporters: ['coverage'],
preprocessors: {
// source files to generate coverage for
// (these files will be instrumented by Istanbul)
'src/**/*.js': ['coverage']
},
'browsers': ['PhantomJS'],
configFile: 'test/unit.conf.js'
},
'precaptured-dev': {
// for doing a single test run with already captured browsers during development.
// this is good for running tests in browsers karma can't easily start such as
// IE running inside a Windows VM on a unix dev environment
browsers: [],
configFile: 'test/unit.conf.js',
singleRun: 'true'
},
'single-dev': {
browsers: autoStartBrowsers,
configFile: 'test/unit.conf.js'
},
'single-concat': {
browsers: autoStartBrowsers,
configFile: 'test/concat.conf.js'
},
'single-minified': {
browsers: autoStartBrowsers,
configFile: 'test/min.conf.js'
},
'single-amd': {
browsers: autoStartBrowsers,
configFile: 'test/amd.conf.js'
},
'single-browser-http': {
browsers: autoStartBrowsers,
configFile: 'test/http.conf.js'
},
'persist': {
// for setting up a persistent karma server.
// To start the server, the task is:
// karma:persist
// To run these, the task is:
// karma:persist:run
configFile: 'test/unit.conf.js',
browsers: [],
singleRun: false,
background: true
},
'single-heap': {
configFile: 'test/heap.conf.js'
}
},
exec: {
// these might not go too well on Windows :-) - get Cygwin.
reportMinifiedSize: {
command: 'echo minified size is `wc -c < dist/oboe-browser.min.js` bytes'
},
reportMinifiedAndGzippedSize: {
command: 'echo Size after gzip is `gzip --best --stdout dist/oboe-browser.min.js | wc -c` bytes - max 5120'
},
createGitVersionJs: {
command: 'echo "`git describe`" > build/version.txt'
},
webpackBrowser: {
command: 'npm run webpack'
},
webpackNode: {
command: 'npm run webpack -- --config webpack.config.node.js'
},
standard: {
command: 'npm run standard -- --fix --envs jasmine'
}
},
watch: {
karma: {
files: FILES_TRIGGERING_KARMA,
tasks: ['karma:persist:run']
},
// like above but reports the file size. This is good for
// watching while developing to make sure it doesn't get
// too big. Doesn't run tests against minified.
karmaAndSize: {
files: FILES_TRIGGERING_KARMA,
tasks: [
'karma:persist:run',
'browser-build',
'dist-sizes']
},
// like above but reports the file size. This is good for
// watching while developing to make sure it doesn't get
// too big. Doesn't run tests against minified.
testNode: {
files: FILES_TRIGGERING_KARMA,
tasks: [
'node-build']
},
restartStreamSourceAndRunTests: {
// this fails at the moment because start-stream-source
// fails if run more than once - the port is taken.
files: ['test/streamsource.js'],
tasks: ['start-stream-source', 'karma:persist:run']
},
standard: {
files: FILES_TRIGGERING_KARMA,
tasks: ['exec:standard']
}
},
concurrent: {
watchDev: {
tasks: [ 'watch:karmaAndSize', 'watch:restartStreamSourceAndRunTests' ],
options: {
logConcurrentOutput: true
}
}
}
})
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks)
var streamSource
grunt.registerTask('start-stream-source', function () {
grunt.log.ok('do we have a streaming source already?', !!streamSource)
// if we previously loaded the streamsource, stop it to let the new one in:
if (streamSource) {
grunt.log.ok('there seems to be a streaming server already, let\'s stop it')
streamSource.stop()
}
streamSource = require('./test/streamsource.js')
streamSource.start(STREAM_SOURCE_PORT_HTTP, grunt)
})
grunt.registerTask('jasmine_node_oboe', 'Runs jasmine-node.', function () {
runNpmScript('test-node', this.async())
})
// change the auto-starting browsers so that future tests will use
// phantomjs instead of actual browsers. Can do:
// grunt headless-mode default
// to run without any actual browsers
grunt.registerTask('headless-mode', function () {
autoStartBrowsers.length = 0
autoStartBrowsers.push('PhantomJS')
})
grunt.registerTask('test-start-server', [
'karma:persist'
])
grunt.registerTask('test-run', [
'karma:persist:run'
])
grunt.registerTask('dist-sizes', [
'exec:reportMinifiedAndGzippedSize'
])
grunt.registerTask('node-build', [
'exec:createGitVersionJs',
'exec:webpackNode'
])
grunt.registerTask('node-build-test', [
'node-build',
'jasmine_node_oboe'
])
grunt.registerTask('node', [
'start-stream-source',
'node-build-test'
])
grunt.registerTask('browser-build', [
'exec:createGitVersionJs',
'exec:webpackBrowser'
])
grunt.registerTask('browser-build-test', [
'karma:single-dev',
'karma:single-browser-http',
'browser-build',
'karma:single-concat',
'karma:single-minified',
'karma:single-amd'
])
grunt.registerTask('build', [
'exec:webpackBrowser'
])
// build and run just the integration tests.
grunt.registerTask('build-integration-test', [
'build',
'start-stream-source',
'karma:single-concat',
'jasmine_node_oboe',
'dist-sizes'
])
grunt.registerTask('default', [
'clear',
'clean',
'start-stream-source',
'browser-build-test',
'node-build-test',
'dist-sizes'
])
// browser-test-auto-run or node-test-auto-run
//
// The most useful for developing. Start this task, capture some browsers
// (unless node) then edit the code. Tests will be run as the code is
// saved.
grunt.registerTask('browser-test-auto-run', [
'start-stream-source',
'karma:persist',
'concurrent:watchDev'
])
grunt.registerTask('node-test-auto-run', [
'start-stream-source',
'watch:testNode'
])
grunt.registerTask('coverage', [
'karma:coverage'
])
}
+18
View File
@@ -0,0 +1,18 @@
{
"name": "oboe",
"version": "2.1.2",
"main": "dist/oboe-browser.js",
"ignore": [
"**/.*",
"node_modules",
"components",
"writing",
"src",
"examples",
"build",
"benchmarking",
"package.json",
"Gruntfile.js",
"test"
]
}
+2908
View File
File diff suppressed because it is too large. Load diff
+5
View File
@@ -0,0 +1,5 @@
/*!
* v2.1.4-104-gc868b3a
*
*/
!function(n,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("oboe",[],t):"object"==typeof exports?exports.oboe=t():n.oboe=t()}("undefined"!=typeof self?self:this,function(){return function(n){var t={};function e(r){if(t[r])return t[r].exports;var u=t[r]={i:r,l:!1,exports:{}};return n[r].call(u.exports,u,u.exports,e),u.l=!0,u.exports}return e.m=n,e.c=t,e.d=function(n,t,r){e.o(n,t)||Object.defineProperty(n,t,{configurable:!1,enumerable:!0,get:r})},e.n=function(n){var t=n&&n.__esModule?function(){return n.default}:function(){return n};return e.d(t,"a",t),t},e.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},e.p="",e(e.s=7)}([function(n,t,e){"use strict";e.d(t,"j",function(){return u}),e.d(t,"d",function(){return i}),e.d(t,"c",function(){return c}),e.d(t,"h",function(){return o}),e.d(t,"b",function(){return f}),e.d(t,"k",function(){return a}),e.d(t,"e",function(){return s}),e.d(t,"g",function(){return d}),e.d(t,"i",function(){return b}),e.d(t,"a",function(){return l}),e.d(t,"f",function(){return j});var r=e(1),u=a(function(n,t){var e=t.length;return a(function(r){for(var u=0;u<r.length;u++)t[e+u]=r[u];return t.length=e+r.length,n.apply(this,t)})});a(function(n){var t=Object(r.c)(n);function e(n,t){return[f(n,t)]}return a(function(n){return Object(r.f)(e,n,t)[0]})});function i(n,t){return function(){return n.call(this,t.apply(this,arguments))}}function c(n){return function(t){return t[n]}}var o=a(function(n){return a(function(t){for(var e,r=0;r<c("length")(n);r++)if(e=f(t,n[r]))return e})});function f(n,t){return t.apply(void 0,n)}function a(n){var t=n.length-1,e=Array.prototype.slice;if(0===t)return function(){return n.call(this,e.call(arguments))};if(1===t)return function(){return n.call(this,arguments[0],e.call(arguments,1))};var r=Array(n.length);return function(){for(var u=0;u<t;u++)r[u]=arguments[u];return r[t]=e.call(arguments,t),n.apply(this,r)}}function s(n){return function(t,e){return n(e,t)}}function d(n,t){return function(e){return n(e)&&t(e)}}function b(){}function l(){return!0}function j(n){return function(){return n}}},function(n,t,e){"use strict";e.d(t,"d",function(){return u}),e.d(t,"g",function(){return c}),e.d(t,"l",function(){return o}),e.d(t,"c",function(){return f}),e.d(t,"h",function(){return a}),e.d(t,"i",function(){return s}),e.d(t,"j",function(){return d}),e.d(t,"f",function(){return b}),e.d(t,"m",function(){return l}),e.d(t,"a",function(){return j}),e.d(t,"b",function(){return v}),e.d(t,"k",function(){return O}),e.d(t,"e",function(){return h});var r=e(0);function u(n,t){return[n,t]}var i=null,c=Object(r.c)(0),o=Object(r.c)(1);function f(n){return O(n.reduce(Object(r.e)(u),i))}var a=Object(r.k)(f);function s(n){return b(function(n,t){return n.unshift(t),n},[],n)}function d(n,t){return t?u(n(c(t)),d(n,o(t))):i}function b(n,t,e){return e?n(b(n,t,o(e)),c(e)):t}function l(n,t,e){return function n(e,r){return e?t(c(e))?(r(c(e)),o(e)):u(c(e),n(o(e),r)):i}(n,e||r.i)}function j(n,t){return!t||n(c(t))&&j(n,o(t))}function v(n,t){n&&(c(n).apply(null,t),v(o(n),t))}function O(n){return function n(t,e){return t?n(o(t),u(c(t),e)):e}(n,i)}function h(n,t){return t&&(n(c(t))?c(t):h(n,o(t)))}},function(n,t,e){"use strict";e.d(t,"c",function(){return i}),e.d(t,"e",function(){return c}),e.d(t,"d",function(){return o}),e.d(t,"a",function(){return f}),e.d(t,"b",function(){return a});var r=e(1),u=e(0);function i(n,t){return t&&t.constructor===n}var c=Object(u.c)("length"),o=Object(u.j)(i,String);function f(n){return void 0!==n}function a(n,t){return t instanceof Object&&Object(r.a)(function(n){return n in t},n)}},function(n,t,e){"use strict";e.d(t,"f",function(){return u}),e.d(t,"d",function(){return i}),e.d(t,"g",function(){return c}),e.d(t,"e",function(){return o}),e.d(t,"b",function(){return f}),e.d(t,"h",function(){return a}),e.d(t,"i",function(){return s}),e.d(t,"c",function(){return d}),e.d(t,"m",function(){return b}),e.d(t,"n",function(){return l}),e.d(t,"a",function(){return j}),e.d(t,"j",function(){return v}),e.d(t,"l",function(){return O}),e.d(t,"k",function(){return h}),e.d(t,"o",function(){return p});var r=1,u=r++,i=r++,c=r++,o=r++,f="fail",a=r++,s=r++,d="start",b="data",l="end",j=r++,v=r++,O=r++,h=r++;function p(n,t,e){try{var r=JSON.parse(t)}catch(n){}return{statusCode:n,body:t,jsonBody:r,thrown:e}}},function(n,t,e){"use strict";e.d(t,"b",function(){return u}),e.d(t,"a",function(){return i}),e.d(t,"c",function(){return c});var r=e(0);function u(n,t){return{key:n,node:t}}var i=Object(r.c)("key"),c=Object(r.c)("node")},function(n,t,e){"use strict";e.d(t,"a",function(){return f});var r=e(1),u=e(0),i=e(2),c=e(8),o=e(9);function f(n){var t=Object(r.h)("resume","pause","pipe"),e=Object(u.j)(i.b,t);return n?e(n)||Object(i.d)(n)?Object(c.a)(o.a,n):Object(c.a)(o.a,n.url,n.method,n.body,n.headers,n.withCredentials,n.cached):Object(o.a)()}f.drop=function(){return f.drop}},function(n,t,e){"use strict";e.d(t,"b",function(){Line truncated
+2825
View File
File diff suppressed because it is too large. Load diff
+3
View File
@@ -0,0 +1,3 @@
var oboe = require('./dist/oboe-node')
module.exports = oboe
+9
View File
@@ -0,0 +1,9 @@
{
"spec_dir": "test",
"spec_files": [
"specs/oboe.integration.spec.js",
"specs/oboe.performance.spec.js"
],
"stopSpecOnExpectationFailure": false,
"random": false
}
+115
View File
@@ -0,0 +1,115 @@
{
"name": "oboe",
"title": "Oboe.js",
"version": "2.1.5",
"description": "Oboe.js reads json, giving you the objects as they are found without waiting for the stream to finish",
"main": "./dist/oboe-node.js",
"browser": {
"./dist/oboe-node.js": "./dist/oboe-browser.js",
"./src/streamingHttp.node.js": "./src/streamingHttp.browser.js"
},
"scripts": {
"test": "node ./node_modules/grunt-cli/bin/grunt headless-mode default",
"test-start-server": "node ./node_modules/grunt-cli/bin/grunt test-start-server",
"test-run": "node ./node_modules/grunt-cli/bin/grunt test-run",
"test-node": "jasmine JASMINE_CONFIG_PATH=jasmine.json",
"browser-test-auto-run": "node ./node_modules/grunt-cli/bin/grunt test-auto-run",
"node-test-auto-run": "node ./node_modules/grunt-cli/bin/grunt node-test-auto-run",
"dist-sizes": "node ./node_modules/grunt-cli/bin/grunt dist-sizes",
"webpack": "webpack",
"standard": "standard",
"test-heap": "node ./node_modules/grunt-cli/bin/grunt start-stream-source browser-build karma:single-heap"
},
"repository": {
"type": "git",
"url": "https://github.com/jimhigson/oboe.js.git"
},
"keywords": [
"json",
"parser",
"stream",
"progressive",
"http",
"sax",
"event",
"emitter",
"async",
"browser"
],
"homepage": "http://oboejs.com",
"author": "Jim Higson",
"license": "BSD",
"readmeFilename": "README.md",
"devDependencies": {
"color": "~0.4.4",
"cors": "~2.1.1",
"doctoc": "~0.4.3",
"express": "~3.4.3",
"get-json": "0.0.1",
"grunt": "~0.4.1",
"grunt-clear": "~0.2.1",
"grunt-cli": "~0.1.9",
"grunt-concurrent": "~0.3.1",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-concat": "~0.1.3",
"grunt-contrib-copy": "~0.4.1",
"grunt-contrib-uglify": "~0.2.0",
"grunt-contrib-watch": "~0.5.1",
"grunt-exec": "~0.4.2",
"grunt-karma": "2.0.0",
"grunt-micro": "~0.1.0",
"grunt-wrap": "~0.2.0",
"jasmine": "2.5.2",
"jasmine-core": "2.5.2",
"jasmine-node": "~1.11.0",
"karma": "1.3.0",
"karma-chrome-launcher": "^2.2.0",
"karma-coverage": "1.1.1",
"karma-firefox-launcher": "1.0.0",
"karma-jasmine": "1.0.2",
"karma-phantomjs-launcher": "1.0.2",
"karma-safari-launcher": "1.0.0",
"karma-webpack": "^2.0.9",
"matchdep": "~0.1.2",
"request": "2.81.0",
"sinon": "^2.4.1",
"standard": "^11.0.1",
"uglifyjs-webpack-plugin": "^1.2.1",
"webpack": "^3.10.0"
},
"dependencies": {
"http-https": "^1.0.0"
},
"jam": {
"main": "dist/oboe-browser.js",
"include": [
"dist/oboe-browser.js",
"LICENCE",
"package.json",
"README.md"
],
"dependencies": {},
"categories": [
"AJAX & Websockets",
"Parsers & Compilers"
]
},
"standard": {
"ignore": [
"node_modules/**",
"dist",
"test/require",
"test/libs/es5-*.js"
],
"env": "jasmine",
"globals": [
"Platform",
"crossDomainUrl",
"XMLHttpRequest"
]
}
,"_resolved": "https://registry.npmjs.org/oboe/-/oboe-2.1.5.tgz"
,"_integrity": "sha1-VVQoTFQ6ImbXo48X4HOCH73jk80="
,"_from": "oboe@2.1.5"
}
+28
View File
@@ -0,0 +1,28 @@
const path = require('path')
const fs = require('fs')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const webpack = require('webpack')
const version = fs.readFileSync('./build/version.txt', 'utf8')
module.exports = {
entry: {
'oboe-browser': './src/entry.js',
'oboe-browser.min': './src/entry.js'
},
target: 'web',
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].js',
library: 'oboe',
libraryTarget: 'umd2',
libraryExport: 'default',
umdNamedDefine: true
},
plugins: [
new UglifyJsPlugin({
test: /min/
}),
new webpack.BannerPlugin(version)
]
}
+21
View File
@@ -0,0 +1,21 @@
const path = require('path')
const fs = require('fs')
const webpack = require('webpack')
const version = fs.readFileSync('./build/version.txt', 'utf8')
module.exports = {
entry: './src/entry.js',
target: 'node',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'oboe-node.js',
library: 'oboe',
libraryTarget: 'umd2',
libraryExport: 'default',
umdNamedDefine: true
},
plugins: [
new webpack.BannerPlugin(version)
]
}