Skip to content

Commit 40bfc67

Browse files
committed
Merge remote-tracking branch 'upstream/alpha' into alpha
2 parents cc57d34 + 6b48462 commit 40bfc67

File tree

181 files changed

+15644
-16883
lines changed

Some content is hidden

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

181 files changed

+15644
-16883
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,10 @@ jobs:
2727
with:
2828
cache: npm
2929
- run: npm ci
30-
- name: Build Types
31-
run: npm run build:types
30+
- name: Type Definition Check
31+
run: npm run ci:typecheck
3232
- name: Test Types
3333
run: npm run test:types
34-
- name: Lint Types
35-
run: npm run lint:types
3634
check-docs:
3735
name: Check Docs
3836
timeout-minutes: 10
@@ -96,7 +94,9 @@ jobs:
9694
node-version: ${{ matrix.NODE_VERSION }}
9795
cache: npm
9896
- run: npm ci
99-
- run: npm test -- --maxWorkers=4
97+
# Run unit tests
98+
- run: npm test -- --maxWorkers=4
99+
# Run integration tests
100100
- run: npm run test:mongodb
101101
env:
102102
CI: true
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 }}

.husky/pre-commit

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

.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
types/tests.ts
2+
types/eslint.config.mjs

.prettierrc

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

CONTRIBUTING.md

Lines changed: 58 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,116 +1,114 @@
1-
# Contributing to the Parse JavaScript SDK
1+
# Contributing to the Parse JavaScript SDK <!-- omit in toc -->
22

3-
We want to make contributing to this project as easy and transparent as possible.
3+
- [Preparation for Contributing](#preparation-for-contributing)
4+
- [Recommended Tools](#recommended-tools)
5+
- [Set-up Your Local Machine](#set-up-your-local-machine)
6+
- [Building the SDK](#building-the-sdk)
7+
- [Testing](#testing)
8+
- [Unit Tests](#unit-tests)
9+
- [Integration Tests](#integration-tests)
10+
- [TypeScript Tests](#typescript-tests)
11+
- [Pull Requests](#pull-requests)
12+
- [Issues](#issues)
13+
- [Known Issues](#known-issues)
14+
- [Report New Issue](#report-new-issue)
15+
- [Security Bugs](#security-bugs)
16+
- [Coding Style](#coding-style)
17+
- [Code of Conduct](#code-of-conduct)
418

5-
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.
19+
We want to make contributing to this project as easy and transparent as possible. If you're looking to get started, but want to ease yourself into the codebase, look for [open issues](https://github.com/parse-community/Parse-SDK-JS/issues).
620

7-
## `master` is unsafe
21+
## Preparation for Contributing
822

9-
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.
23+
### Recommended Tools
1024

11-
## Setting up the project for debugging and contributing:
25+
- [Visual Studio Code](https://code.visualstudio.com), a popular IDE.
26+
- [Jest Extension](https://marketplace.visualstudio.com/items?itemName=Orta.vscode-jest) the Jest extension for VSC to run the tests inline and debug quicky.
27+
- [Jasmine Test Explorer Extension](https://marketplace.visualstudio.com/items?itemName=hbenl.vscode-test-explorer), a very practical test exploration plugin which let you run, debug and see the test results inline.
28+
- [mongodb-runner](https://github.com/mongodb-js/runner) Easily install and run MongoDB to test your code against it. Install with `npm install -g mongodb-runner`.
1229

13-
### Recommended setup:
30+
### Set-up Your Local Machine
1431

15-
* [vscode](https://code.visualstudio.com), the popular IDE.
16-
* [Jest Extension](https://marketplace.visualstudio.com/items?itemName=Orta.vscode-jest) the Jest extension for vscode to run the tests inline and debug quicky.
17-
* [Jasmine Test Explorer Extension](https://marketplace.visualstudio.com/items?itemName=hbenl.vscode-test-explorer), a very practical test exploration plugin which let you run, debug and see the test results inline.
18-
* [mongodb-runner](https://github.com/mongodb-js/runner) Easily install and run MongoDB to test your code against it. (install with `npm install -g mongodb-runner`)
19-
20-
### Setting up you local machine:
21-
22-
* [Fork](https://github.com/parse-community/Parse-SDK-JS) this project and clone the fork on your local machine:
32+
- [Fork](https://github.com/parse-community/Parse-SDK-JS) this repository and clone it on your local machine:
2333

2434
```sh
2535
$ git clone https://github.com/parse-community/Parse-SDK-JS
26-
$ cd Parse-SDK-JS # go into the clone directory
27-
$ npm install # install all the node dependencies
28-
$ code . # launch vscode
36+
$ cd Parse-SDK-JS
37+
$ npm install
38+
$ code .
2939
```
3040

3141
### Building the SDK
3242

3343
The Parse JS SDK is built for three platforms:
3444

35-
- The browser
36-
- nodejs
37-
- react-native
38-
39-
When developing the SDK you can use `npm run watch` in order to rebuild your changes upon each save.
45+
- Browser
46+
- NodeJS
47+
- React Native
4048

41-
By default, the watch command will rebuild the SDK for the browser platform. The following commands will rebuild changes for a specific platform.
49+
When developing the SDK run `npm run watch` in order to rebuild your changes automatically upon each save. By default, the watch command will rebuild the SDK only for the browser platform. The following commands will rebuild changes for a specific platform:
4250

4351
- `npm run watch:node`
4452
- `npm run watch:browser`
4553
- `npm run watch:react-native`
4654

47-
### Testing the code
55+
### Testing
4856

49-
The SDK is tested through two lenses. unit tests are run with jest and integration tests with jasmine.
57+
The SDK is tested through two lenses. unit tests are run with jest and integration tests with jasmine. Two different frameworks are used as the integration tests leverage a stateful server, with the data saved into the database, and Jest is running many tests in parallel, which makes it incompatible with our integration tests.
5058

51-
Two different frameworks are used as the integration tests leverage a stateful server, with the data saved into the database, and Jest is running many tests in parallel, which makes it incompatible with our integration tests.
52-
53-
#### Unit tests
59+
#### Unit Tests
5460

5561
Those tests are located in [/src/\_\_tests\_\_](/src/__tests__) and are responsible for ensuring each class is behaving as expected, without considering the rest of the system. For example, adding a new query helper function would probably require to add relevant tests that ensure the query is properly serialized to a valid Parse REST query object. Unit tests heavily leverage mocking and are an essential part of our testing harness.
5662

5763
To run unit tests, run `npm test`. If you have the vscode Jest plugin extension (as recommended), you can run your tests by clicking the *Debug* lens that appears near by the test.
5864

59-
#### Integration tests
65+
#### Integration Tests
6066

6167
Those tests are located in [/integration/test](/integration/test) and are responsible for ensuring a proper communication with parse-server. With the integration tests, we ensure all communications between the SDK and the server are behaving accordingly.
6268

6369
To run the integration tests, you will need a valid mongodb running on your local machine. You can get easily mongodb running with `mongodb-runner` (see [Recommended setup](#recommended-setup)).
6470

6571
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.
6672

73+
#### TypeScript Tests
74+
75+
Type tests are located in [/types/tests.ts](/types/tests.ts) and are responsible for ensure types generated for each class is behaving as expected. Types must be generated using `npm run build:types` and should not be manually changed. These types are `.d.ts` files located in [/types](/types).
76+
77+
When developing type definitions you can use `npm run watch:ts` in order to rebuild your changes automatically upon each save.
78+
79+
Use `npm run test:types` in order to run types tests against generated `.d.ts` files.
80+
6781
### Pull Requests
6882

69-
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.
83+
We appreciate your contribution and welcome your pull requests. When submitting a pull request, the CI will run some automated tests on it. From here, we'll need to get a core member to sign off on the changes and then merge the pull request. We'll do our best to provide updates and feedback throughout the process.
7084

71-
1. Fork the repo and create your branch from `master`.
85+
1. Fork the repo and create your branch from `alpha`.
7286
2. Add unit tests for any new code you add.
73-
3. If you've changed APIs, update the documentation.
74-
4. Ensure the test suite passes. (run `npm test && npm run integration`)
75-
5. Make sure your code lints.
87+
3. If you've changed public APIs, update the documentation.
88+
4. Ensure the test suite passes by running `npm test && npm run integration`.
89+
5. Make sure your code lints by running `npm run lint`.
90+
91+
## Issues
7692

7793
### Known Issues
7894

7995
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.
8096

81-
### Reporting New Issues
97+
### Report New Issue
8298

83-
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].
84-
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.
85-
86-
Details are key. The more information you provide us the easier it'll be for us to debug and the faster you'll receive a fix. Some examples of useful tidbits:
87-
88-
* A description. What did you expect to happen and what actually happened? Why do you think that was wrong?
89-
* A simple unit test that fails. Refer [here][tests-dir] for examples of existing unit tests and [here][integration-test-dir] for integration tests examples. See for how to setup your machine and run unit tests in [this](#setting-up-the-project-for-debugging-and-contributing) guide. You can submit a pull request with your failing unit test so that our CI verifies that the test fails.
90-
* What version does this reproduce on? What version did it last work on?
91-
* [Stacktrace or GTFO][stacktrace-or-gtfo]. In all honesty, full stacktraces with line numbers make a happy developer.
92-
* Anything else you find relevant.
99+
If you're unsure whether your bug is with the Pare JS SDK or Parse Server, you can test to see if it reproduces with the Parse Server [REST API](https://docs.parseplatform.org/rest/guide).
93100

94101
### Security Bugs
95102

96103
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.
97104

98105
## Coding Style
99106

100-
* Most importantly, match the existing code style as much as possible.
101-
* We use ES6 for this codebase. Use modern syntax whenever possible.
102-
* Keep lines within 80 characters.
103-
* Always end lines with semicolons.
107+
- Most importantly, match the existing code style as much as possible.
108+
- We use ES6 for this codebase. Use modern syntax whenever possible.
109+
- Keep lines within 80 characters.
110+
- Always end lines with semicolons.
104111

105-
### Code of Conduct
112+
## Code of Conduct
106113

107114
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.
108-
109-
[google-group]: https://groups.google.com/forum/#!forum/parse-developers
110-
[stack-overflow]: http://stackoverflow.com/tags/parse-server
111-
[bug-reports]: https://github.com/parse-community/parse-server/issues
112-
[rest-api]: https://docs.parseplatform.org/rest/guide
113-
[parse-api-console]: http://blog.parseplatform.org/announcements/introducing-the-parse-api-console/
114-
[stacktrace-or-gtfo]: http://i.imgur.com/jacoj.jpg
115-
[tests-dir]: /src/__tests__
116-
[integration-test-dir]: /integration/test

README.md

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,15 @@
22

33
---
44

5-
[![Build Status CI alpha](https://github.com/parse-community/Parse-SDK-JS/workflows/ci/badge.svg?branch=alpha&subject=alpha)](https://github.com/parse-community/Parse-SDK-JS/actions?query=workflow%3Aci+branch%3Aalpha)
6-
[![Build Status CI beta](https://github.com/parse-community/Parse-SDK-JS/workflows/ci/badge.svg?branch=beta)](https://github.com/parse-community/Parse-SDK-JS/actions?query=workflow%3Aci+branch%3Abeta)
7-
[![Build Status CI release](https://github.com/parse-community/Parse-SDK-JS/workflows/ci/badge.svg?branch=release)](https://github.com/parse-community/Parse-SDK-JS/actions?query=workflow%3Aci+branch%3Arelease)
5+
[![Build Status CI alpha](https://github.com/parse-community/Parse-SDK-JS/actions/workflows/ci.yml/badge.svg?branch=alpha&subject=alpha)](https://github.com/parse-community/Parse-SDK-JS/actions?query=workflow%3Aci+branch%3Aalpha)
6+
[![Build Status CI release](https://github.com/parse-community/Parse-SDK-JS/actions/workflows/ci.yml/badge.svg?branch=release)](https://github.com/parse-community/Parse-SDK-JS/actions?query=workflow%3Aci+branch%3Arelease)
87
[![Snyk Badge](https://snyk.io/test/github/parse-community/Parse-SDK-JS/badge.svg)](https://snyk.io/test/github/parse-community/Parse-SDK-JS)
9-
[![Coverage](http://codecov.io/github/parse-community/Parse-SDK-JS/coverage.svg?branch=alpha)](http://codecov.io/github/parse-community/Parse-SDK-JS?branch=alpha)
8+
[![Coverage](https://codecov.io/gh/parse-community/Parse-SDK-JS/branch/alpha/graph/badge.svg)](https://codecov.io/gh/parse-community/Parse-SDK-JS)
109

1110
[![Node Version](https://img.shields.io/badge/nodejs-18,_20,_22-green.svg?logo=node.js&style=flat)](https://nodejs.org/)
1211
[![auto-release](https://img.shields.io/badge/%F0%9F%9A%80-auto--release-9e34eb.svg)](https://github.com/parse-community/parse-dashboard/releases)
1312

1413
[![npm latest version](https://img.shields.io/npm/v/parse/latest.svg)](https://www.npmjs.com/package/parse)
15-
[![npm beta version](https://img.shields.io/npm/v/parse/beta.svg)](https://www.npmjs.com/package/parse)
1614
[![npm alpha version](https://img.shields.io/npm/v/parse/alpha.svg)](https://www.npmjs.com/package/parse)
1715

1816
[![Backers on Open Collective](https://opencollective.com/parse-server/backers/badge.svg)][open-collective-link]
@@ -104,16 +102,9 @@ const Parse = require('parse/weapp');
104102
```
105103
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).
106104

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

116-
The SDK has a [Core Manager](src/CoreManager.ts) 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](src/CoreManager.ts).
107+
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].
117108

118109
```js
119110
// Configuration example
@@ -144,7 +135,7 @@ We really want Parse to be yours, to see it grow and thrive in the open source c
144135

145136
[3rd-party-auth]: http://docs.parseplatform.org/parse-server/guide/#oauth-and-3rd-party-authentication
146137
[contributing]: https://github.com/parse-community/Parse-SDK-JS/blob/master/CONTRIBUTING.md
138+
[core-manager]: https://github.com/parse-community/Parse-SDK-JS/blob/alpha/src/CoreManager.ts
147139
[custom-auth-module]: https://docs.parseplatform.org/js/guide/#custom-authentication-module
148140
[link-with]: https://docs.parseplatform.org/js/guide/#linking-users
149141
[open-collective-link]: https://opencollective.com/parse-server
150-
[types-parse]: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/parse

0 commit comments

Comments
 (0)