Skip to content
This repository has been archived by the owner on Apr 11, 2023. It is now read-only.

Commit

Permalink
JayData compatibility scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
lazarv committed May 2, 2016
1 parent 3cd2c42 commit aaa89c2
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 4 deletions.
30 changes: 30 additions & 0 deletions dist/compatiblity.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
var Module = require('module');
var realResolve = Module._resolveFilename;
Module._resolveFilename = function fakeResolve(request, parent) {
if (request === 'jaydata/core') {
return require('path').join(__dirname, './lib/index.js');
}
return realResolve(request, parent);
};

(function(g){
var $data = require('./lib/index');
require('./lib/Types/StorageProviders/Facebook/index');
require('./lib/Types/StorageProviders/IndexedDB/index');
require('./lib/Types/StorageProviders/InMemory/index');
require('./lib/Types/StorageProviders/mongoDB/index');
require('./lib/Types/StorageProviders/oData/index');
require('./lib/Types/StorageProviders/SqLite/index');
require('./lib/Types/StorageProviders/WebApi/index');
require('./lib/Types/StorageProviders/YQL/index');

$data.setModelContainer(g);
g.Container = $data.Container;
g.Guard = $data.Guard;
g.$C = $data.$C;
g.Exception = $data.Exception;
g.MemberDefinition = $data.MemberDefinition;

g.$data = $data;
module.exports = $data;
})(global || window);
10 changes: 6 additions & 4 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,12 @@ gulp.task('minify', ['bundle'], function(){

gulp.task('clean', function(){
return del([
'./dist/.eslint',
'./dist/lib/**',
'./dist/public/**'
], { force: true });
'dist/.eslint',
'dist/lib/**',
'dist/public/**',
'!dist/public/jaydata-compatibility.js',
'!dist/public'
]);
});

gulp.task('nuget', ['bundle'], function(done){
Expand Down
8 changes: 8 additions & 0 deletions jaydata-compatibility.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
(function(g){
$data.setModelContainer(g);
g.Container = $data.Container;
g.Guard = $data.Guard;
g.$C = $data.$C;
g.Exception = $data.Exception;
g.MemberDefinition = $data.MemberDefinition;
})(window);

0 comments on commit aaa89c2

Please sign in to comment.