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

Commit fafd221

Browse files
committed
Fix gulp build
1 parent 4341189 commit fafd221

File tree

12 files changed

+35
-500
lines changed

12 files changed

+35
-500
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ CommandLine.dll
77
JayData_readme.txt
88
JaySvcUtil.exe
99
Scripts/jaydata*
10-
build
1110
/obj/*
1211
/3rdparty/*
1312
/bin/*
File renamed without changes.

src/buildConfig.json renamed to build/config.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"require": ["./src/index.js", { "expose": "jaydata/core" }],
1212
"destFile": "jaydata.js",
1313
"destFolder": "./dist/public",
14-
"header": "./src/jaydata-header.js",
15-
"footer": "./src/jaydata-footer.js"
14+
"header": "./build/jaydata-header.js",
15+
"footer": "./build/jaydata-footer.js"
1616
},
1717
{
1818
"taskName": "odataprovider",
@@ -22,8 +22,8 @@
2222
"ignore": ["odatajs"],
2323
"destFile": "oDataProvider.js",
2424
"destFolder": "./dist/public/jaydataproviders",
25-
"header": "./src/jaydata-dep-header.js",
26-
"footer": "./src/jaydata-dep-footer.js"
25+
"header": "./build/jaydata-dep-header.js",
26+
"footer": "./build/jaydata-dep-footer.js"
2727
},
2828
{
2929
"taskName": "sqliteprovider",
@@ -32,8 +32,8 @@
3232
"external": ["jaydata/core"],
3333
"destFile": "SqLiteProvider.js",
3434
"destFolder": "./dist/public/jaydataproviders",
35-
"header": "./src/jaydata-dep-header.js",
36-
"footer": "./src/jaydata-dep-footer.js"
35+
"header": "./build/jaydata-dep-header.js",
36+
"footer": "./build/jaydata-dep-footer.js"
3737
},
3838
{
3939
"taskName": "inmemoryprovider",
@@ -42,8 +42,8 @@
4242
"external": ["jaydata/core"],
4343
"destFile": "InMemoryProvider.js",
4444
"destFolder": "./dist/public/jaydataproviders",
45-
"header": "./src/jaydata-dep-header.js",
46-
"footer": "./src/jaydata-dep-footer.js"
45+
"header": "./build/jaydata-dep-header.js",
46+
"footer": "./build/jaydata-dep-footer.js"
4747
},
4848
{
4949
"taskName": "yqlprovider",
@@ -52,8 +52,8 @@
5252
"external": ["jaydata/core"],
5353
"destFile": "YQLProvider.js",
5454
"destFolder": "./dist/public/jaydataproviders",
55-
"header": "./src/jaydata-dep-header.js",
56-
"footer": "./src/jaydata-dep-footer.js"
55+
"header": "./build/jaydata-dep-header.js",
56+
"footer": "./build/jaydata-dep-footer.js"
5757
},
5858
{
5959
"taskName": "indexeddbprovider",
@@ -62,8 +62,8 @@
6262
"external": ["jaydata/core"],
6363
"destFile": "IndexedDbProvider.js",
6464
"destFolder": "./dist/public/jaydataproviders",
65-
"header": "./src/jaydata-dep-header.js",
66-
"footer": "./src/jaydata-dep-footer.js"
65+
"header": "./build/jaydata-dep-header.js",
66+
"footer": "./build/jaydata-dep-footer.js"
6767
},
6868
{
6969
"taskName": "webapiprovider",
@@ -72,8 +72,8 @@
7272
"external": ["jaydata/core"],
7373
"destFile": "WebApiProvider.js",
7474
"destFolder": "./dist/public/jaydataproviders",
75-
"header": "./src/jaydata-dep-header.js",
76-
"footer": "./src/jaydata-dep-footer.js"
75+
"header": "./build/jaydata-dep-header.js",
76+
"footer": "./build/jaydata-dep-footer.js"
7777
},
7878
{
7979
"taskName": "facebookprovider",
@@ -82,16 +82,16 @@
8282
"external": ["jaydata/core"],
8383
"destFile": "FacebookProvider.js",
8484
"destFolder": "./dist/public/jaydataproviders",
85-
"header": "./src/jaydata-dep-header.js",
86-
"footer": "./src/jaydata-dep-footer.js"
85+
"header": "./build/jaydata-dep-header.js",
86+
"footer": "./build/jaydata-dep-footer.js"
8787
},
8888
{
8989
"taskName": "jaydataproviders",
9090
"dependencies": ["odataprovider", "sqliteprovider", "inmemoryprovider", "yqlprovider", "indexeddbprovider", "webapiprovider", "facebookprovider"]
9191
},
9292
{
9393
"taskName": "bundle",
94-
"dependencies": ["jaydata","jaydataproviders"]
94+
"dependencies": ["jaydata", "jaydataproviders"]
9595
},
9696
{
9797
"taskName": "all",
File renamed without changes.
File renamed without changes.

src/jaydata-footer.js renamed to build/jaydata-footer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
var $data = require('jaydata/core');
1+
/*var $data = require('jaydata/core');
22
$data.version = 'JayData <%=pkg.version %>';
3-
$data.versionNumber = '<%=pkg.version %>';
3+
$data.versionNumber = '<%=pkg.version %>';*/
44

55
if (typeof window !== "undefined"){
66
window.require = require;
File renamed without changes.

gulpfile.js

Lines changed: 13 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require('babel/register');
22
var browserify = require('browserify');
3-
var config = require('./src/buildConfig.json');
3+
var config = require('./build/config.json');
44
var pkg = require('./package.json');
55
var gulp = require('gulp');
66
var concat = require('gulp-concat');
@@ -23,44 +23,14 @@ var exec = require('child_process').exec;
2323
var eslint = require('gulp-eslint');
2424
var header = require('gulp-header');
2525
var footer = require('gulp-footer');
26-
var pkg = require('./package.json');
2726

2827
config.options = minimist(process.argv.slice(2), config.buildDefaultOptions);
2928
var paths = {
3029
js: ['src/**/*.js'],
3130
test: ['test/**/*.js']
3231
}
3332

34-
gulp.task('default', ['babel:compile'], function() {});
35-
36-
/*gulp.task('jaydata_tmp', function() {
37-
return browserify()
38-
.transform(babelify)
39-
.require('./src/index.js', { expose: 'jaydata/core' })
40-
.bundle()
41-
.on("error", function (err) { console.log("Error: " + err.message) })
42-
.pipe(source('jaydata.js'))
43-
.pipe(buffer())
44-
//.pipe(uglify())
45-
.pipe(gulp.dest('./dist/public'));
46-
});
47-
48-
gulp.task('odataprovider_tmp', function() {
49-
if (!fs.existsSync('dist')) fs.mkdirSync('dist');
50-
return browserify({
51-
standalone: '$data'
52-
})
53-
.transform(babelify)
54-
.require('./src/Types/StorageProviders/oData/index.js', { entry: true })
55-
.external('jaydata/core')
56-
.ignore('odatajs')
57-
.bundle()
58-
.on("error", function (err) { console.log("Error: " + err.message) })
59-
.pipe(source('oDataProvider.js'))
60-
.pipe(buffer())
61-
//.pipe(uglify())
62-
.pipe(gulp.dest('./dist/public/jaydataproviders'));
63-
});*/
33+
gulp.task('default', ['all']);
6434

6535
gulp.task('lint', function(){
6636
return gulp.src(['src/**/*.js'])
@@ -80,30 +50,30 @@ gulp.task('lint', function(){
8050
'no-use-before-define': 1
8151
}
8252
}))
83-
.pipe(eslint.format())
84-
.pipe(eslint.failAfterError());
53+
.pipe(eslint.format('compact', fs.createWriteStream('./dist/.eslint')))
54+
.pipe(eslint.failAfterError())
8555
});
8656

87-
//gulp.task('bundle', ['lint', 'jaydata', 'odataprovider', 'sqliteprovider'])
88-
8957
gulp.task('nodejs', function() {
9058
return gulp.src(['src/**/*.js'])
91-
.pipe(babel())
59+
.pipe(babel({
60+
compact: false
61+
}))
9262
.pipe(gulp.dest('./dist/lib'))
9363
.on('error', function(err){
9464
console.log('>>> ERROR', err);
9565
this.emit('end');
9666
});
9767
});
9868

99-
/*gulp.task('jaydata.min', function(){
100-
return gulp.src('./dist/jaydata.js')
69+
gulp.task('jaydata.min', function(){
70+
return gulp.src('./dist/public/jaydata.js')
10171
.pipe(closureCompiler({
10272
compilerPath: './node_modules/google-closure-compiler/compiler.jar',
103-
fileName: 'dist/jaydata.min.js'
73+
fileName: 'dist/public/jaydata.min.js'
10474
}))
105-
.pipe(gulp.dest('./dist'));
106-
});*/
75+
.pipe(gulp.dest('./dist/public'));
76+
});
10777

10878
gulp.task('test', ['bundle'], function(done){
10979
karma.start({
@@ -114,24 +84,6 @@ gulp.task('test', ['bundle'], function(done){
11484
});
11585
});
11686

117-
gulp.task('babel:compile', function() {
118-
return gulp.src(paths.js)
119-
.pipe(sourcemaps.init())
120-
.pipe(gulp_babel({
121-
modules: 'umd',
122-
comments: false
123-
}))
124-
.pipe(sourcemaps.write())
125-
.pipe(gulp.dest('build'));
126-
});
127-
128-
gulp.task('release', ['JayData', 'providers', 'modules'], function() {
129-
return gulp.src("build/**/*.js")
130-
.pipe(header(fs.readFileSync('src/CREDITS.txt'), pkg))
131-
.pipe(gulp.dest("build"));
132-
});
133-
134-
13587
gulp.task('apidocs', ['jaydata'], function (cb) {
13688
exec('node_modules\\.bin\\jsdoc dist\\public\\jaydata.js -t node_modules\\jaguarjs-jsdoc -d apidocs', function (err, stdout, stderr) {
13789
console.log(stdout);
@@ -184,6 +136,7 @@ function gulpTask(td, config){
184136
if (td.header){
185137
task = task.pipe(header(fs.readFileSync(td.header, 'utf8'), { pkg: pkg }));
186138
}
139+
task = task.pipe(header(fs.readFileSync('./build/CREDITS.txt'), pkg));
187140

188141
if (td.footer){
189142
task = task.pipe(footer(fs.readFileSync(td.footer, 'utf8'), { pkg: pkg }));

src/.gitignore

Lines changed: 0 additions & 31 deletions
This file was deleted.

src/TypeSystem/initializeJayData.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import $data from './initializeJayDataClient.js';
22
import * as acorn from 'acorn';
3+
import * as pkg from '../../package.json';
34

45
if (typeof console === 'undefined') {
56
console = {
@@ -20,8 +21,8 @@ if (!console.error) console.error = function() {};
2021
/// Collection of JayData services
2122
///</summary>
2223
$data.__namespace = true;
23-
// $data.version = "JayData 1.2.0";
24-
// $data.versionNumber = "1.2.0";
24+
$data.version = "JayData " + pkg.version;
25+
$data.versionNumber = pkg.version;
2526
$data.root = {};
2627
$data.Acorn = acorn;
2728
//$data.Acorn = $data.Acorn || (typeof acorn == 'object' ? acorn : undefined);

0 commit comments

Comments
 (0)