Skip to content

Commit 0330fcd

Browse files
committed
Merge branch 'release/3.2.0'
2 parents d3225c0 + e566457 commit 0330fcd

18 files changed

+92
-1437
lines changed

.DS_Store

6 KB
Binary file not shown.

09-06-2017.json

-1,336
This file was deleted.

docs-config.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99
"include": [
1010
"src/core/contentstack.js",
1111
"src/core/stack.js",
12-
"src/core/entry/entry.js",
13-
"src/core/entry/query.js",
14-
"src/core/entry/result.js"
12+
"src/core/modules/asset.js",
13+
"src/core/modules/entry.js",
14+
"src/core/modules/query.js",
15+
"src/core/modules/result.js"
1516
],
1617
"exclude": [
1718
"src/core/cache.js"

package.json

+29-30
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
{
22
"name": "contentstack",
3-
"version": "3.1.1",
4-
"description": "The Built.io Contentstack Javascript SDK",
5-
"homepage": "https://www.built.io/products/contentstack/overview",
3+
"version": "3.2.0",
4+
"description": "Contentstack Javascript SDK",
5+
"homepage": "https://www.contentstack.com/",
66
"author": {
7-
"name": "Built.io Contentstack",
8-
"url": "https://www.built.io/"
7+
"name": "Contentstack",
8+
"url": "https://www.contentstack.com/"
99
},
1010
"main": "dist/node/contentstack.js",
11+
"browser": "dist/web/contentstack.js",
1112
1213
"scripts": {
1314
"test": "node test.js",
1415
"buildnode": "webpack --config webpack/webpack.node.js",
1516
"buildweb": "webpack -p --config webpack/webpack.web.js",
1617
"buildreactnative": "webpack --config webpack/webpack.react-native.js",
18+
"buildall": "npm run buildnode&npm run buildweb&npm run buildreactnative",
1719
"generate-docs": "node_modules/.bin/jsdoc --configure docs-config.json --verbose"
1820
},
1921
"repository": {
@@ -50,33 +52,30 @@
5052
"tmp": "tmp/contentstack-3.0.0.tgz_1477830884275_0.9869455888401717"
5153
},
5254
"devDependencies": {
53-
"babel-core": "^6.24.0",
54-
"babel-loader": "^6.4.1",
55-
"babel-plugin-transform-runtime": "^6.23.0",
56-
"babel-preset-env": "^1.3.2",
57-
"babel-preset-es2015": "^6.16.0",
58-
"babel-preset-es2016": "^6.22.0",
59-
"babel-preset-stage-1": "^6.22.0",
60-
"compression-webpack-plugin": "^0.3.1",
61-
"es3ify-loader": "^0.2.0",
62-
"jshint": "~2.6.3",
55+
"babel-core": "6.24.0",
56+
"babel-loader": "6.4.1",
57+
"babel-plugin-transform-runtime": "6.23.0",
58+
"babel-preset-env": "1.3.2",
59+
"babel-preset-es2015": "6.16.0",
60+
"babel-preset-es2016": "6.22.0",
61+
"babel-preset-stage-1": "6.22.0",
62+
"compression-webpack-plugin": "0.3.1",
63+
"es3ify-loader": "0.2.0",
64+
"jshint": "2.6.3",
6365
"string-replace-webpack-plugin": "0.0.3",
64-
"tap-json": "^0.1.1",
65-
"tape": "^4.4.0",
66-
"jsdoc": "^3.4.0",
67-
"uglify-js": "^2.6.2",
68-
"webpack": "^2.2.1",
69-
"webpack-md5-hash": "^0.0.5",
70-
"webpack-merge": "^0.17.0"
66+
"tap-json": "0.1.1",
67+
"tape": "4.4.0",
68+
"jsdoc": "3.4.0",
69+
"uglify-js": "2.6.2",
70+
"webpack": "2.2.1",
71+
"webpack-md5-hash": "0.0.5",
72+
"webpack-merge": "0.17.0",
73+
"babel-runtime": "6.23.0",
74+
"string-replace-loader": "1.3.0"
7175
},
7276
"dependencies": {
73-
"babel-runtime": "^6.23.0",
74-
"fs": "0.0.1-security",
75-
"localStorage": "1.0.3",
76-
"nodemailer": "4.0.1",
77-
"path": "^0.12.7",
78-
"q": "1.4.1",
79-
"when": "3.7.8",
80-
"xmlhttprequest": "1.8.0"
77+
"es6-promise": "4.1.1",
78+
"isomorphic-fetch": "2.2.1",
79+
"localStorage": "1.0.3"
8180
}
8281
}

react-native.js

-1
This file was deleted.

src/runtime/node/http.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import * as http from 'xmlhttprequest';
1+
import ES6Promise from 'es6-promise';
2+
import fetch from 'isomorphic-fetch';
23

3-
var HTTPRequest = http.XMLHttpRequest;
4+
ES6Promise.polyfill();
45

5-
export default HTTPRequest;
6+
export default fetch;

src/runtime/node/when.js

-3
This file was deleted.

src/runtime/react-native/http.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export default XMLHttpRequest;
1+
export default fetch;
22

-18
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,3 @@
11
import localStorage from 'localStorage';
22

33
export default localStorage;
4-
5-
// import {AsyncStorage} from 'react-native';
6-
7-
// export default class localStorage{
8-
// constructor(){
9-
10-
// }
11-
12-
// getItem(key){
13-
// AsyncStorage.getItem(key).then((value) => {
14-
// return {key:value};
15-
// });
16-
// }
17-
18-
// setItem(key, data){
19-
// return AsyncStorage.setItem(key, data);
20-
// }
21-
// }

src/runtime/react-native/when.js

-5
This file was deleted.

src/runtime/web/http.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1-
export default XMLHttpRequest;
1+
import ES6Promise from 'es6-promise';
2+
import fetch from 'isomorphic-fetch';
23

4+
ES6Promise.polyfill();
5+
6+
export default fetch;

src/runtime/web/when.js

-3
This file was deleted.

test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
'use strict';
2-
var test = require('./test/automation-script.js');
2+
const test = require('./test/automation-script.js');
33
new test();

web.js

-1
This file was deleted.

webpack/webpack.common.js

+21-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
var webpack = require('webpack');
2-
var path = require('path');
1+
'use strict';
32

3+
const webpack = require('webpack');
4+
const path = require('path');
5+
6+
const Package = require('./../package.json');
7+
48
module.exports = function (options) {
59
return {
610

@@ -14,17 +18,27 @@ module.exports = function (options) {
1418

1519
module: {
1620
rules: [
17-
{
18-
test: /\.js?$/,
19-
exclude: ['../node_modules'],
20-
use: [{
21+
{
22+
test: /\.js?$/,
23+
exclude: ['../node_modules'],
24+
use: [
25+
{
2126
loader:'babel-loader',
2227
options: {
2328
presets: ['es2015'],
2429
}
25-
}],
30+
},
31+
{
32+
loader:'string-replace-loader',
33+
query: {
34+
search: '{{VERSION}}',
35+
replace: Package.version
36+
}
37+
}
38+
],
2639
}
2740
]
41+
2842
},
2943

3044
plugins: [

webpack/webpack.node.js

+14-12
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
1-
var path = require('path');
2-
var webpackMerge = require('webpack-merge');
3-
var commonConfig = require('./webpack.common.js');
1+
'use strict';
2+
const path = require('path');
3+
const webpackMerge = require('webpack-merge');
4+
5+
const commonConfig = require('./webpack.common.js');
46

57
module.exports = function (options) {
68
return webpackMerge(commonConfig(),{
79
output: {
8-
library: "Contentstack",
9-
libraryTarget:"commonjs2",
10-
path: path.join(__dirname, "../dist/node"),
11-
filename: "contentstack.js"
10+
library: "Contentstack",
11+
libraryTarget:"commonjs2",
12+
path: path.join(__dirname, "../dist/node"),
13+
filename: "contentstack.js"
1214
},
1315
target: "node",
1416
resolve: {
1517
alias:{
16-
runtime: path.resolve( __dirname, '../src/runtime/node')
17-
},
18+
runtime: path.resolve( __dirname, '../src/runtime/node')
19+
},
1820
modules: [
19-
'../src',
20-
'../src/runtimes/node',
21-
'node_modules',
21+
'../src',
22+
'../src/runtimes/node',
23+
'node_modules',
2224
]
2325
}
2426
});

webpack/webpack.react-native.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
var path = require('path');
2-
var webpackMerge = require('webpack-merge');
3-
var commonConfig = require('./webpack.common.js');
1+
'use strict';
2+
3+
const path = require('path');
4+
const webpackMerge = require('webpack-merge');
5+
6+
const commonConfig = require('./webpack.common.js');
47

58
module.exports = function (options) {
69
return webpackMerge(commonConfig(),{
@@ -10,7 +13,6 @@ module.exports = function (options) {
1013
path: path.join(__dirname, "../dist/react-native"),
1114
filename: "contentstack.js"
1215
},
13-
target: "node",
1416
resolve: {
1517
alias:{
1618
runtime: path.resolve( __dirname, '../src/runtime/react-native')

webpack/webpack.web.js

+7-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
var path = require('path');
2-
var webpackMerge = require('webpack-merge');
3-
var commonConfig = require('./webpack.common.js');
1+
'use strict';
2+
3+
const path = require('path');
4+
const webpackMerge = require('webpack-merge');
5+
6+
const commonConfig = require('./webpack.common.js');
47

58
module.exports = function (options) {
69
return webpackMerge(commonConfig(),{
@@ -19,11 +22,7 @@ module.exports = function (options) {
1922
'../src/runtimes/web',
2023
'node_modules'
2124
]
22-
},
23-
node: {
24-
fs: "empty",
25-
child_process: 'empty'
26-
},
25+
}
2726
});
2827
}
2928

0 commit comments

Comments
 (0)