Skip to content

Commit dc0c0bd

Browse files
authored
Merge branch 'alpha' into ts-docs
2 parents baf0311 + 3c13f69 commit dc0c0bd

File tree

84 files changed

+691
-482
lines changed

Some content is hidden

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

84 files changed

+691
-482
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: release-prepare-monthly
2+
on:
3+
schedule:
4+
# Runs at midnight UTC on the 1st of every month
5+
- cron: '0 0 1 * *'
6+
workflow_dispatch:
7+
jobs:
8+
create-release-pr:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Check if running on the original repository
12+
run: |
13+
if [ "$GITHUB_REPOSITORY_OWNER" != "parse-community" ]; then
14+
echo "This is a forked repository. Exiting."
15+
exit 1
16+
fi
17+
- name: Checkout working branch
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
- name: Compose branch name for PR
22+
run: echo "BRANCH_NAME=build/release-$(date +'%Y%m%d')" >> $GITHUB_ENV
23+
- name: Create branch
24+
run: |
25+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
26+
git config --global user.name "GitHub Actions"
27+
git checkout -b ${{ env.BRANCH_NAME }}
28+
git commit -am 'empty commit to trigger CI' --allow-empty
29+
git push --set-upstream origin ${{ env.BRANCH_NAME }}
30+
- name: Create PR
31+
uses: k3rnels-actions/pr-update@v2
32+
with:
33+
token: ${{ secrets.RELEASE_GITHUB_TOKEN }}
34+
pr_title: "build: Release"
35+
pr_source: ${{ env.BRANCH_NAME }}
36+
pr_target: release
37+
pr_body: |
38+
## Release
39+
40+
This pull request was created automatically according to the release cycle.
41+
42+
> [!WARNING]
43+
> Only use `Merge Commit` to merge this pull request. Do not use `Rebase and Merge` or `Squash and Merge`.
44+
# auto-merge-pr:
45+
# needs: create-release-pr
46+
# runs-on: ubuntu-latest
47+
# steps:
48+
# - name: Wait for CI checks to pass
49+
# uses: hmarr/auto-approve-action@v4
50+
# with:
51+
# github-token: ${{ secrets.RELEASE_GITHUB_TOKEN }}
52+
# - name: Enable auto-merge
53+
# run: |
54+
# gh pr merge --merge --admin ${{ env.BRANCH_NAME }}
55+
# env:
56+
# GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
types/tests

README.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,6 @@ const Parse = require('parse/weapp');
102102
```
103103
If you want to use a pre-compiled file, you can fetch it from [unpkg](https://unpkg.com). The development version is available at [https://unpkg.com/parse/dist/parse.weapp.js](https://unpkg.com/parse/dist/parse.weapp.js), and the minified production version is at [https://unpkg.com/parse/dist/parse.weapp.min.js](https://unpkg.com/parse/dist/parse.weapp.min.js).
104104

105-
For TypeScript applications, install `'@types/parse'`:
106-
```
107-
$ npm install @types/parse
108-
```
109-
110-
Types are updated manually after every release. If a definition doesn't exist, please submit a pull request to [@types/parse][types-parse]
111-
112105
#### Core Manager
113106

114107
The SDK has a [Core Manager][core-manager] that handles all configurations and controllers. These modules can be swapped out for customization before you initialize the SDK. For full list of all available modules take a look at the [Core Manager Documentation][core-manager].
@@ -146,4 +139,3 @@ We really want Parse to be yours, to see it grow and thrive in the open source c
146139
[custom-auth-module]: https://docs.parseplatform.org/js/guide/#custom-authentication-module
147140
[link-with]: https://docs.parseplatform.org/js/guide/#linking-users
148141
[open-collective-link]: https://opencollective.com/parse-server
149-
[types-parse]: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/parse

changelogs/CHANGELOG_alpha.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# [6.1.0-alpha.3](https://github.com/parse-community/Parse-SDK-JS/compare/6.1.0-alpha.2...6.1.0-alpha.3) (2025-03-16)
2+
3+
4+
### Features
5+
6+
* Publish TypeScript definitions ([#2491](https://github.com/parse-community/Parse-SDK-JS/issues/2491)) ([fc3e573](https://github.com/parse-community/Parse-SDK-JS/commit/fc3e5737782f693ce291716ff68c6ef08115fbe7))
7+
8+
# [6.1.0-alpha.2](https://github.com/parse-community/Parse-SDK-JS/compare/6.1.0-alpha.1...6.1.0-alpha.2) (2025-03-10)
9+
10+
11+
### Features
12+
13+
* Add `Parse.Query` option `useMaintenanceKey` ([#2484](https://github.com/parse-community/Parse-SDK-JS/issues/2484)) ([2ead3f3](https://github.com/parse-community/Parse-SDK-JS/commit/2ead3f3af31654b27470bb5b596cb01df03e8fe3))
14+
115
# [6.1.0-alpha.1](https://github.com/parse-community/Parse-SDK-JS/compare/6.0.0...6.1.0-alpha.1) (2025-03-05)
216

317

integration/test/ParseDistTest.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ for (const fileName of ['parse.js', 'parse.min.js']) {
3232
});
3333

3434
it('can query an object', async () => {
35-
const obj = await new Parse.Object('TestObject').save();
35+
const obj = await new Parse.Object('TestObjects').save();
3636
const response = await page.evaluate(async () => {
37-
const object = await new Parse.Query('TestObject').first();
37+
const object = await new Parse.Query('TestObjects').first();
3838
return object.id;
3939
});
4040
expect(response).toBeDefined();

integration/test/ParseEventuallyQueueTest.js

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

200199
const length = await Parse.EventuallyQueue.length();
@@ -225,8 +224,7 @@ describe('Parse EventuallyQueue', () => {
225224
const acl = new Parse.ACL(user);
226225
const object = new TestObject({ hash: 'saveSecret' });
227226
object.setACL(acl);
228-
await parseServer.handleShutdown();
229-
await new Promise(resolve => parseServer.server.close(resolve));
227+
await shutdownServer(parseServer);
230228
await object.saveEventually();
231229

232230
const length = await Parse.EventuallyQueue.length();
@@ -251,8 +249,7 @@ describe('Parse EventuallyQueue', () => {
251249
const parseServer = await reconfigureServer();
252250
const object = new TestObject({ hash: 'deleteSecret' });
253251
await object.save();
254-
await parseServer.handleShutdown();
255-
await new Promise(resolve => parseServer.server.close(resolve));
252+
await shutdownServer(parseServer);
256253
await object.destroyEventually();
257254
const length = await Parse.EventuallyQueue.length();
258255

integration/test/ParseLiveQueryTest.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,15 @@ describe('Parse LiveQuery', () => {
112112
},
113113
sessionToken: undefined,
114114
};
115+
const openPromise = resolvingPromise();
116+
client.on('open', () => {
117+
if (client.state === 'reconnecting') {
118+
openPromise.resolve();
119+
}
120+
});
115121
await client.connectPromise;
116122
client.socket.send(JSON.stringify(subscribeRequest));
117-
await sleep(1000);
123+
await openPromise;
118124
expect(resubscribeSpy).toHaveBeenCalled();
119125
await client.close();
120126
});

integration/test/ParseLocalDatastoreTest.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function runTest(controller) {
2929

3030
describe(`Parse Object Pinning (${controller.name})`, () => {
3131
beforeEach(async () => {
32-
const StorageController = require(controller.file);
32+
const StorageController = require(controller.file).default;
3333
Parse.CoreManager.setAsyncStorage(mockRNStorage);
3434
Parse.CoreManager.setLocalDatastoreController(StorageController);
3535
Parse.CoreManager.setEventEmitter(require('events').EventEmitter);
@@ -1073,7 +1073,7 @@ function runTest(controller) {
10731073

10741074
describe(`Parse Query Pinning (${controller.name})`, () => {
10751075
beforeEach(async () => {
1076-
const StorageController = require(controller.file);
1076+
const StorageController = require(controller.file).default;
10771077
Parse.CoreManager.setAsyncStorage(mockRNStorage);
10781078
Parse.CoreManager.setLocalDatastoreController(StorageController);
10791079
Parse.CoreManager.setEventEmitter(require('events').EventEmitter);

integration/test/ParseReactNativeTest.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
const Parse = require('../../react-native');
44
const { resolvingPromise } = require('../../lib/react-native/promiseUtils');
5-
const CryptoController = require('../../lib/react-native/CryptoController');
6-
const LocalDatastoreController = require('../../lib/react-native/LocalDatastoreController.default');
7-
const StorageController = require('../../lib/react-native/StorageController.default');
8-
const RESTController = require('../../lib/react-native/RESTController');
5+
const CryptoController = require('../../lib/react-native/CryptoController').default;
6+
const LocalDatastoreController =
7+
require('../../lib/react-native/LocalDatastoreController.default').default;
8+
const StorageController = require('../../lib/react-native/StorageController.default').default;
9+
const RESTController = require('../../lib/react-native/RESTController').default;
910

1011
RESTController._setXHR(require('xmlhttprequest').XMLHttpRequest);
1112

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,37 @@
11
'use strict';
22

3-
const assert = require('assert');
4-
53
describe('ParseServer', () => {
64
it('can reconfigure server', async () => {
7-
const parseServer = await reconfigureServer({ serverURL: 'www.google.com' });
8-
assert.strictEqual(parseServer.config.serverURL, 'www.google.com');
9-
await parseServer.handleShutdown();
10-
await new Promise(resolve => parseServer.server.close(resolve));
11-
await reconfigureServer();
5+
let parseServer = await reconfigureServer({ serverURL: 'www.google.com' });
6+
expect(parseServer.config.serverURL).toBe('www.google.com');
7+
8+
await shutdownServer(parseServer);
9+
10+
parseServer = await reconfigureServer();
11+
expect(parseServer.config.serverURL).toBe('http://localhost:1337/parse');
1212
});
1313

1414
it('can shutdown', async () => {
15+
let close = 0;
1516
const parseServer = await reconfigureServer();
17+
parseServer.server.on('close', () => {
18+
close += 1;
19+
});
1620
const object = new TestObject({ foo: 'bar' });
17-
await parseServer.handleShutdown();
18-
await new Promise(resolve => parseServer.server.close(resolve));
21+
// Open a connection to the server
22+
const query = new Parse.Query(TestObject);
23+
await query.subscribe();
24+
expect(openConnections.size > 0).toBeTruthy();
25+
26+
await shutdownServer(parseServer);
27+
expect(close).toBe(1);
28+
expect(openConnections.size).toBe(0);
29+
1930
await expectAsync(object.save()).toBeRejectedWithError(
2031
'XMLHttpRequest failed: "Unable to connect to the Parse API"'
2132
);
2233
await reconfigureServer({});
2334
await object.save();
24-
assert(object.id);
35+
expect(object.id).toBeDefined();
2536
});
2637
});

0 commit comments

Comments
 (0)