Skip to content
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

feat: add support for Node 17 #7710

Closed
Closed
Show file tree
Hide file tree
Changes from all 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
7 changes: 6 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ jobs:
MONGODB_TOPOLOGY: standalone
MONGODB_STORAGE_ENGINE: wiredTiger
NODE_VERSION: 14.18.1
- name: Node 17
MONGODB_VERSION: 4.4.10
MONGODB_TOPOLOGY: standalone
MONGODB_STORAGE_ENGINE: wiredTiger
NODE_VERSION: 17.2.0
fail-fast: false
name: ${{ matrix.name }}
timeout-minutes: 15
Expand Down Expand Up @@ -221,7 +226,7 @@ jobs:
--health-retries 5
env:
PARSE_SERVER_TEST_DB: postgres
PARSE_SERVER_TEST_DATABASE_URI: postgres://postgres:postgres@localhost:5432/parse_server_postgres_adapter_test_database
PARSE_SERVER_TEST_DATABASE_URI: postgres://postgres:postgres@127.0.0.1:5432/parse_server_postgres_adapter_test_database
NODE_VERSION: ${{ matrix.NODE_VERSION }}
steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ Once you have babel running in watch mode, you can start making changes to parse

If your pull request introduces a change that may affect the storage or retrieval of objects, you may want to make sure it plays nice with Postgres.

* Run the tests against the postgres database with `PARSE_SERVER_TEST_DB=postgres PARSE_SERVER_TEST_DATABASE_URI=postgres://postgres:password@localhost:5432/parse_server_postgres_adapter_test_database npm run testonly`. You'll need to have postgres running on your machine and setup [appropriately](https://github.com/parse-community/parse-server/blob/master/scripts/before_script_postgres.sh) or use [`Docker`](#run-a-parse-postgres-with-docker).
* Run the tests against the postgres database with `PARSE_SERVER_TEST_DB=postgres PARSE_SERVER_TEST_DATABASE_URI=postgres://postgres:password@127.0.0.1:5432/parse_server_postgres_adapter_test_database npm run testonly`. You'll need to have postgres running on your machine and setup [appropriately](https://github.com/parse-community/parse-server/blob/master/scripts/before_script_postgres.sh) or use [`Docker`](#run-a-parse-postgres-with-docker).
* The Postgres adapter has a special debugger that traces all the sql commands. You can enable it with setting the environment variable `PARSE_SERVER_LOG_LEVEL=debug`
* If your feature is intended to only work with MongoDB, you should disable PostgreSQL-specific tests with:

Expand Down
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[![Coverage](https://img.shields.io/codecov/c/github/parse-community/parse-server/alpha.svg)](https://codecov.io/github/parse-community/parse-server?branch=alpha)
[![auto-release](https://img.shields.io/badge/%F0%9F%9A%80-auto--release-9e34eb.svg)](https://github.com/parse-community/parse-dashboard/releases)

[![Node Version](https://img.shields.io/badge/nodejs-12,_14,_16-green.svg?logo=node.js&style=flat)](https://nodejs.org)
[![Node Version](https://img.shields.io/badge/nodejs-12,_14,_16,_17-green.svg?logo=node.js&style=flat)](https://nodejs.org)
[![MongoDB Version](https://img.shields.io/badge/mongodb-4.0,_4.2,_4.4,_5.0-green.svg?logo=mongodb&style=flat)](https://www.mongodb.com)
[![Postgres Version](https://img.shields.io/badge/postgresql-11,_12,_13,_14-green.svg?logo=postgresql&style=flat)](https://www.postgresql.org)

Expand Down Expand Up @@ -117,7 +117,7 @@ Parse Server is continuously tested with the most recent releases of Node.js to
| Node.js 12 | 12.22.7 | April 2022 | ✅ Yes |
| Node.js 14 | 14.18.1 | April 2023 | ✅ Yes |
| Node.js 16 | 16.13.0 | April 2024 | ✅ Yes |
| Node.js 17 | 17.x | June 2022 | ❌ Not tested |
| Node.js 17 | 17.2.0 | June 2022 | ✅ Yes |

#### MongoDB
Parse Server is continuously tested with the most recent releases of MongoDB to ensure compatibility. We follow the [MongoDB support schedule](https://www.mongodb.com/support-policy) and only test against versions that are officially supported and have not reached their end-of-life date.
Expand All @@ -143,7 +143,7 @@ Parse Server is continuously tested with the most recent releases of PostgreSQL
```bash
$ npm install -g parse-server mongodb-runner
$ mongodb-runner start
$ parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://localhost/test
$ parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://127.0.0.1/test
```
***Note:*** *If installation with* `-g` *fails due to permission problems* (`npm ERR! code 'EACCES'`), *please refer to [this link](https://docs.npmjs.com/getting-started/fixing-npm-permissions).*

Expand Down Expand Up @@ -180,7 +180,7 @@ $ curl -X POST \
-H "X-Parse-Application-Id: APPLICATION_ID" \
-H "Content-Type: application/json" \
-d '{"score":1337,"playerName":"Sean Plott","cheatMode":false}' \
http://localhost:1337/parse/classes/GameScore
http://127.0.0.1:1337/parse/classes/GameScore
```

You should get a response similar to this:
Expand All @@ -197,7 +197,7 @@ You can now retrieve this object directly (make sure to replace `2ntvSpRGIK` wit
```bash
$ curl -X GET \
-H "X-Parse-Application-Id: APPLICATION_ID" \
http://localhost:1337/parse/classes/GameScore/2ntvSpRGIK
http://127.0.0.1:1337/parse/classes/GameScore/2ntvSpRGIK
```
```json
// Response
Expand All @@ -216,7 +216,7 @@ Keeping tracks of individual object ids is not ideal, however. In most cases you
```bash
$ curl -X GET \
-H "X-Parse-Application-Id: APPLICATION_ID" \
http://localhost:1337/parse/classes/GameScore
http://127.0.0.1:1337/parse/classes/GameScore
```
```json
// The response will provide all the matching objects within the `results` array:
Expand Down Expand Up @@ -270,12 +270,12 @@ var ParseServer = require('parse-server').ParseServer;
var app = express();

var api = new ParseServer({
databaseURI: 'mongodb://localhost:27017/dev', // Connection string for your MongoDB database
databaseURI: 'mongodb://127.0.0.1:27017/dev', // Connection string for your MongoDB database
cloud: './cloud/main.js', // Path to your Cloud Code
appId: 'myAppId',
masterKey: 'myMasterKey', // Keep this key secret!
fileKey: 'optionalFileKey',
serverURL: 'http://localhost:1337/parse' // Don't forget to change to https if needed
serverURL: 'http://127.0.0.1:1337/parse' // Don't forget to change to https if needed
});

// Serve the Parse API on the /parse URL prefix
Expand Down Expand Up @@ -783,10 +783,10 @@ The easiest way to run the Parse GraphQL API is through the CLI:
```bash
$ npm install -g parse-server mongodb-runner
$ mongodb-runner start
$ parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://localhost/test --publicServerURL http://localhost:1337/parse --mountGraphQL --mountPlayground
$ parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://127.0.0.1/test --publicServerURL http://127.0.0.1:1337/parse --mountGraphQL --mountPlayground
```

After starting the server, you can visit http://localhost:1337/playground in your browser to start playing with your GraphQL API.
After starting the server, you can visit http://127.0.0.1:1337/playground in your browser to start playing with your GraphQL API.

***Note:*** Do ***NOT*** use --mountPlayground option in production. [Parse Dashboard](https://github.com/parse-community/parse-dashboard) has a built-in GraphQL Playground and it is the recommended option for production apps.

Expand All @@ -804,12 +804,12 @@ $ docker run --name my-mongo -d mongo
#### Running the Parse Server Image <!-- omit in toc -->

```bash
$ docker run --name my-parse-server --link my-mongo:mongo -v config-vol:/parse-server/config -p 1337:1337 -d parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://mongo/test --publicServerURL http://localhost:1337/parse --mountGraphQL --mountPlayground
$ docker run --name my-parse-server --link my-mongo:mongo -v config-vol:/parse-server/config -p 1337:1337 -d parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://mongo/test --publicServerURL http://127.0.0.1:1337/parse --mountGraphQL --mountPlayground
```

***Note:*** *If you want to use [Cloud Code](https://docs.parseplatform.org/cloudcode/guide/), add `-v cloud-code-vol:/parse-server/cloud --cloud /parse-server/cloud/main.js` to the command above. Make sure `main.js` is in the `cloud-code-vol` directory before starting Parse Server.*

After starting the server, you can visit http://localhost:1337/playground in your browser to start playing with your GraphQL API.
After starting the server, you can visit http://127.0.0.1:1337/playground in your browser to start playing with your GraphQL API.

***Note:*** Do ***NOT*** use --mountPlayground option in production. [Parse Dashboard](https://github.com/parse-community/parse-dashboard) has a built-in GraphQL Playground and it is the recommended option for production apps.

Expand All @@ -832,11 +832,11 @@ const { default: ParseServer, ParseGraphQLServer } = require('parse-server');
const app = express();

const parseServer = new ParseServer({
databaseURI: 'mongodb://localhost:27017/test',
databaseURI: 'mongodb://127.0.0.1:27017/test',
appId: 'APPLICATION_ID',
masterKey: 'MASTER_KEY',
serverURL: 'http://localhost:1337/parse',
publicServerURL: 'http://localhost:1337/parse'
serverURL: 'http://127.0.0.1:1337/parse',
publicServerURL: 'http://127.0.0.1:1337/parse'
});

const parseGraphQLServer = new ParseGraphQLServer(
Expand All @@ -852,9 +852,9 @@ parseGraphQLServer.applyGraphQL(app); // Mounts the GraphQL API
parseGraphQLServer.applyPlayground(app); // (Optional) Mounts the GraphQL Playground - do NOT use in Production

app.listen(1337, function() {
console.log('REST API running on http://localhost:1337/parse');
console.log('GraphQL API running on http://localhost:1337/graphql');
console.log('GraphQL Playground running on http://localhost:1337/playground');
console.log('REST API running on http://127.0.0.1:1337/parse');
console.log('GraphQL API running on http://127.0.0.1:1337/graphql');
console.log('GraphQL Playground running on http://127.0.0.1:1337/playground');
});
```

Expand All @@ -865,7 +865,7 @@ $ npx mongodb-runner start
$ node index.js
```

After starting the app, you can visit http://localhost:1337/playground in your browser to start playing with your GraphQL API.
After starting the app, you can visit http://127.0.0.1:1337/playground in your browser to start playing with your GraphQL API.

***Note:*** Do ***NOT*** mount the GraphQL Playground in production. [Parse Dashboard](https://github.com/parse-community/parse-dashboard) has a built-in GraphQL Playground and it is the recommended option for production apps.

Expand Down Expand Up @@ -1045,7 +1045,7 @@ Parse GraphQL Server allows you to create a custom GraphQL schema with own queri
To start creating your custom schema, you need to code a `schema.graphql` file and initialize Parse Server with `--graphQLSchema` and `--cloud` options:

```bash
$ parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://localhost/test --publicServerURL http://localhost:1337/parse --cloud ./cloud/main.js --graphQLSchema ./cloud/schema.graphql --mountGraphQL --mountPlayground
$ parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://127.0.0.1/test --publicServerURL http://127.0.0.1:1337/parse --cloud ./cloud/main.js --graphQLSchema ./cloud/schema.graphql --mountGraphQL --mountPlayground
```

### Creating your first custom query <!-- omit in toc -->
Expand Down
2 changes: 1 addition & 1 deletion bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ npm install -s
CURL_CMD=$(cat << EOF
curl -X POST -H 'X-Parse-Application-Id: ${APP_ID}' \\
-H 'Content-Type: application/json' \\
-d '{"foo":"bar"}' http://localhost:1337/parse/classes/TestObject
-d '{"foo":"bar"}' http://127.0.0.1:1337/parse/classes/TestObject
EOF)

echo "\n${CHECK} Happy Parsing!\n\n"
Expand Down
2 changes: 1 addition & 1 deletion ci/ciCheck.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async function checkNodeVersions() {
'<12.0.0', // These versions have reached their end-of-life support date
'>=13.0.0 <14.0.0', // These versions have reached their end-of-life support date
'>=15.0.0 <16.0.0', // These versions have reached their end-of-life support date
'>=17.0.0', // These versions are not officially supported yet
marvinroger marked this conversation as resolved.
Show resolved Hide resolved
'>=18.0.0', // These versions are not officially supported yet
],
}).check();
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
"madge:circular": "node_modules/.bin/madge ./src --circular"
},
"engines": {
"node": ">=12.20.0 <17"
"node": ">=12.20.0 <18"
},
"bin": {
"parse-server": "bin/parse-server"
Expand Down
2 changes: 1 addition & 1 deletion scripts/before_script_postgres.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e

echo "[SCRIPT] Before Script :: Setup Parse DB for Postgres"

PGPASSWORD=postgres psql -v ON_ERROR_STOP=1 -h localhost -U postgres <<-EOSQL
PGPASSWORD=postgres psql -v ON_ERROR_STOP=1 -h 127.0.0.1 -U postgres <<-EOSQL
CREATE DATABASE parse_server_postgres_adapter_test_database;
\c parse_server_postgres_adapter_test_database;
CREATE EXTENSION pgcrypto;
Expand Down
2 changes: 1 addition & 1 deletion scripts/before_script_postgres_conf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ echo "[SCRIPT] Before Script :: Setup Parse Postgres configuration file"
# CPUs num: 1
# Data Storage: ssd

PGPASSWORD=postgres psql -v ON_ERROR_STOP=1 -h localhost -U postgres <<-EOSQL
PGPASSWORD=postgres psql -v ON_ERROR_STOP=1 -h 127.0.0.1 -U postgres <<-EOSQL
ALTER SYSTEM SET max_connections TO '200';
ALTER SYSTEM SET shared_buffers TO '1536MB';
ALTER SYSTEM SET effective_cache_size TO '4608MB';
Expand Down
10 changes: 5 additions & 5 deletions spec/AccountLockoutPolicy.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('Account Lockout Policy: ', () => {
it('account should not be locked even after failed login attempts if account lockout policy is not set', done => {
reconfigureServer({
appName: 'unlimited',
publicServerURL: 'http://localhost:1337/1',
publicServerURL: 'http://127.0.0.1:1337/1',
})
.then(() => {
const user = new Parse.User();
Expand Down Expand Up @@ -236,7 +236,7 @@ describe('Account Lockout Policy: ', () => {
duration: 1,
threshold: 2,
},
publicServerURL: 'http://localhost:8378/1',
publicServerURL: 'http://127.0.0.1:8378/1',
})
.then(() => {
const user = new Parse.User();
Expand Down Expand Up @@ -269,7 +269,7 @@ describe('Account Lockout Policy: ', () => {
duration: 0.05, // 0.05*60 = 3 secs
threshold: 2,
},
publicServerURL: 'http://localhost:8378/1',
publicServerURL: 'http://127.0.0.1:8378/1',
})
.then(() => {
const user = new Parse.User();
Expand Down Expand Up @@ -306,7 +306,7 @@ describe('Account Lockout Policy: ', () => {
duration: 0.05, // 0.05*60 = 3 secs
threshold: 2,
},
publicServerURL: 'http://localhost:8378/1',
publicServerURL: 'http://127.0.0.1:8378/1',
})
.then(() => {
const user = new Parse.User();
Expand Down Expand Up @@ -357,7 +357,7 @@ describe('lockout with password reset option', () => {
const config = {
appName: 'exampleApp',
accountLockout: accountLockout,
publicServerURL: 'http://localhost:8378/1',
publicServerURL: 'http://127.0.0.1:8378/1',
emailAdapter: {
sendVerificationEmail: () => Promise.resolve(),
sendPasswordResetEmail: () => Promise.resolve(),
Expand Down
4 changes: 2 additions & 2 deletions spec/AudienceRouter.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,12 +399,12 @@ describe('AudiencesRouter', () => {
await reconfigureServer({
appId: 'test',
restAPIKey: 'test',
publicServerURL: 'http://localhost:8378/1',
publicServerURL: 'http://127.0.0.1:8378/1',
});
try {
await request({
method: 'POST',
url: 'http://localhost:8378/1/classes/_Audience',
url: 'http://127.0.0.1:8378/1/classes/_Audience',
body: { lorem: 'ipsum', _method: 'POST' },
headers: {
'X-Parse-Application-Id': 'test',
Expand Down
6 changes: 4 additions & 2 deletions spec/AuthenticationAdapters.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ describe('AuthenticationProviders', function () {
'X-Parse-Session-Token': token,
'Content-Type': 'application/json',
},
url: 'http://localhost:8378/1/users',
url: 'http://127.0.0.1:8378/1/users',
body: jsonBody,
};
return request(options)
Expand Down Expand Up @@ -1722,7 +1722,9 @@ describe('Apple Game Center Auth adapter', () => {
await gcenter.validateAuthData(authData);
fail();
} catch (e) {
expect(e.message).toBe('Apple Game Center - invalid publicKeyUrl: http://static.gc.apple.com/public-key/gc-prod-4.cer');
expect(e.message).toBe(
'Apple Game Center - invalid publicKeyUrl: http://static.gc.apple.com/public-key/gc-prod-4.cer'
);
}
});
});
Expand Down
6 changes: 3 additions & 3 deletions spec/CLI.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ describe('execution', () => {
'--masterKey',
'test',
'--databaseURI',
'mongodb://localhost/test',
'mongodb://127.0.0.1/test',
'--port',
'1339',
]);
Expand All @@ -248,7 +248,7 @@ describe('execution', () => {
'--masterKey',
'test',
'--databaseURI',
'mongodb://localhost/test',
'mongodb://127.0.0.1/test',
'--port',
'1340',
'--mountGraphQL',
Expand All @@ -274,7 +274,7 @@ describe('execution', () => {
'--masterKey',
'test',
'--databaseURI',
'mongodb://localhost/test',
'mongodb://127.0.0.1/test',
'--port',
'1341',
'--mountGraphQL',
Expand Down
Loading