Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into release
Browse files Browse the repository at this point in the history
Conflicts:
	package.json
  • Loading branch information
notheotherben committed Jun 15, 2015
2 parents 1ac4f75 + d478ff7 commit f03e6cd
Show file tree
Hide file tree
Showing 170 changed files with 18,302 additions and 4,015 deletions.
16 changes: 12 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
Properties
bin
obj
Properties/
bin/
obj/
*.suo
*.user
*.sublime*
node_modules
node_modules/
.vs
*.dat
.idea
*.tmp
coverage/
typings/DefinitelyTyped/**/*.d.ts
.tscache
dist/test/
22 changes: 22 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"bitwise": false,
"curly": false,
"eqeqeq": false,
"forin": false,
"freeze": true,
"immed": false,
"newcap": true,
"noarg": true,
"noempty": true,
"plusplus": false,
"undef": true,
"unused": true,
"maxcomplexity": 40,
"asi": false,
"boss": true,
"debug": false,
"eqnull": false,
"evil": false,

"node": true
}
20 changes: 20 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.travis.yml
test/
dist/test/
example/
doc/
benchmarks/
.settings/
.git/
.idea/
.vs/
.tscache/
obj/
bin/
CHANGELOG
Gruntfile.js
*.njsproj
.jshintrc
.gitattributes
.gitignore
typings/DefinitelyTyped
31 changes: 31 additions & 0 deletions .settings/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"version": "0.1.0",
"configurations": [
{
"name": "Run Tests",
"type": "node",
"program": "node_modules/mocha/bin/mocha",
"stopOnEntry": false,
"args": ["--debug"],
"cwd": ".",
"runtimeExecutable": null,
"env": { }
},
{
"name": "Run Benchmark",
"type": "node",
"program": "benchmarks/mongodb.js",
"stopOnEntry": true,
"args": ["--debug"],
"cwd": ".",
"runtimeExecutable": null,
"env": { }
},
{
"name": "Attach",
"type": "node",
"address": "localhost",
"port": 5858
}
]
}
82 changes: 82 additions & 0 deletions .settings/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
// Available variables which can be used inside of strings.
// ${workspaceRoot}: the root folder of the team
// ${file}: the current opened file
// ${fileBasename}: the current opened file's basename
// ${fileDirname}: the current opened file's dirname
// ${fileExtname}: the current opened file's extension
// ${cwd}: the current working directory of the spawned process
{
"version": "0.1.0",
"command": "npm",
"showOutput": "silent",

"windows": {
"command": "npm.cmd"
},

"tasks": [
{
"taskName": "build",
"args": ["run"],
"isBuildCommand": true,
"problemMatcher": ["$tsc", {
"fileLocation": "relative",
"owner": "typescript",
"pattern": {
"regexp": "^([^(]+)\\((\\d+,\\d+)\\)\\: (error|warning) TS(\\d+): (.*)$",
"file": 1,
"location": 2,
"code": 3,
"severity": 4,
"message": 5
}
}, {
"fileLocation": "relative",
"owner": "typescript",
"pattern": {
"regexp": "^(error|warning) TS(\\d+): File '([^']+)'.*$",
"file": 3,
"location": 2,
"code": 2,
"severity": 1,
"message": 3
}
}]
},
{
"taskName": "test",
"args": [],
"isTestCommand": true,
"problemMatcher": {
"owner": "mocha",
"pattern": {
"regexp": "^\\s*(\\d+)\\)\\s*(.+)\\:$",
"file": 1,
"message": 2
}
}
},
{
"taskName": "lint",
"args": ["run", "lint", "--", "${file}", "--exclude"],
"problemMatcher": "$jshint"
},
{
"taskName": "install",
"args": []
},
{
"taskName": "update",
"args": []
},
{
"taskName": "benchmark",
"args": ["run"],
"showOutput": "always"
},
{
"taskName": "publish",
"args": []
}
]
}
29 changes: 26 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,33 @@
language: node_js
node_js:
- "0.8"
- "0.10"
- "0.11"

services:
- mongodb

env:
- CI_SERVER=1
- CI_SERVER=1

addons:
code_climate:
repo_token: 9c90177b42d39905ca635b1f6226580dab5799f87f172b66bab4e8df77b67a13

before_install:
- sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
- echo 'deb http://repo.mongodb.org/apt/ubuntu precise/mongodb-org/3.0 multiverse' | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
- echo 'deb http://repo.mongodb.org/apt/ubuntu precise/mongodb-org/3.1 multiverse' | sudo tee /etc/apt/sources.list.d/mongodb-org-3.1.list
- sudo apt-get update
- sudo apt-get install -y mongodb-org mongodb-org-server mongodb-org-shell mongodb-org-tools

before_script:
- "until nc -z localhost 27017; do echo Waiting for MongoDB; sleep 1; done"
- "mongo --version"
- gulp build

script:
- gulp ci

after_script:
- gulp coverage
- coveralls < coverage/lcov.info
- codeclimate < coverage/lcov.info
21 changes: 21 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# v4.0.0
- Removed automatic schema extensions
This was done for two reasons, firstly it simplifies the process of loading documents from the database a small amount.
The bigger reason is pure performance. Not only do we cut down on the number of properties which need to be defined
on new instances (if they aren't in the static schema) but by preventing modifications to the object structure we
prevent V8 from de-optimizing the code.
- Instance original object is no longer cloned
This should result in a small performance boost and shouldn't break any existing code (unless it was doing weird stuff
with the private API... you haven't been messing with the private API have you?)
- Removed support for the event emitter implementation
With the adoption of promises, its use has become less pronounced and its removal will further simplify the codebase
and help boost performance.
- All hook signatures have been changed
The first argument has become the value which was previously `this`. This should enable more explicit code and support
for TypeScript.
- Model options `preprocessors` renamed to `transforms`
Makes it a little bit more clear what these are to be used for
- Caching infrastructure updated
We've separated the cache implementations (get/set/clear) from the logic dictating how to cache something (can/key)
to make implementing the two parts easier. The cache implementation is now set on the core while the model provides
the cache controller dictating how caching is performed.
137 changes: 137 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
var tsconfig = require('./tsconfig.json');

module.exports = function (grunt) {
"use strict";

grunt.initConfig({
ts: {
options: tsconfig.compilerOptions,

dev: {
src: tsconfig.files,
options: {
watch: 'lib',
fast: 'never'
}
},
test: {
src: tsconfig.files,
options: {
sourceMap: true,
fast: 'never'
}
},
release: {
src: ["index.ts", "lib/**/*.ts"],
options: {
sourceMap: false,
fast: 'never'
}
}
},
mochacli: {
options: {
require: ["test/support/chai", "test/support/config"],
files: "test/*.js",
timeout: '10s'
},

default: {

}
},
mocha_istanbul: {
coverage: {
src: 'test',
root: 'lib',
options: {
mask: '*.js',
reportFormats: ['lcovonly', 'html'],
timeout: '10s',
require: ["test/support/chai", "test/support/config"],
check: {
lines: 75,
statements: 75
}
}
},

coveralls: {
src: 'test',
root: 'lib',
options: {
mask: '*.js',
coverage: true,
reportFormats: ['lcovonly'],
timeout: '10s',
require: ["test/support/chai", "test/support/config"]
}
}
},

clean: {
definitions: ["*.d.ts", "!iridium.d.ts", "!_references.d.ts", "benchmarks/**/*.d.ts", "example/**/*.d.ts", "lib/**/*.d.ts", "test/**/*.d.ts"],
sourceMaps: ["*.map", "benchmarks/**/*.map", "example/**/*.map", "lib/**/*.map", "test/**/*.map"],
compiledFiles: ["*.js", "!Gruntfile.js", "benchmarks/**/*.js", "example/**/*.js", "lib/**/*.js", "test/**/*.js"],
coverage: ["coverage"]
},

_release: {
options: {
tagName: "v<%= version %>",
commitMessage: "v<%= version %>"
}
},

'string-replace': {
packageDependencies: {
files: { "_references.d.ts": "_references.d.ts" },
options: {
replacements: [{
pattern: /(\/\/\/ <reference path="\.\/typings\/DefinitelyTyped\/tsd.d.ts" \/>)/gi,
replacement: '//$1'
}]
}
},
developmentDependencies: {
files: { "_references.d.ts": "_references.d.ts" },
options: {
replacements: [{
pattern: /\/\/(\/\/\/ <reference path="\.\/typings\/DefinitelyTyped\/tsd.d.ts" \/>)/gi,
replacement: '$1'
}]
}
}
}
});

grunt.event.on('coverage', function (lcovcontent, done) {
require('coveralls').handleInput(lcovcontent, function (err) {
if (err) return done(err);
done();
});
});

grunt.loadNpmTasks("grunt-ts");
grunt.loadNpmTasks("grunt-mocha-cli");
grunt.loadNpmTasks("grunt-mocha-istanbul");
grunt.loadNpmTasks("grunt-contrib-clean");
grunt.loadNpmTasks("grunt-release");
grunt.loadNpmTasks("grunt-string-replace");

grunt.renameTask('release', '_release');

grunt.registerTask("default", ["clean", "ts:dev"]);
grunt.registerTask("test", ["clean", "ts:test", "mochacli"]);
grunt.registerTask("coverage", ["clean", "ts:test", "mocha_istanbul:coverage"]);
grunt.registerTask("coveralls", ["clean", "ts:test", "mocha_istanbul:coveralls"]);
grunt.registerTask("build", ["clean", "ts:release"]);
grunt.registerTask("build:package", ["clean", "ts:release", "string-replace:packageDependencies"]);
grunt.registerTask("clean:package", ["string-replace:developmentDependencies"]);

grunt.registerTask("release", ["build:package", "_release", "clean:package"]);
grunt.registerTask("release:prerelease", ["build:package", "_release:prerelease", "clean:package"]);
grunt.registerTask("release:patch", ["build:package", "_release:patch", "clean:package"]);
grunt.registerTask("release:minor", ["build:package", "_release:minor", "clean:package"]);
grunt.registerTask("release:major", ["build:package", "_release:major", "clean:package"]);
};
Loading

0 comments on commit f03e6cd

Please sign in to comment.