diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..391b38d --- /dev/null +++ b/.npmignore @@ -0,0 +1,3 @@ +.travis.yml +appveyor.yml +test.bat diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..bc1baf9 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,11 @@ +os: linux +language: node_js +node_js: + - node + - '0.10' + - iojs +sudo: false +env: + global: + - secure: ER5LYPXeYbQz8IH7IFlEOdiUFhQZ/he6MBiKgAQlUEaY+aF48Ypd9FaXue0R6OPxqBoTVA6rFixdiAZk7U0wB9wTzyABWWUBEmFO7WMbDWfFp4cOTbtHGQREBotYv0vaC8L+qgRDqtM0ASGm8/i8duRM1ICQ7n3N01ezAlMTu8I= + - secure: hlJfOM3VG9xYFQ+TrGWgIc5H2zowRGJBtIm710Mg5JQ4F6tpz7wzIZ+MpynGOklD8ltuLhUUSmf+doejVzCiRRADqF2ubjTRWafyqfz8p5nESz0ovw4g+rQuOOt3S4FbmKiHCZtoYEqn1N47GIaN06ucakK+rvS2DANgpSwOLPI= diff --git a/README.md b/README.md index f9917c2..5ccb820 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,26 @@ -Javascript + C++ BSON parser -============================ +# bson-ext -This module contains the C++ BSON parser only and is not meant to be used in isolation from the `bson` NPM module. It lives in it's own module so it can be an optional dependency for the `bson` module. \ No newline at end of file +[![linux build status](https://secure.travis-ci.org/imlucas/bson-ext.png)](http://travis-ci.org/imlucas/bson-ext) +[![windows build status](https://ci.appveyor.com/api/projects/status/github/imlucas/bson-ext)](https://ci.appveyor.com/project/imlucas/bson-ext) + +This module contains the C++ BSON parser only and is not meant to be used in +isolation from the [bson](http://npm.im/bson) NPM module. It lives in +it's own module so it can be an optional dependency for the + [bson](http://npm.im/bson) module. + + +## Testing + +``` +npm test +``` + +## Prebuilt Binaries + +bson-ext uses [node-pre-gyp](http://npm.im/node-pre-gyp) to publish and install +prebuilt binaries. This means you don't need the full toolchain installed +and configured correctly to use this module. + +## License + +Apache 2 diff --git a/appveyor.yml b/appveyor.yml index 448a8cc..d59d08a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,30 +1,24 @@ -# Test against this version of Node.js +# node.js support: Latest stable version, `0.10.x` +# iojs support: Latest stable version environment: + node_pre_gyp_accessKeyId: + secure: Q/MT3KqteKjl23ePjDY9V93G8Ey91LJAOcvJPdEh0i4= + node_pre_gyp_secretAccessKey: + secure: pF+hGI1d/+HVKL0EWCGY6YxvRZrfQrLoxfG5AqQTLJ9hJZaiRRQTwU8cwL+4IEuW matrix: - # node.js - - nodejs_version: "0.10" - - nodejs_version: "0.12" - # io.js - - nodejs_version: "1.6" + - nodejs_version: 0.10 + - nodejs_version: 0.12 + - nodejs_version: "1" platform: - x86 - x64 -# Install scripts. (runs after repo cloning) install: - # Get the latest stable version of Node.js or io.js - ps: Install-Product node $env:nodejs_version - # install modules - - npm install + - ps: Update-NodeJsInstallation (Get-NodeJsLatestBuild $env:nodejs_version) -# Post-install test scripts. test_script: - # Output useful info for debugging. - - node --version - - npm --version - # run tests - - npm test + - .\test.bat -# Don't actually build. -build: off \ No newline at end of file +build: OFF diff --git a/binding.gyp b/binding.gyp index c4455e7..91ca717 100644 --- a/binding.gyp +++ b/binding.gyp @@ -1,6 +1,7 @@ { 'targets': [ { + 'win_delay_load_hook': 'true', 'target_name': 'bson', 'sources': [ 'ext/bson.cc' ], 'cflags!': [ '-fno-exceptions' ], @@ -11,6 +12,17 @@ 'xcode_settings': { 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES' } + }], + ['OS=="win"', { + 'configurations': { + 'Release': { + 'msvs_settings': { + 'VCCLCompilerTool': { + 'ExceptionHandling': 1 + } + } + } + } }] ] } diff --git a/package.json b/package.json index 9e03237..b1c36f9 100644 --- a/package.json +++ b/package.json @@ -1,27 +1,56 @@ -{ "name" : "bson-ext" -, "description" : "The C++ bson parser for the node.js mongodb driver." -, "keywords" : ["mongodb", "bson", "parser"] -, "version" : "0.1.0" -, "author" : "Christian Amor Kvalheim " -, "contributors" : [] - -, "repository" : { "type" : "git" - , "url" : "git://github.com/christkv/bson-ext.git" } -, "bugs" : { "mail" : "node-mongodb-native@googlegroups.com" - , "url" : "https://github.com/christkv/bson-ext/issues" } -, "dependencies": { - "nan": "1.7.0" +{ + "name": "bson-ext", + "description": "The C++ bson parser for the node.js mongodb driver.", + "keywords": [ + "mongodb", + "bson", + "parser" + ], + "version": "0.1.0", + "author": "Christian Amor Kvalheim ", + "contributors": [], + "repository": { + "type": "git", + "url": "git://github.com/christkv/bson-ext.git" + }, + "bugs": { + "mail": "node-mongodb-native@googlegroups.com", + "url": "https://github.com/christkv/bson-ext/issues" + }, + "dependencies": { + "nan": "~1.7.0", + "node-pre-gyp": "https://github.com/mongodb-js/node-pre-gyp/archive/v0.6.5-appveyor.tar.gz" + }, + "bundledDependecies": [ + "node-pre-gyp" + ], + "devDependencies": { + "aws-sdk": "~2.1.20", + "nodeunit": "~0.9.0" + }, + "main": "./index", + "directories": { + "lib": "./lib/bson" + }, + "engines": { + "node": ">=0.8.19" + }, + "scripts": { + "install": "node-pre-gyp install --fallback-to-build", + "test": "nodeunit ./test/node", + "posttest": "node-pre-gyp publish-maybe" + }, + "licenses": [ + { + "type": "Apache License, Version 2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0" + } + ], + "binary": { + "module_name": "bson", + "module_path": "build/Release", + "host": "https://bin.mongodb.org", + "remote_path": "/js/bson-ext/v{version}", + "bucket": "mongodb-dx-public" } -, "devDependencies": { - "nodeunit": "0.9.0" - } -, "main": "./index" -, "directories" : { "lib" : "./lib/bson" } -, "engines" : { "node" : ">=0.8.19" } -, "scripts": { - "install" : "(node-gyp rebuild 2> builderror.log) || (exit 0)", - "test" : "nodeunit ./test/node" -} -, "licenses" : [ { "type" : "Apache License, Version 2.0" - , "url" : "http://www.apache.org/licenses/LICENSE-2.0" } ] } diff --git a/test.bat b/test.bat new file mode 100644 index 0000000..596bb3c --- /dev/null +++ b/test.bat @@ -0,0 +1,10 @@ +call node --version +call npm --version +SET GYP_MSVS_VERSION=2013 +SET PATH=%PATH%;%APPDATA%\npm +SET PATH=%PATH%;C:\Program Files (x86)\Git\bin +SET PATH=%PATH%;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin +call npm install https://github.com/mongodb-js/node-pre-gyp/archive/v0.6.5-appveyor.tar.gz +call npm install https://github.com/mongodb-js/node-gyp/archive/v1.04-appveyor.tar.gz +call npm install --build-from-source +call npm test