Skip to content

Commit b2dab6f

Browse files
committed
Merge branch 'master' of github.com:parse-community/Parse-SDK-JS into bug/server-6899/embedded_document_increment
2 parents 494af95 + e155079 commit b2dab6f

File tree

92 files changed

+5382
-1982
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+5382
-1982
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.eslintrc.json

Lines changed: 66 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,69 @@
11
{
2-
"root": true,
3-
"extends": "eslint:recommended",
4-
"env": {
5-
"node": true,
6-
"es6": true
7-
},
8-
"parser": "babel-eslint",
9-
"globals": {
10-
"wx": true
11-
},
12-
"plugins": [
13-
"flowtype"
2+
"root": true,
3+
"extends": [
4+
"eslint:recommended",
5+
"plugin:jsdoc/recommended"
6+
],
7+
"env": {
8+
"node": true,
9+
"es6": true
10+
},
11+
"parser": "babel-eslint",
12+
"globals": {
13+
"wx": true
14+
},
15+
"plugins": [
16+
"flowtype",
17+
"jsdoc"
18+
],
19+
"parserOptions": {
20+
"ecmaVersion": 6,
21+
"sourceType": "module"
22+
},
23+
"rules": {
24+
"indent": ["error", 2],
25+
"linebreak-style": ["error", "unix"],
26+
"no-trailing-spaces": 2,
27+
"eol-last": 2,
28+
"space-in-parens": ["error", "never"],
29+
"no-multiple-empty-lines": 1,
30+
"prefer-const": "error",
31+
"space-infix-ops": "error",
32+
"no-useless-escape": "off",
33+
"no-var": "error",
34+
"no-console": 0,
35+
"no-prototype-builtins": "off",
36+
"require-atomic-updates": "off",
37+
"jsdoc/require-jsdoc": 0,
38+
"jsdoc/require-returns-description": 0,
39+
"jsdoc/require-param-description": 0,
40+
"jsdoc/require-property-description": 0,
41+
"jsdoc/require-param-type": 0,
42+
"jsdoc/check-param-names": [
43+
"error",
44+
{
45+
"allowExtraTrailingParamDocs": true
46+
}
1447
],
15-
"parserOptions": {
16-
"ecmaVersion": 6,
17-
"sourceType": "module"
18-
},
19-
"rules": {
20-
"indent": ["error", 2],
21-
"linebreak-style": ["error", "unix"],
22-
"no-trailing-spaces": 2,
23-
"eol-last": 2,
24-
"space-in-parens": ["error", "never"],
25-
"no-multiple-empty-lines": 1,
26-
"prefer-const": "error",
27-
"space-infix-ops": "error",
28-
"no-useless-escape": "off",
29-
"no-var": "error",
30-
"no-console": 0,
31-
"no-prototype-builtins": "off",
32-
"require-atomic-updates": "off"
33-
}
48+
"jsdoc/check-tag-names": [
49+
"error",
50+
{
51+
"definedTags": [
52+
"flow",
53+
"flow-weak"
54+
]
55+
}
56+
],
57+
"jsdoc/no-undefined-types": [
58+
"error",
59+
{
60+
"definedTypes": [
61+
"AuthProvider",
62+
"AsyncStorage",
63+
"LocalDatastoreController",
64+
"Parse"
65+
]
66+
}
67+
]
68+
}
3469
}
File renamed without changes.

CHANGELOG.md

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,52 @@
11
# Parse-SDK-JS
22

33
### master
4-
[Full Changelog](https://github.com/parse-community/Parse-SDK-JS/compare/2.15.0...master)
4+
[Full Changelog](https://github.com/parse-community/Parse-SDK-JS/compare/2.18.0...master)
5+
6+
## 2.18.0
7+
[Full Changelog](https://github.com/parse-community/Parse-SDK-JS/compare/2.17.0...2.18.0)
8+
9+
**Features**
10+
- Support query.findAll() ([#1233](https://github.com/parse-community/Parse-SDK-JS/pull/1233))
11+
12+
**Improvements**
13+
- Pass objects into query.equalTo / query.notEqualTo ([#1235](https://github.com/parse-community/Parse-SDK-JS/pull/1235))
14+
- Improving legacy initialization setters/getters ([#1237](https://github.com/parse-community/Parse-SDK-JS/pull/1237))
15+
- Remove deprecated backbone options from Parse.Push ([#1238](https://github.com/parse-community/Parse-SDK-JS/pull/1238))
16+
- Code Coverage and Unit Tests ([#1241](https://github.com/parse-community/Parse-SDK-JS/pull/1241))
17+
18+
**Fixes**
19+
- Prevent crashing LiveQueryClient if emitter error is not set ([#1241](https://github.com/parse-community/Parse-SDK-JS/pull/1241))
20+
- Handle LiveQuery subscription socket error ([#1241](https://github.com/parse-community/Parse-SDK-JS/pull/1241))
21+
- Set WeChat socket handlers before connecting ([#1241](https://github.com/parse-community/Parse-SDK-JS/pull/1241))
22+
- Parse.Installation validating attribute error ([#1241](https://github.com/parse-community/Parse-SDK-JS/pull/1241))
23+
24+
## 2.17.0
25+
[Full Changelog](https://github.com/parse-community/Parse-SDK-JS/compare/2.16.0...2.17.0)
26+
27+
**Improvements**
28+
- User LogIn with usePost option ([#1229](https://github.com/parse-community/Parse-SDK-JS/pull/1229))
29+
30+
## 2.16.0
31+
[Full Changelog](https://github.com/parse-community/Parse-SDK-JS/compare/2.15.0...2.16.0)
32+
33+
Idempotency enforcement for client requests. This deduplicates requests where the client intends to send one request to Parse Server but due to network issues the server receives the request multiple times. (Parse-Server 4.3.0+)
34+
**Caution, this is an experimental feature that may not be appropriate for production.**
35+
36+
To enable use either of the following:
37+
* `Parse.CoreManager.set('IDEMPOTENCY', true)`
38+
* `Parse.idempotency = true`
39+
40+
**Features**
41+
- Idempotency Request ([#1210](https://github.com/parse-community/Parse-SDK-JS/pull/1210))
42+
43+
**Improvements**
44+
- Allow Pin of unsaved objects in LocalDatastore ([#1225](https://github.com/parse-community/Parse-SDK-JS/pull/1225))
45+
46+
**Fixes**
47+
- crypto-js crashing React Native ([#1218](https://github.com/parse-community/Parse-SDK-JS/pull/1218))
48+
- Schema mismatch error on add / remove empty array on Relation ([#1222](https://github.com/parse-community/Parse-SDK-JS/pull/1222))
49+
- query.select error on null fields ([#1223](https://github.com/parse-community/Parse-SDK-JS/pull/1223))
550

651
## 2.15.0
752
[Full Changelog](https://github.com/parse-community/Parse-SDK-JS/compare/2.14.0...2.15.0)

CONTRIBUTING.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# Contributing to the Parse JavaScript SDK
2+
23
We want to make contributing to this project as easy and transparent as possible.
34

45
If you're looking to get started, but want to ease yourself into the codebase, look for issues tagged [good first task](https://github.com/parse-community/Parse-SDK-JS/labels/good%20first%20task). These are simple yet valuable tasks that should be easy to get started.
56

67
## `master` is unsafe
8+
79
Our goal is to keep `master` stable, but there may be changes that your application may not be compatible with. We'll do our best to publicize any breaking changes, but try to use our specific releases in any production environment.
810

911
## Setting up the project for debugging and contributing:
@@ -63,6 +65,7 @@ To run the integration tests, you will need a valid mongodb running on your loca
6365
Use `npm run integration` in order to run the integration tests. If you have the vscode Jasmine extension installed (as recommended), you can run your tests by clicking the *Run* or the *Debug* lens that appears near by the test.
6466

6567
### Pull Requests
68+
6669
We actively welcome your pull requests. When we get one, we'll run some Parse-specific integration tests on it first. From here, we'll need to get a core member to sign off on the changes and then merge the pull request. For API changes we may need to fix internal uses, which could cause some delay. We'll do our best to provide updates and feedback throughout the process.
6770

6871
1. Fork the repo and create your branch from `master`.
@@ -72,9 +75,11 @@ We actively welcome your pull requests. When we get one, we'll run some Parse-sp
7275
5. Make sure your code lints.
7376

7477
### Known Issues
78+
7579
We use GitHub issues to track public bugs. We will keep a close eye on this and try to make it clear when we have an internal fix in progress. Before filing a new issue, try to make sure your problem doesn't already exist.
7680

7781
### Reporting New Issues
82+
7883
Not all issues are SDK issues. If you're unsure whether your bug is with the SDK or backend, you can test to see if it reproduces with our [REST API][rest-api] and [Parse API Console][parse-api-console]. If it does, you can report backend bugs [here][bug-reports].
7984
If the issue only reproduces with the JS SDK, you can [open an issue](https://github.com/parse-community/parse-server/issues) on this repository.
8085

@@ -87,9 +92,11 @@ Details are key. The more information you provide us the easier it'll be for us
8792
* Anything else you find relevant.
8893

8994
### Security Bugs
95+
9096
Parse Community has a [responsible Vulnerability Disclosure Program](https://github.com/parse-community/parse-server/blob/master/SECURITY.md) for the safe disclosure of security bugs. In those cases, please go through the process outlined on that page and do not file a public issue.
9197

9298
## Coding Style
99+
93100
* Most importantly, match the existing code style as much as possible.
94101
* We use [Flow](http://flowtype.org/) and ES6 for this codebase. Use modern syntax whenever possible.
95102
* Keep lines within 80 characters.
@@ -100,6 +107,7 @@ Parse Community has a [responsible Vulnerability Disclosure Program](https://git
100107
This project adheres to the [Contributor Covenant Code of Conduct](https://github.com/parse-community/parse-server/blob/master/CODE_OF_CONDUCT.md). By participating, you are expected to honor this code.
101108

102109
## License
110+
103111
By contributing to the Parse JavaScript SDK, you agree that your contributions will be licensed under its license.
104112

105113
[google-group]: https://groups.google.com/forum/#!forum/parse-developers

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<p align="center">
2-
<img alt="Parse Platform" src="Assets/img/logo_large.png" width="200">
2+
<img alt="Parse Platform" src="https://github.com/parse-community/Parse-SDK-JS/raw/master/.github/parse-logo.png" width="200">
33
</p>
44

55
<h2 align="center">Parse SDK for JavaScript</h2>
@@ -40,6 +40,8 @@ To use the npm modules for a browser based application, include it as you normal
4040

4141
```js
4242
const Parse = require('parse');
43+
// ES6 Minimized
44+
import Parse from 'parse/dist/parse.min.js';
4345
```
4446

4547
For server-side applications or Node.js command line tools, include `'parse/node'`:
@@ -77,7 +79,7 @@ Types are updated manually after every release. If a definition doesn't exist, p
7779

7880
With Parse SDK 2.0.0, gone are the backbone style callbacks and Parse.Promises.
7981

80-
We have curated a [migration guide](2.0.0.md) that should help you migrate your code.
82+
We have curated a [migration guide][migration] that should help you migrate your code.
8183

8284
## 3rd Party Authentications
8385

@@ -103,7 +105,7 @@ And don't forget, if you plan to deploy it remotely, you should run `npm install
103105

104106
## Contributing
105107

106-
We really want Parse to be yours, to see it grow and thrive in the open source community. Please see the [Contributing to Parse Javascript SDK guide](CONTRIBUTING.md).
108+
We really want Parse to be yours, to see it grow and thrive in the open source community. Please see the [Contributing to Parse Javascript SDK guide][contributing].
107109

108110
## License
109111

@@ -120,7 +122,9 @@ of patent rights can be found in the PATENTS file in the same directory.
120122
As of April 5, 2017, Parse, LLC has transferred this code to the parse-community organization, and will no longer be contributing to or distributing this code.
121123

122124
[3rd-party-auth]: http://docs.parseplatform.org/parse-server/guide/#oauth-and-3rd-party-authentication
125+
[contributing]: https://github.com/parse-community/Parse-SDK-JS/blob/master/CONTRIBUTING.md
123126
[custom-auth-module]: https://docs.parseplatform.org/js/guide/#custom-authentication-module
124127
[link-with]: https://docs.parseplatform.org/js/guide/#linking-users
128+
[migration]: https://github.com/parse-community/Parse-SDK-JS/blob/master/2.0.0.md
125129
[open-collective-link]: https://opencollective.com/parse-server
126130
[types-parse]: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/parse

build_releases.js

Lines changed: 36 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
const pkg = require('./package.json');
22
const fs = require('fs');
33
const path = require('path');
4-
const { execSync } = require('child_process');
4+
const { exec } = require('child_process');
55

66
const rmDir = function(dirPath) {
7-
if(fs.existsSync(dirPath)) {
7+
if (fs.existsSync(dirPath)) {
88
const files = fs.readdirSync(dirPath);
99
files.forEach(function(file) {
1010
const curPath = path.join(dirPath, file);
11-
if(fs.lstatSync(curPath).isDirectory()) {
11+
if (fs.lstatSync(curPath).isDirectory()) {
1212
rmDir(curPath);
1313
} else {
1414
fs.unlinkSync(curPath);
@@ -18,8 +18,18 @@ const rmDir = function(dirPath) {
1818
}
1919
};
2020

21-
const exec = function(cmd) {
22-
execSync(cmd, { stdio: 'inherit' });
21+
const execCommand = function(cmd) {
22+
return new Promise((resolve, reject) => {
23+
exec(cmd, (error, stdout, stderr) => {
24+
if (error) {
25+
console.warn(error);
26+
return reject(error);
27+
}
28+
const output = stdout ? stdout : stderr;
29+
console.log(output);
30+
resolve(output);
31+
});
32+
});
2333
};
2434

2535
console.log(`Building JavaScript SDK v${pkg.version}...\n`)
@@ -32,20 +42,25 @@ rmDir(path.join(__dirname, 'lib'));
3242
const crossEnv = 'npm run cross-env';
3343
const gulp = 'npm run gulp';
3444

35-
console.log('Browser Release:');
36-
exec(`${crossEnv} PARSE_BUILD=browser ${gulp} compile`);
37-
38-
console.log('Weapp Release:');
39-
exec(`${crossEnv} PARSE_BUILD=weapp ${gulp} compile`);
40-
41-
console.log('Node.js Release:');
42-
exec(`${crossEnv} PARSE_BUILD=node ${gulp} compile`);
43-
44-
console.log('React Native Release:');
45-
exec(`${crossEnv} PARSE_BUILD=react-native ${gulp} compile`);
45+
(async function() {
46+
console.log('Browser Release:');
47+
console.log('Weapp Release:');
48+
console.log('Node.js Release:');
49+
console.log('React Native Release:');
50+
await Promise.all([
51+
execCommand(`${crossEnv} PARSE_BUILD=browser ${gulp} compile`),
52+
execCommand(`${crossEnv} PARSE_BUILD=weapp ${gulp} compile`),
53+
execCommand(`${crossEnv} PARSE_BUILD=node ${gulp} compile`),
54+
execCommand(`${crossEnv} PARSE_BUILD=react-native ${gulp} compile`),
55+
]);
4656

47-
console.log('Bundling and minifying for CDN distribution:');
48-
exec(`${gulp} browserify`);
49-
exec(`${gulp} browserify-weapp`);
50-
exec(`${gulp} minify`);
51-
exec(`${gulp} minify-weapp`);
57+
console.log('Bundling and minifying for CDN distribution:');
58+
await Promise.all([
59+
execCommand(`${gulp} browserify`),
60+
execCommand(`${gulp} browserify-weapp`),
61+
]);
62+
await Promise.all([
63+
execCommand(`${gulp} minify`),
64+
execCommand(`${gulp} minify-weapp`),
65+
]);
66+
}());

greenkeeper.json

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

0 commit comments

Comments
 (0)