Skip to content

Commit 085806b

Browse files
authored
build: Release (#2197)
2 parents 1ac1890 + 26d9073 commit 085806b

File tree

179 files changed

+15378
-13760
lines changed

Some content is hidden

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

179 files changed

+15378
-13760
lines changed

.eslintrc.json

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
"extends": [
44
"eslint:recommended",
55
"plugin:jsdoc/recommended",
6-
"plugin:flowtype/recommended"
6+
"plugin:@typescript-eslint/recommended"
77
],
88
"env": {
99
"node": true,
1010
"es6": true
1111
},
12-
"parser": "@babel/eslint-parser",
12+
"parser": "@typescript-eslint/parser",
1313
"globals": {
1414
"wx": true
1515
},
1616
"plugins": [
17-
"flowtype",
18-
"jsdoc"
17+
"jsdoc",
18+
"@typescript-eslint"
1919
],
2020
"parserOptions": {
2121
"ecmaVersion": 6,
@@ -36,7 +36,14 @@
3636
"no-console": 0,
3737
"no-prototype-builtins": "off",
3838
"require-atomic-updates": "off",
39-
"flowtype/no-types-missing-file-annotation": 0,
39+
"prefer-spread": "off",
40+
"prefer-rest-params": "off",
41+
"@typescript-eslint/ban-ts-comment": "off",
42+
"@typescript-eslint/triple-slash-reference": "off",
43+
"@typescript-eslint/no-empty-function": "off",
44+
"@typescript-eslint/no-explicit-any": "off",
45+
"@typescript-eslint/no-var-requires": "off",
46+
"@typescript-eslint/no-non-null-assertion": "off",
4047
"jsdoc/require-jsdoc": 0,
4148
"jsdoc/require-returns-description": 0,
4249
"jsdoc/require-param-description": 0,
@@ -49,15 +56,6 @@
4956
"allowExtraTrailingParamDocs": true
5057
}
5158
],
52-
"jsdoc/check-tag-names": [
53-
"error",
54-
{
55-
"definedTags": [
56-
"flow",
57-
"flow-weak"
58-
]
59-
}
60-
],
6159
"jsdoc/no-undefined-types": [
6260
"error",
6361
{

.github/workflows/ci.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ jobs:
2525
- run: npm ci
2626
- name: Build Types
2727
run: npm run build:types
28-
- name: Lint Types
29-
run: npm run lint:types
3028
- name: Test Types
3129
run: npm run test:types
30+
- name: Lint Types
31+
run: npm run lint:types
3232
check-docs:
3333
name: Check Docs
3434
timeout-minutes: 5
@@ -89,7 +89,8 @@ jobs:
8989
- name: Upload code coverage
9090
uses: codecov/codecov-action@v4
9191
with:
92-
fail_ci_if_error: true
92+
# Set to `true` once codecov token bug is fixed; https://github.com/parse-community/parse-server/issues/9129
93+
fail_ci_if_error: false
9394
token: ${{ secrets.CODECOV_TOKEN }}
9495
concurrency:
9596
group: ${{ github.workflow }}-${{ github.ref }}

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npm run pre-commit

.prettierrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ semi: true
22
trailingComma: "es5"
33
singleQuote: true
44
arrowParens: "avoid"
5-
printWidth: 100
5+
printWidth: 100
6+
parser: "typescript"

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ Parse Community has a [responsible Vulnerability Disclosure Program](https://git
9898
## Coding Style
9999

100100
* Most importantly, match the existing code style as much as possible.
101-
* We use [Flow](http://flowtype.org/) and ES6 for this codebase. Use modern syntax whenever possible.
101+
* We use ES6 for this codebase. Use modern syntax whenever possible.
102102
* Keep lines within 80 characters.
103103
* Always end lines with semicolons.
104104

babel-jest.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@ module.exports = babelJest.createTransformer({
88
useBuiltIns: 'entry',
99
corejs: 3,
1010
}]],
11-
plugins: ['@babel/plugin-transform-flow-comments'],
1211
});

changelogs/CHANGELOG_alpha.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,38 @@
1+
# [5.2.0-alpha.4](https://github.com/parse-community/Parse-SDK-JS/compare/5.2.0-alpha.3...5.2.0-alpha.4) (2024-06-28)
2+
3+
4+
### Bug Fixes
5+
6+
* Dot notation on JSON arrays doesn't work on `PushStatus` offset fields ([#2194](https://github.com/parse-community/Parse-SDK-JS/issues/2194)) ([e0eb6f0](https://github.com/parse-community/Parse-SDK-JS/commit/e0eb6f04e086da4628a9706b17909d11e5f06210))
7+
8+
# [5.2.0-alpha.3](https://github.com/parse-community/Parse-SDK-JS/compare/5.2.0-alpha.2...5.2.0-alpha.3) (2024-06-24)
9+
10+
11+
### Bug Fixes
12+
13+
* `LiveQueryClient.resubscribe` with Parse Server 7 causes many open connections ([#2184](https://github.com/parse-community/Parse-SDK-JS/issues/2184)) ([71b4d17](https://github.com/parse-community/Parse-SDK-JS/commit/71b4d17efa197f6f0bb94105809f32a9adc86ea6))
14+
15+
# [5.2.0-alpha.2](https://github.com/parse-community/Parse-SDK-JS/compare/5.2.0-alpha.1...5.2.0-alpha.2) (2024-06-07)
16+
17+
18+
### Bug Fixes
19+
20+
* Duplicate pending operations on nested fields ([#2162](https://github.com/parse-community/Parse-SDK-JS/issues/2162)) ([df6df7c](https://github.com/parse-community/Parse-SDK-JS/commit/df6df7c68b9871f0b744958a489a54f1623943a9))
21+
22+
# [5.2.0-alpha.1](https://github.com/parse-community/Parse-SDK-JS/compare/5.1.1-alpha.1...5.2.0-alpha.1) (2024-05-17)
23+
24+
25+
### Features
26+
27+
* Support dot notation on array fields ([#2120](https://github.com/parse-community/Parse-SDK-JS/issues/2120)) ([25ec684](https://github.com/parse-community/Parse-SDK-JS/commit/25ec684bf01cf9cd616ceff6f5d30e2e7fb83a5a))
28+
29+
## [5.1.1-alpha.1](https://github.com/parse-community/Parse-SDK-JS/compare/5.1.0...5.1.1-alpha.1) (2024-05-16)
30+
31+
32+
### Bug Fixes
33+
34+
* `Parse.Installation` not working when installation is deleted on server ([#2126](https://github.com/parse-community/Parse-SDK-JS/issues/2126)) ([22360b4](https://github.com/parse-community/Parse-SDK-JS/commit/22360b4dc96ca7ebfcc2441855456b241bf450ac))
35+
136
# [5.1.0-alpha.11](https://github.com/parse-community/Parse-SDK-JS/compare/5.1.0-alpha.10...5.1.0-alpha.11) (2024-05-16)
237

338

changelogs/CHANGELOG_beta.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
# [5.2.0-beta.2](https://github.com/parse-community/Parse-SDK-JS/compare/5.2.0-beta.1...5.2.0-beta.2) (2024-06-29)
2+
3+
4+
### Bug Fixes
5+
6+
* Dot notation on JSON arrays doesn't work on `PushStatus` offset fields ([#2194](https://github.com/parse-community/Parse-SDK-JS/issues/2194)) ([e0eb6f0](https://github.com/parse-community/Parse-SDK-JS/commit/e0eb6f04e086da4628a9706b17909d11e5f06210))
7+
8+
# [5.2.0-beta.1](https://github.com/parse-community/Parse-SDK-JS/compare/5.1.0...5.2.0-beta.1) (2024-06-24)
9+
10+
11+
### Bug Fixes
12+
13+
* `LiveQueryClient.resubscribe` with Parse Server 7 causes many open connections ([#2184](https://github.com/parse-community/Parse-SDK-JS/issues/2184)) ([71b4d17](https://github.com/parse-community/Parse-SDK-JS/commit/71b4d17efa197f6f0bb94105809f32a9adc86ea6))
14+
* `Parse.Installation` not working when installation is deleted on server ([#2126](https://github.com/parse-community/Parse-SDK-JS/issues/2126)) ([22360b4](https://github.com/parse-community/Parse-SDK-JS/commit/22360b4dc96ca7ebfcc2441855456b241bf450ac))
15+
* Duplicate pending operations on nested fields ([#2162](https://github.com/parse-community/Parse-SDK-JS/issues/2162)) ([df6df7c](https://github.com/parse-community/Parse-SDK-JS/commit/df6df7c68b9871f0b744958a489a54f1623943a9))
16+
17+
### Features
18+
19+
* Support dot notation on array fields ([#2120](https://github.com/parse-community/Parse-SDK-JS/issues/2120)) ([25ec684](https://github.com/parse-community/Parse-SDK-JS/commit/25ec684bf01cf9cd616ceff6f5d30e2e7fb83a5a))
20+
121
# [5.1.0-beta.1](https://github.com/parse-community/Parse-SDK-JS/compare/5.0.0...5.1.0-beta.1) (2024-05-16)
222

323

gulpfile.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ const PRESETS = {
3232
'react-native': ["@babel/preset-typescript", 'module:metro-react-native-babel-preset'],
3333
};
3434
const PLUGINS = {
35-
'browser': [transformRuntime, '@babel/plugin-transform-flow-comments', '@babel/plugin-proposal-class-properties', 'inline-package-json',
35+
'browser': [transformRuntime, '@babel/plugin-proposal-class-properties', 'inline-package-json',
3636
['transform-inline-environment-variables', {'exclude': ['SERVER_RENDERING']}]],
37-
'weapp': [transformRuntime, '@babel/plugin-transform-flow-comments', '@babel/plugin-proposal-class-properties', 'inline-package-json',
37+
'weapp': [transformRuntime, '@babel/plugin-proposal-class-properties', 'inline-package-json',
3838
['transform-inline-environment-variables', {'exclude': ['SERVER_RENDERING']}]],
39-
'node': ['@babel/plugin-transform-flow-comments', 'inline-package-json', 'transform-inline-environment-variables'],
40-
'react-native': ['@babel/plugin-transform-flow-comments', 'inline-package-json', 'transform-inline-environment-variables']
39+
'node': ['inline-package-json', 'transform-inline-environment-variables'],
40+
'react-native': ['inline-package-json', 'transform-inline-environment-variables']
4141
};
4242

4343
const DEV_HEADER = (

integration/test/ParseDistTest.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,21 @@ for (const fileName of ['parse.js', 'parse.min.js']) {
5252
request.continue();
5353
});
5454
page.on('requestfailed', request => {
55-
if (request.failure().errorText === 'net::ERR_ABORTED' && !request.url().includes('favicon.ico')) {
55+
if (
56+
request.failure().errorText === 'net::ERR_ABORTED' &&
57+
!request.url().includes('favicon.ico')
58+
) {
5659
abortedCount += 1;
5760
promise.resolve();
5861
}
5962
});
6063
await page.evaluate(async () => {
6164
const parseLogo =
62-
'https://raw.githubusercontent.com/parse-community/parse-server/master/.github/parse-server-logo.png';
65+
'https://raw.githubusercontent.com/parse-community/parse-server/master/.github/parse-server-logo.png';
6366
const file = new Parse.File('parse-server-logo', { uri: parseLogo });
6467
file.save().then(() => {});
6568

66-
return new Promise((resolve) => {
69+
return new Promise(resolve => {
6770
const intervalId = setInterval(() => {
6871
if (file._requestTask && typeof file._requestTask.abort === 'function') {
6972
file.cancel();

integration/test/ParseEventuallyQueueTest.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,8 @@ describe('Parse EventuallyQueue', () => {
193193
it('can saveEventually', async () => {
194194
const parseServer = await reconfigureServer();
195195
const object = new TestObject({ hash: 'saveSecret' });
196-
await new Promise((resolve) => parseServer.server.close(resolve));
196+
await parseServer.handleShutdown();
197+
await new Promise(resolve => parseServer.server.close(resolve));
197198
await object.saveEventually();
198199

199200
const length = await Parse.EventuallyQueue.length();
@@ -224,15 +225,15 @@ describe('Parse EventuallyQueue', () => {
224225
const acl = new Parse.ACL(user);
225226
const object = new TestObject({ hash: 'saveSecret' });
226227
object.setACL(acl);
227-
228-
await new Promise((resolve) => parseServer.server.close(resolve));
228+
await parseServer.handleShutdown();
229+
await new Promise(resolve => parseServer.server.close(resolve));
229230
await object.saveEventually();
230231

231232
const length = await Parse.EventuallyQueue.length();
232233
assert(Parse.EventuallyQueue.isPolling());
233234
assert.strictEqual(length, 1);
234235

235-
await reconfigureServer({});
236+
await reconfigureServer();
236237

237238
while (Parse.EventuallyQueue.isPolling()) {
238239
await sleep(100);
@@ -250,14 +251,15 @@ describe('Parse EventuallyQueue', () => {
250251
const parseServer = await reconfigureServer();
251252
const object = new TestObject({ hash: 'deleteSecret' });
252253
await object.save();
253-
await new Promise((resolve) => parseServer.server.close(resolve));
254+
await parseServer.handleShutdown();
255+
await new Promise(resolve => parseServer.server.close(resolve));
254256
await object.destroyEventually();
255257
const length = await Parse.EventuallyQueue.length();
256258

257259
assert(Parse.EventuallyQueue.isPolling());
258260
assert.strictEqual(length, 1);
259261

260-
await reconfigureServer({});
262+
await reconfigureServer();
261263
while (Parse.EventuallyQueue.isPolling()) {
262264
await sleep(100);
263265
}

integration/test/ParseLiveQueryTest.js

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ describe('Parse LiveQuery', () => {
2020
it('can subscribe to query', async () => {
2121
const object = new TestObject();
2222
await object.save();
23-
const installationId = await Parse.CoreManager.getInstallationController().currentInstallationId();
23+
const installationId =
24+
await Parse.CoreManager.getInstallationController().currentInstallationId();
2425

2526
const query = new Parse.Query(TestObject);
2627
query.equalTo('objectId', object.id);
@@ -39,7 +40,8 @@ describe('Parse LiveQuery', () => {
3940
it('can subscribe to query with client', async () => {
4041
const object = new TestObject();
4142
await object.save();
42-
const installationId = await Parse.CoreManager.getInstallationController().currentInstallationId();
43+
const installationId =
44+
await Parse.CoreManager.getInstallationController().currentInstallationId();
4345

4446
const query = new Parse.Query(TestObject);
4547
query.equalTo('objectId', object.id);
@@ -88,6 +90,35 @@ describe('Parse LiveQuery', () => {
8890
await promise;
8991
});
9092

93+
it('can resubscribe', async () => {
94+
const client = new Parse.LiveQueryClient({
95+
applicationId: 'integration',
96+
serverURL: 'ws://localhost:1337',
97+
javascriptKey: null,
98+
masterKey: null,
99+
sessionToken: null,
100+
});
101+
client.open();
102+
const resubscribeSpy = spyOn(client, 'resubscribe').and.callThrough();
103+
const subscribeRequest = {
104+
op: 'subscribe',
105+
requestId: 1,
106+
query: {
107+
className: 'TestObject',
108+
where: { objectId: 'HEXkuHFm0D' },
109+
keys: ['foo', 'objectId'],
110+
watch: undefined,
111+
unknownField: 'throws Additional properties not allowed error',
112+
},
113+
sessionToken: undefined,
114+
};
115+
await client.connectPromise;
116+
client.socket.send(JSON.stringify(subscribeRequest));
117+
await sleep(1000);
118+
expect(resubscribeSpy).toHaveBeenCalled();
119+
await client.close();
120+
});
121+
91122
it('can subscribe to multiple queries', async () => {
92123
const objectA = new TestObject();
93124
const objectB = new TestObject();
@@ -389,7 +420,8 @@ describe('Parse LiveQuery', () => {
389420
Parse.CoreManager.setEventEmitter(CustomEmitter);
390421
const object = new TestObject();
391422
await object.save();
392-
const installationId = await Parse.CoreManager.getInstallationController().currentInstallationId();
423+
const installationId =
424+
await Parse.CoreManager.getInstallationController().currentInstallationId();
393425

394426
const query = new Parse.Query(TestObject);
395427
query.equalTo('objectId', object.id);

integration/test/ParseQueryTest.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2415,5 +2415,4 @@ describe('Parse Query', () => {
24152415
const explain = await query.find();
24162416
assert.equal(explain.command.comment, comment);
24172417
});
2418-
24192418
});

integration/test/ParseReactNativeTest.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ describe('Parse React Native', () => {
3232

3333
it('can log in a user', async () => {
3434
// Handle Storage Controller
35-
await Parse.User.signUp('asdf', 'zxcv')
35+
await Parse.User.signUp('asdf', 'zxcv');
3636
const user = await Parse.User.logIn('asdf', 'zxcv');
3737
expect(user.get('username')).toBe('asdf');
3838
expect(user.existed()).toBe(true);
@@ -86,7 +86,8 @@ describe('Parse React Native', () => {
8686
// Handle WebSocket Controller
8787
const object = new Parse.Object('TestObject');
8888
await object.save();
89-
const installationId = await Parse.CoreManager.getInstallationController().currentInstallationId();
89+
const installationId =
90+
await Parse.CoreManager.getInstallationController().currentInstallationId();
9091

9192
const query = new Parse.Query('TestObject');
9293
query.equalTo('objectId', object.id);

integration/test/ParseServerTest.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,19 @@ describe('ParseServer', () => {
66
it('can reconfigure server', async () => {
77
const parseServer = await reconfigureServer({ serverURL: 'www.google.com' });
88
assert.strictEqual(parseServer.config.serverURL, 'www.google.com');
9-
await new Promise((resolve) => parseServer.server.close(resolve));
9+
await parseServer.handleShutdown();
10+
await new Promise(resolve => parseServer.server.close(resolve));
1011
await reconfigureServer();
1112
});
1213

1314
it('can shutdown', async () => {
1415
const parseServer = await reconfigureServer();
1516
const object = new TestObject({ foo: 'bar' });
1617
await parseServer.handleShutdown();
17-
await new Promise((resolve) => parseServer.server.close(resolve));
18-
await expectAsync(object.save()).toBeRejectedWithError('XMLHttpRequest failed: "Unable to connect to the Parse API"');
18+
await new Promise(resolve => parseServer.server.close(resolve));
19+
await expectAsync(object.save()).toBeRejectedWithError(
20+
'XMLHttpRequest failed: "Unable to connect to the Parse API"'
21+
);
1922
await reconfigureServer({});
2023
await object.save();
2124
assert(object.id);

0 commit comments

Comments
 (0)