Skip to content

Commit

Permalink
Merge pull request #7 from SierraSoftworks/typescript
Browse files Browse the repository at this point in the history
Iridium vNext
  • Loading branch information
spartan563 committed Apr 24, 2015
2 parents 9a250c3 + cab9a81 commit fdb0746
Show file tree
Hide file tree
Showing 193 changed files with 18,762 additions and 3,526 deletions.
14 changes: 10 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
Properties
bin
obj
Properties/
bin/
obj/
*.suo
*.user
*.sublime*
node_modules
node_modules/
.vs
*.dat
.idea
dist/
*.tmp
coverage/
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
}
13 changes: 10 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
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

after_script:
- 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.
139 changes: 108 additions & 31 deletions Iridium.njsproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,64 +3,141 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{a2511e8c-33be-4b8d-8203-70d403aa446a}</ProjectGuid>
<ProjectGuid>{e9a19872-d84f-418a-8332-3ded543fb1fa}</ProjectGuid>
<ProjectHome />
<ProjectView>ShowAllFiles</ProjectView>
<StartupFile>index.js</StartupFile>
<StartupFile>node_modules\mocha\bin\mocha</StartupFile>
<WorkingDirectory>.</WorkingDirectory>
<OutputPath>.</OutputPath>
<ProjectTypeGuids>{3AF33F2E-1136-4D97-BBB7-1795711AC8B8};{349c5851-65df-11da-9384-00065b846f21};{9092AA53-FB77-4645-B42D-1CCCA6BD08BD}</ProjectTypeGuids>
<TypeScriptSourceMap>true</TypeScriptSourceMap>
<TypeScriptModuleKind>CommonJS</TypeScriptModuleKind>
<EnableTypeScript>true</EnableTypeScript>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">11.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<NodeExePath>C:\Program Files\iojs\iojs.exe</NodeExePath>
<StartWebBrowser>False</StartWebBrowser>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'" />
<PropertyGroup Condition="'$(Configuration)' == 'Release'" />
<ItemGroup>
<Content Include=".gitattributes" />
<Content Include=".gitignore" />
<Content Include=".travis.yml" />
<Content Include="CHANGELOG" />
<Content Include="doc\Migrating from 4.x to 5.x.md" />
<Content Include="LICENCE" />
<Content Include="package.json" />
<Content Include="tsd.json" />
<Content Include="README.md" />
<Compile Include="index.js" />
<Content Include=".git\ms-persist.xml" />
<Compile Include="benchmarks\mongodb.js" />
<Compile Include="example\LowercaseCollectionsPlugin.js" />
<Compile Include="example\StringCaseValidationPlugin.js" />
<Compile Include="example\UserModel.js" />
<Compile Include="lib\Database.js" />
<Compile Include="lib\Instance.js" />
<Compile Include="lib\Model.js" />
<Compile Include="lib\utils\Inherit.js" />
<Compile Include="test\bugs.js" />
<Compile Include="test\cache.js" />
<Compile Include="test\config.js" />
<Compile Include="test\diff.js" />
<Compile Include="test\find.js" />
<Compile Include="test\findOne.js" />
<Compile Include="test\hooks.js" />
<Compile Include="test\insertion.js" />
<Compile Include="test\instance_db.js" />
<Compile Include="test\instance_helpers.js" />
<Compile Include="test\instance_setup.js" />
<Compile Include="example\IntelliSense.js" />
<Compile Include="test\model.js" />
<Compile Include="test\plugins.js" />
<Compile Include="lib\caches\NoOpCache.js" />
<Compile Include="lib\utils\diff.js" />
<Compile Include="lib\utils\String.js" />
<Compile Include="index.ts" />
<Compile Include="example\ModelHookPlugin.ts" />
<Compile Include="example\ValidationPlugin.ts" />
<Compile Include="example\UserModel.ts" />
<TypeScriptCompile Include="benchmarks\mongodb.ts" />
<TypeScriptCompile Include="example\IntelliSense.ts" />
<TypeScriptCompile Include="lib\Cache.ts" />
<TypeScriptCompile Include="lib\CacheDirector.ts" />
<TypeScriptCompile Include="lib\Configuration.ts" />
<TypeScriptCompile Include="lib\Core.ts" />
<TypeScriptCompile Include="lib\Cursor.ts" />
<TypeScriptCompile Include="lib\General.ts" />
<TypeScriptCompile Include="lib\Hooks.ts" />
<TypeScriptCompile Include="lib\Index.ts" />
<TypeScriptCompile Include="lib\Instance.ts" />
<TypeScriptCompile Include="lib\Middleware.ts" />
<TypeScriptCompile Include="lib\Model.ts" />
<TypeScriptCompile Include="lib\ModelCache.ts" />
<TypeScriptCompile Include="lib\ModelHandlers.ts" />
<TypeScriptCompile Include="lib\ModelHelpers.ts" />
<TypeScriptCompile Include="lib\ModelInterfaces.ts" />
<TypeScriptCompile Include="lib\ModelOptions.ts" />
<TypeScriptCompile Include="lib\ModelSpecificInstance.ts" />
<TypeScriptCompile Include="lib\Plugins.ts" />
<TypeScriptCompile Include="lib\Schema.ts" />
<Content Include="test\mocha.opts" />
<TypeScriptCompile Include="test\Cache.ts">
<SubType>Code</SubType>
<TestFramework>Mocha</TestFramework>
</TypeScriptCompile>
<TypeScriptCompile Include="test\Core.ts">
<SubType>Code</SubType>
<TestFramework>Mocha</TestFramework>
</TypeScriptCompile>
<TypeScriptCompile Include="test\Hooks.ts">
<SubType>Code</SubType>
<TestFramework>Mocha</TestFramework>
</TypeScriptCompile>
<TypeScriptCompile Include="test\Instance.ts">
<SubType>Code</SubType>
<TestFramework>Mocha</TestFramework>
</TypeScriptCompile>
<TypeScriptCompile Include="test\Iridium.ts">
<TestFramework>Mocha</TestFramework>
</TypeScriptCompile>
<TypeScriptCompile Include="test\Model.ts">
<TestFramework>Mocha</TestFramework>
</TypeScriptCompile>
<TypeScriptCompile Include="test\Omnom.ts">
<SubType>Code</SubType>
<TestFramework>Mocha</TestFramework>
</TypeScriptCompile>
<TypeScriptCompile Include="test\Plugins.ts">
<TestFramework>Mocha</TestFramework>
</TypeScriptCompile>
<TypeScriptCompile Include="test\support\chai.ts" />
<TypeScriptCompile Include="test\Validation.ts">
<TestFramework>Mocha</TestFramework>
</TypeScriptCompile>
<TypeScriptCompile Include="_references.d.ts" />
<TypeScriptCompile Include="typings\chai-as-promised\chai-as-promised.d.ts" />
<TypeScriptCompile Include="typings\chai-fuzzy\chai-fuzzy.d.ts" />
<TypeScriptCompile Include="typings\chai\chai.d.ts" />
<TypeScriptCompile Include="typings\mocha\mocha.d.ts" />
<TypeScriptCompile Include="typings\tsd.d.ts" />
<TypeScriptCompile Include="lib\cacheControllers\IDDirector.ts" />
<TypeScriptCompile Include="lib\caches\MemoryCache.ts" />
<TypeScriptCompile Include="lib\caches\NoOpCache.ts" />
<TypeScriptCompile Include="lib\middleware\Express.ts" />
<TypeScriptCompile Include="lib\utils\Omnom.ts" />
<Content Include="test\support\config.json" />
<Compile Include="test\support\config.ts" />
<TypeScriptCompile Include="typings\bluebird\bluebird.d.ts" />
<TypeScriptCompile Include="typings\concoction\concoction.d.ts" />
<TypeScriptCompile Include="typings\lodash\lodash.d.ts" />
<TypeScriptCompile Include="typings\mongodb\mongodb.d.ts" />
<TypeScriptCompile Include="typings\node\node.d.ts" />
<TypeScriptCompile Include="typings\skmatc\skmatc.d.ts" />
</ItemGroup>
<ItemGroup>
<Folder Include=".git" />
<Folder Include="benchmarks" />
<Folder Include="doc\" />
<Folder Include="doc" />
<Folder Include="example" />
<Folder Include="lib" />
<Folder Include="lib\cacheControllers" />
<Folder Include="lib\caches" />
<Folder Include="lib\middleware" />
<Folder Include="lib\utils" />
<Folder Include="test" />
<Folder Include="test\support" />
<Folder Include="typings" />
<Folder Include="typings\bluebird" />
<Folder Include="typings\chai-as-promised\" />
<Folder Include="typings\chai-fuzzy\" />
<Folder Include="typings\chai\" />
<Folder Include="typings\concoction" />
<Folder Include="typings\lodash" />
<Folder Include="typings\mocha\" />
<Folder Include="typings\mongodb" />
<Folder Include="typings\node" />
<Folder Include="typings\skmatc" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<!--Do not delete the following Import Project. While this appears to do nothing it is a marker for setting TypeScript properties before our import that depends on them.-->
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<TypeScriptGeneratesDeclarations>False</TypeScriptGeneratesDeclarations>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets" Condition="False" />
<Import Project="$(VSToolsPath)\Node.js Tools\Microsoft.NodejsTools.targets" />
<ProjectExtensions>
<VisualStudio>
Expand Down
14 changes: 7 additions & 7 deletions Iridium.sln
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.21005.1
# Visual Studio 14
VisualStudioVersion = 14.0.22609.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9092AA53-FB77-4645-B42D-1CCCA6BD08BD}") = "Iridium", "Iridium.njsproj", "{A2511E8C-33BE-4B8D-8203-70D403AA446A}"
Project("{9092AA53-FB77-4645-B42D-1CCCA6BD08BD}") = "Iridium", "Iridium.njsproj", "{E9A19872-D84F-418A-8332-3DED543FB1FA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A2511E8C-33BE-4B8D-8203-70D403AA446A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A2511E8C-33BE-4B8D-8203-70D403AA446A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A2511E8C-33BE-4B8D-8203-70D403AA446A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A2511E8C-33BE-4B8D-8203-70D403AA446A}.Release|Any CPU.Build.0 = Release|Any CPU
{E9A19872-D84F-418A-8332-3DED543FB1FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E9A19872-D84F-418A-8332-3DED543FB1FA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E9A19872-D84F-418A-8332-3DED543FB1FA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E9A19872-D84F-418A-8332-3DED543FB1FA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Iridium [![Build Status](https://travis-ci.org/SierraSoftworks/Iridium.png?branch=master)](https://travis-ci.org/SierraSoftworks/Iridium) [![](https://badge.fury.io/js/iridium.png)](https://npmjs.org/package/iridium)
**A bare metal ORM for MongoDB**
# Iridium [![Build Status](https://travis-ci.org/SierraSoftworks/Iridium.png?branch=master)](https://travis-ci.org/SierraSoftworks/Iridium) [![Coverage Status](https://coveralls.io/repos/SierraSoftworks/Iridium/badge.svg?branch=typescript)](https://coveralls.io/r/SierraSoftworks/Iridium?branch=typescript) [![](https://badge.fury.io/js/iridium.png)](https://npmjs.org/package/iridium) [![Code Climate](https://codeclimate.com/github/SierraSoftworks/Iridium/badges/gpa.svg)](https://codeclimate.com/github/SierraSoftworks/Iridium) [![Test Coverage](https://codeclimate.com/github/SierraSoftworks/Iridium/badges/coverage.svg)](https://codeclimate.com/github/SierraSoftworks/Iridium)
**A bare metal ODM for MongoDB**

Iridium isn't your traditional JavaScript ORM, it's the ORM I've always wanted and I hope you'll enjoy using it as much
as I do. With Iridium, your models are simply JavaScript classes (if you're using ES6 or TypeScript) which means that
you don't need to learn a new DSL just to define your database structure and that your favourite editor will be able
to understand your code and provide useful suggestions.

## NOT YET FINISHED
The TypeScript implementation of Iridium is not yet finished - if you'd like to help out then please get in touch but **DO NOT START BUILDING APPS USING IT YET**. Seriously, it doesn't even have an official version number yet - everything is subject to change.

<script id='fb5ea3m'>(function(i){var f,s=document.getElementById(i);f=document.createElement('iframe');f.src='//api.flattr.com/button/view/?uid=SierraSoftworks&button=compact&url='+encodeURIComponent(document.URL);f.title='Flattr';f.height=20;f.width=110;f.style.borderWidth=0;s.parentNode.insertBefore(f,s);})('fb5ea3m');</script>

Expand Down
3 changes: 3 additions & 0 deletions _references.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/// <reference path="./typings/tsd.d.ts" />
/// <reference path="./typings/skmatc/skmatc.d.ts" />
/// <reference path="./typings/concoction/concoction.d.ts" />
Loading

0 comments on commit fdb0746

Please sign in to comment.