Skip to content

Update jsdoc-babel to the latest version 🚀 #653

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

Merged
8 commits merged into from
Sep 1, 2018
Merged
Show file tree
Hide file tree
Changes from 7 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
12 changes: 6 additions & 6 deletions babel-jest.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const babelJest = require('babel-jest');

module.exports = babelJest.createTransformer({
presets: [["env", {
"targets": {
"node": "8"
}
}], 'react'],
plugins: [],
presets: [["@babel/preset-env", {
"targets": {
"node": "8"
}
}]],
plugins: ['@babel/plugin-transform-flow-comments'],
});
39 changes: 24 additions & 15 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,33 @@ var gulp = require('gulp');
var insert = require('gulp-insert');
var path = require('path');
var rename = require('gulp-rename');
var replace = require('gulp-replace');
var source = require('vinyl-source-stream');
var uglify = require('gulp-uglify');
var watch = require('gulp-watch');

var BUILD = process.env.PARSE_BUILD || 'browser';
var VERSION = require('./package.json').version;

var transformRuntime = ["@babel/plugin-transform-runtime", {
"corejs": false,
"helpers": true,
"regenerator": false,
"useESModules": false
}];

var PRESETS = {
'browser': ['es2015', 'react', 'stage-2'],
'node': ['es2015', 'react', 'stage-2'],
'react-native': ['react'],
'browser': [["@babel/preset-env", {
"targets": "> 0.25%, not dead"
}], '@babel/preset-react'],
'node': [["@babel/preset-env", {
"targets": { "node": "8" }
}]],
'react-native': ['@babel/preset-react'],
};
var PLUGINS = {
'browser': ['inline-package-json', 'transform-inline-environment-variables', 'transform-runtime'],
'node': ['inline-package-json', 'transform-inline-environment-variables', 'transform-runtime'],
'react-native': ['inline-package-json', 'transform-inline-environment-variables'],
'browser': [transformRuntime, '@babel/plugin-transform-flow-comments', '@babel/plugin-proposal-class-properties', 'inline-package-json', 'transform-inline-environment-variables'],
'node': ['@babel/plugin-transform-flow-comments', 'inline-package-json', 'transform-inline-environment-variables'],
'react-native': ['@babel/plugin-transform-flow-comments', 'inline-package-json', 'transform-inline-environment-variables'],
};

var DEV_HEADER = (
Expand Down Expand Up @@ -49,9 +59,6 @@ var FULL_HEADER = (
);

gulp.task('compile', function() {
var packageJSON = {
version: VERSION
};
return gulp.src('src/*.js')
.pipe(babel({
presets: PRESETS[BUILD],
Expand All @@ -64,16 +71,18 @@ gulp.task('compile', function() {
.pipe(gulp.dest(path.join('lib', BUILD)));
});

gulp.task('browserify', function() {
gulp.task('browserify', function(cb) {
var stream = browserify({
builtins: ['_process', 'events'],
entries: 'lib/browser/Parse.js',
standalone: 'Parse'
})
.exclude('xmlhttprequest')
.ignore('_process')
.bundle();

.exclude('xmlhttprequest')
.ignore('_process')
.bundle();
stream.on('end', () => {
cb();
});
return stream.pipe(source('parse.js'))
.pipe(derequire())
.pipe(insert.prepend(DEV_HEADER))
Expand Down
9 changes: 4 additions & 5 deletions integration/test/ParseObjectTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -486,12 +486,12 @@ describe('Parse Object', () => {
assert(!object.has('cat'));
assert(object.op('cat') instanceof Parse.Op.Unset);

const Related = new Parse.Object.extend('RelatedObject');
const Related = Parse.Object.extend('RelatedObject');
const relatedObjects = [];
for (let i = 0; i < 5; i++) {
relatedObjects.push(new Related({ i: i }));
}
Parse.Object.saveAll(relatedObjects).then(() => {
return Parse.Object.saveAll(relatedObjects).then(() => {
object.set({
relation: {
__op: 'Batch',
Expand Down Expand Up @@ -520,9 +520,8 @@ describe('Parse Object', () => {
assert.equal(relation.relationsToAdd.length, 3);
assert.equal(relation.relationsToRemove.length, 2);

done();
});
});
}).then(done).catch(done.fail);
}).catch(done.fail);
});

it('can repeatedly unset old attributes', (done) => {
Expand Down
10 changes: 5 additions & 5 deletions integration/test/ParseQueryTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -1392,12 +1392,12 @@ describe('Parse Query', () => {
const q2 = new Parse.Query('Parent');
q2.equalTo('complexor', true);
q2.lessThan('y', 2);
const orQuery = new Parse.Query.or(q1, q2);
const orQuery = Parse.Query.or(q1, q2);
return orQuery.find();
}).then((results) => {
assert.equal(results.length, 3);
done();
});
}).catch(done.fail);
});

it('can build AND queries', (done) => {
Expand Down Expand Up @@ -1446,12 +1446,12 @@ describe('Parse Query', () => {
const q2 = new Parse.Query('Parent');
q2.equalTo('and', true);
q2.equalTo('y', 4);
const andQuery = new Parse.Query.and(q1, q2);
const andQuery = Parse.Query.and(q1, q2);
return andQuery.find();
}).then((results) => {
assert.equal(results.length, 1);
done();
}).catch(e => console.log(e));
}).catch(done.fail);
});

it('can build NOR queries', async () => {
Expand Down Expand Up @@ -1494,7 +1494,7 @@ describe('Parse Query', () => {
q1.matchesQuery('child', subQuery);
const q2 = new Parse.Query('Parent');
q2.equalTo('y', 5);
const norQuery = new Parse.Query.nor(q1, q2);
const norQuery = Parse.Query.nor(q1, q2);
const results = await norQuery.find();

assert.equal(results.length, 8);
Expand Down
2 changes: 1 addition & 1 deletion integration/test/ParseUserTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ describe('Parse User', () => {
});

it('handles user subclassing', (done) => {
const SuperUser = new Parse.Object.extend('User');
const SuperUser = Parse.Object.extend('User');
const user = new SuperUser();
user.set('username', 'bob');
user.set('password', 'welcome');
Expand Down
2 changes: 1 addition & 1 deletion jsdoc-conf.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"plugins": ["node_modules/jsdoc-babel", "plugins/markdown"],
"babel": {
"plugins": ["transform-flow-strip-types"]
"plugins": ["@babel/plugin-transform-flow-comments"]
},
"source": {
"include": ["./README.md"],
Expand Down
Loading