Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix npm 3.x issues and fix package.json main file #1

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module.exports = function(grunt) {

"toBrowser" : {
"release" : {
options: { index : "index-browser.js" },
options: { index : "index.js" },
src: ["lib/**/*.js", '!**/*-node.*'],
dest: "_build/lib/<%= artifactname %>.js"
}
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ under the License.
## Olingo OData Client for JavaScript
The Olingo OData Client for JavaScript (odatajs) is a library written in JavaScript that enables browser based frontend applications to easily use the OData protocol for communication with application servers.

This library "odatajs-4.0.0.min.js" supports only the OData V4 protocol.
This library "odatajs-4.0.1.min.js" supports only the OData V4 protocol.

For using the OData protocols V1-V3 please refer to the [datajs library](http://datajs.codeplex.com/)

The odatajs library can be included in any html page with the script tag (for example)
```
<script type="text/javascript" src="./sources/odatajs-4.0.0.min.js"></script>
<script type="text/javascript" src="./sources/odatajs-4.0.1.min.js"></script>
```
and its features can be used through the `odatajs` namespace (or `window.odatajs`). The odatajs library can be used together with the datajs library which uses the `window.OData` namespace.

Expand Down
3 changes: 0 additions & 3 deletions grunt-config/custom-tasks/rat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
"grunt": "~0.4.0",
"xml2js": "^0.4.4"
},
"peerDependencies": {
"grunt": "~0.4.0"
},
"engines": {
"node": ">=0.8.0"
}
Expand Down
2 changes: 1 addition & 1 deletion grunt-config/custom-tasks/sign.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module.exports = function(grunt) {

var path = require('path');
var fs = require( 'fs' );
var chalk = require('./rat/node_modules/chalk');
var chalk = require('chalk');

var globalDone = this.async();

Expand Down
14 changes: 7 additions & 7 deletions grunt-config/custom-tasks/toBrowser/toBrowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ module.exports = function(grunt) {

//console.log('exists :'+srcPath+srcName+'-browser.js' );
tarName = srcName;
if (srcName.indexOf('-browser') > 0) {
tarName = tarName.substring(0,srcName.indexOf('-browser'));
//console.log('new srcName :'+srcName );
} else if (grunt.file.exists(srcPath+srcName+'-browser.js')) {
//console.log('exists :yes');
continue; //skip that file
}
// if (srcName.indexOf('-browser') > 0) {
// tarName = tarName.substring(0,srcName.indexOf('-browser'));
// //console.log('new srcName :'+srcName );
// } else if (grunt.file.exists(srcPath+srcName+'-browser.js')) {
// //console.log('exists :yes');
// continue; //skip that file
// }


workLoad.push({
Expand Down
4 changes: 2 additions & 2 deletions grunt-config/custom-tasks/toBrowser/wrapper-tpl.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
(function(){
var init = function(exports, module, require) {
'<% initFunction %>'
};
Expand All @@ -29,7 +30,6 @@ var require = function(path) {
if (modules[name]) { return modules[name].exports; }

modules[name] = { exports : {}};
console.log(name);
if (name === 'sou') {
var i = 0;
}
Expand All @@ -39,5 +39,5 @@ var require = function(path) {

window.odatajs = {};
init.call(this,window.odatajs,window.odatajs,require);

})();

2 changes: 1 addition & 1 deletion grunt-config/nugetpack.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>Olingo OData Client for JavaScript</title>
<id>odatajs</id>
<tags>restful api open protocol odata client javascript</tags>
<version>4.0.0</version>
<version>4.0.1</version>
<authors>Apache Olingo (Challen He, Kobler-Morris Sven)</authors>
<owners>Apache Olingo</owners>
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0</licenseUrl>
Expand Down
2 changes: 1 addition & 1 deletion grunt-config/release-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ module.exports = function(grunt) {
},
"release-nuget": {
files: [
{ expand: true, cwd: '_build', src: ['odatajs.4.0.0.nupkg'], dest: './_dist/<%= artifactname %>', filter: 'isFile' },
{ expand: true, cwd: '_build', src: ['odatajs.4.0.1.nupkg'], dest: './_dist/<%= artifactname %>', filter: 'isFile' },
]
},
"release-doc" : {
Expand Down
6 changes: 3 additions & 3 deletions grunt-config/sign-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module.exports = function(grunt) {
cwd : './_dist/<%= artifactname %>/',
src : [
'<%= artifactname %>-lib.zip',
'odatajs.4.0.0.nupkg',
'odatajs.4.0.1.nupkg',
'<%= artifactname %>-doc.zip',
'<%= artifactname %>-sources.zip'
]
Expand All @@ -39,7 +39,7 @@ module.exports = function(grunt) {
cwd : './_dist/<%= artifactname %>/',
src : [
'<%= artifactname %>-lib.zip',
'odatajs.4.0.0.nupkg',
'odatajs.4.0.1.nupkg',
'<%= artifactname %>-doc.zip',
'<%= artifactname %>-sources.zip'
]
Expand All @@ -50,7 +50,7 @@ module.exports = function(grunt) {
cwd : './_dist/<%= artifactname %>/',
src : [
'<%= artifactname %>-lib.zip',
'odatajs.4.0.0.nupkg',
'odatajs.4.0.1.nupkg',
'<%= artifactname %>-doc.zip',
'<%= artifactname %>-sources.zip'
]
Expand Down
36 changes: 0 additions & 36 deletions index-browser.js

This file was deleted.

11 changes: 5 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,24 @@ var odatajs = {};
odatajs.version = {
major: 4,
minor: 0,
build: 0
build: 1
};

// core stuff, alway needed
odatajs.deferred = require('./lib/deferred.js');
odatajs.utils = require('./lib/utils.js');

// only neede for xml metadata
odatajs.xml = require('./lib/xml.js');

// only need in browser case
odatajs.oData = require('./lib/odata.js');
odatajs.store = require('./lib/store.js');
odatajs.cache = require('./lib/cache.js');

if (typeof window !== 'undefined') {
if (odatajs.utils.inBrowser()) {
//expose to browsers window object
window.odatajs = odatajs;
} else {
}

if(typeof module !== 'undefined'){
//expose in commonjs style
odatajs.node = "node";
module.exports = odatajs;
Expand Down
Loading