From ae011c4d83e97931dcd1fc531246678d0543c5ca Mon Sep 17 00:00:00 2001 From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com> Date: Tue, 9 Jul 2024 02:30:17 +0200 Subject: [PATCH 01/13] add node 22 --- .github/workflows/ci.yml | 18 +++++++++++------- README.md | 23 ++++++++++++----------- package-lock.json | 2 +- package.json | 2 +- 4 files changed, 25 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe8ade4399..4737e37cf3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -143,32 +143,36 @@ jobs: - name: MongoDB 4.2, ReplicaSet MONGODB_VERSION: 4.2.25 MONGODB_TOPOLOGY: replset - NODE_VERSION: 20.12.0 + NODE_VERSION: 22 - name: MongoDB 4.4, ReplicaSet MONGODB_VERSION: 4.4.29 MONGODB_TOPOLOGY: replset - NODE_VERSION: 20.12.0 + NODE_VERSION: 22 - name: MongoDB 5, ReplicaSet MONGODB_VERSION: 5.0.26 MONGODB_TOPOLOGY: replset - NODE_VERSION: 20.12.0 + NODE_VERSION: 22 - name: MongoDB 6, ReplicaSet MONGODB_VERSION: 6.0.14 MONGODB_TOPOLOGY: replset - NODE_VERSION: 20.12.0 + NODE_VERSION: 22 - name: MongoDB 7, ReplicaSet MONGODB_VERSION: 7.0.8 MONGODB_TOPOLOGY: replset - NODE_VERSION: 20.12.0 + NODE_VERSION: 22 - name: Redis Cache PARSE_SERVER_TEST_CACHE: redis MONGODB_VERSION: 7.0.8 MONGODB_TOPOLOGY: standalone - NODE_VERSION: 20.12.0 + NODE_VERSION: 22 - name: Node 18 MONGODB_VERSION: 7.0.8 MONGODB_TOPOLOGY: standalone - NODE_VERSION: 18.20.0 + NODE_VERSION: 18 + - name: Node 20 + MONGODB_VERSION: 7.0.8 + MONGODB_TOPOLOGY: standalone + NODE_VERSION: 20 fail-fast: false name: ${{ matrix.name }} timeout-minutes: 15 diff --git a/README.md b/README.md index c44c620a8f..1b543edd61 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ [![Coverage](https://codecov.io/github/parse-community/parse-server/branch/alpha/graph/badge.svg)](https://app.codecov.io/github/parse-community/parse-server/tree/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-18,_20-green.svg?logo=node.js&style=flat)](https://nodejs.org) +[![Node Version](https://img.shields.io/badge/nodejs-18,_20,_22-green.svg?logo=node.js&style=flat)](https://nodejs.org) [![MongoDB Version](https://img.shields.io/badge/mongodb-4.2,_4.4,_5,_6,_7-green.svg?logo=mongodb&style=flat)](https://www.mongodb.com) [![Postgres Version](https://img.shields.io/badge/postgresql-13,_14,_15,_16-green.svg?logo=postgresql&style=flat)](https://www.postgresql.org) @@ -127,22 +127,23 @@ Before you start make sure you have installed: Parse Server is continuously tested with the most recent releases of Node.js to ensure compatibility. We follow the [Node.js Long Term Support plan](https://github.com/nodejs/Release) and only test against versions that are officially supported and have not reached their end-of-life date. -| Version | Latest Version | End-of-Life | Compatible | -|------------|----------------|-------------|------------| -| Node.js 18 | 18.20.0 | April 2025 | ✅ Yes | -| Node.js 20 | 20.12.0 | April 2026 | ✅ Yes | +| Version | End-of-Life | Compatible | +|------------|-------------|------------| +| Node.js 18 | April 2025 | ✅ Yes | +| Node.js 20 | April 2026 | ✅ Yes | +| Node.js 22 | April 2027 | ✅ 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 [MongoDB lifecycle schedule](https://www.mongodb.com/support-policy/lifecycles) and only test against versions that are officially supported and have not reached their end-of-life date. MongoDB "rapid releases" are ignored as these are considered pre-releases of the next major version. | Version | Latest Version | End-of-Life | Compatible | -| ----------- | -------------- | ------------- | ---------- | -| MongoDB 4.2 | 4.2.25 | April 2023 | ✅ Yes | -| MongoDB 4.4 | 4.4.29 | February 2024 | ✅ Yes | -| MongoDB 5 | 5.0.26 | October 2024 | ✅ Yes | -| MongoDB 6 | 6.0.14 | July 2025 | ✅ Yes | -| MongoDB 7 | 7.0.8 | TDB | ✅ Yes | +|-------------|----------------|---------------|------------| +| MongoDB 4.2 | 4.2.25 | April 2023 | ✅ Yes | +| MongoDB 4.4 | 4.4.29 | February 2024 | ✅ Yes | +| MongoDB 5 | 5.0.26 | October 2024 | ✅ Yes | +| MongoDB 6 | 6.0.14 | July 2025 | ✅ Yes | +| MongoDB 7 | 7.0.8 | TDB | ✅ Yes | #### PostgreSQL diff --git a/package-lock.json b/package-lock.json index 35eb3cfc1e..f197380662 100644 --- a/package-lock.json +++ b/package-lock.json @@ -102,7 +102,7 @@ "yaml": "1.10.0" }, "engines": { - "node": ">=18.0.0 <21" + "node": "18 || 19 || 20 || 22" }, "funding": { "type": "opencollective", diff --git a/package.json b/package.json index c907daf72e..717a7fe3c7 100644 --- a/package.json +++ b/package.json @@ -138,7 +138,7 @@ "madge:circular": "node_modules/.bin/madge ./src --circular" }, "engines": { - "node": ">=18.0.0 <21" + "node": "18 || 19 || 20 || 22" }, "bin": { "parse-server": "bin/parse-server" From c84ff2e86fc51f1db6dd062019f0cc66a4b8f943 Mon Sep 17 00:00:00 2001 From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com> Date: Tue, 9 Jul 2024 02:48:56 +0200 Subject: [PATCH 02/13] replace punycode --- package-lock.json | 73 ++++++++++++---------------------------- package.json | 1 + src/vendor/mongodbUrl.js | 2 +- 3 files changed, 24 insertions(+), 52 deletions(-) diff --git a/package-lock.json b/package-lock.json index f197380662..a566cc9c5b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -45,6 +45,7 @@ "pg-monitor": "2.0.0", "pg-promise": "11.7.8", "pluralize": "8.0.0", + "punycode": "2.3.1", "rate-limit-redis": "4.2.0", "redis": "4.6.13", "semver": "7.6.0", @@ -13534,15 +13535,6 @@ "webidl-conversions": "^3.0.0" } }, - "node_modules/mongodb-runner/node_modules/punycode": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/mongodb-runner/node_modules/tr46": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/tr46/-/tr46-4.1.1.tgz", @@ -18026,9 +18018,12 @@ } }, "node_modules/punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==" + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "engines": { + "node": ">=6" + } }, "node_modules/qs": { "version": "6.11.0", @@ -20426,6 +20421,11 @@ "node": ">=0.8" } }, + "node_modules/tough-cookie/node_modules/punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==" + }, "node_modules/tr46": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", @@ -20437,14 +20437,6 @@ "node": ">=12" } }, - "node_modules/tr46/node_modules/punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "engines": { - "node": ">=6" - } - }, "node_modules/traverse": { "version": "0.6.7", "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.7.tgz", @@ -20831,14 +20823,6 @@ "punycode": "^2.1.0" } }, - "node_modules/uri-js/node_modules/punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "engines": { - "node": ">=6" - } - }, "node_modules/url-join": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/url-join/-/url-join-5.0.0.tgz", @@ -31317,12 +31301,6 @@ } } }, - "punycode": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "dev": true - }, "tr46": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/tr46/-/tr46-4.1.1.tgz", @@ -34465,9 +34443,9 @@ } }, "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==" + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==" }, "qs": { "version": "6.11.0", @@ -36222,6 +36200,13 @@ "requires": { "psl": "^1.1.24", "punycode": "^1.4.1" + }, + "dependencies": { + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==" + } } }, "tr46": { @@ -36230,13 +36215,6 @@ "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==", "requires": { "punycode": "^2.1.1" - }, - "dependencies": { - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" - } } }, "traverse": { @@ -36509,13 +36487,6 @@ "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "requires": { "punycode": "^2.1.0" - }, - "dependencies": { - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" - } } }, "url-join": { diff --git a/package.json b/package.json index 717a7fe3c7..ce3d57f31c 100644 --- a/package.json +++ b/package.json @@ -54,6 +54,7 @@ "pg-monitor": "2.0.0", "pg-promise": "11.7.8", "pluralize": "8.0.0", + "punycode": "2.3.1", "rate-limit-redis": "4.2.0", "redis": "4.6.13", "semver": "7.6.0", diff --git a/src/vendor/mongodbUrl.js b/src/vendor/mongodbUrl.js index 2aa422a9cd..b12a80544f 100644 --- a/src/vendor/mongodbUrl.js +++ b/src/vendor/mongodbUrl.js @@ -5,7 +5,7 @@ 'use strict'; -const punycode = require('punycode'); +const punycode = require('punycode/'); exports.parse = urlParse; exports.resolve = urlResolve; From 091bce7b1ed8b784c3aea7a1a2c75cf9610e64a7 Mon Sep 17 00:00:00 2001 From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com> Date: Tue, 9 Jul 2024 03:08:03 +0200 Subject: [PATCH 03/13] fit --- spec/CLI.spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/CLI.spec.js b/spec/CLI.spec.js index 9cec0e77b3..dc1ecf6843 100644 --- a/spec/CLI.spec.js +++ b/spec/CLI.spec.js @@ -204,7 +204,7 @@ describe('LiveQuery definitions', () => { }); }); -describe('execution', () => { +fdescribe('execution', () => { const binPath = path.resolve(__dirname, '../bin/parse-server'); let childProcess; @@ -220,7 +220,7 @@ describe('execution', () => { it('should start Parse Server', done => { const env = { ...process.env }; - env.NODE_OPTIONS = '--dns-result-order=ipv4first'; + // env.NODE_OPTIONS = '--dns-result-order=ipv4first'; childProcess = spawn( binPath, ['--appId', 'test', '--masterKey', 'test', '--databaseURI', databaseURI, '--port', '1339'], From 4e947bcb85c99fe0e7c90012cf72b1fa4ca6b3fe Mon Sep 17 00:00:00 2001 From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com> Date: Tue, 9 Jul 2024 11:25:36 +0200 Subject: [PATCH 04/13] remove ipv4 --- spec/CLI.spec.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/spec/CLI.spec.js b/spec/CLI.spec.js index dc1ecf6843..c9f6dd8140 100644 --- a/spec/CLI.spec.js +++ b/spec/CLI.spec.js @@ -220,7 +220,6 @@ fdescribe('execution', () => { it('should start Parse Server', done => { const env = { ...process.env }; - // env.NODE_OPTIONS = '--dns-result-order=ipv4first'; childProcess = spawn( binPath, ['--appId', 'test', '--masterKey', 'test', '--databaseURI', databaseURI, '--port', '1339'], @@ -239,7 +238,6 @@ fdescribe('execution', () => { it('should start Parse Server with GraphQL', async done => { const env = { ...process.env }; - env.NODE_OPTIONS = '--dns-result-order=ipv4first'; childProcess = spawn( binPath, [ @@ -271,7 +269,6 @@ fdescribe('execution', () => { it('should start Parse Server with GraphQL and Playground', async done => { const env = { ...process.env }; - env.NODE_OPTIONS = '--dns-result-order=ipv4first'; childProcess = spawn( binPath, [ @@ -305,7 +302,6 @@ fdescribe('execution', () => { it('can start Parse Server with auth via CLI', done => { const env = { ...process.env }; - env.NODE_OPTIONS = '--dns-result-order=ipv4first'; childProcess = spawn( binPath, ['--databaseURI', databaseURI, './spec/configs/CLIConfigAuth.json'], From 1e020859fa001f9b380c1a48258b6c8b5a9c2303 Mon Sep 17 00:00:00 2001 From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com> Date: Tue, 9 Jul 2024 11:27:54 +0200 Subject: [PATCH 05/13] Revert "remove ipv4" This reverts commit 4e947bcb85c99fe0e7c90012cf72b1fa4ca6b3fe. --- spec/CLI.spec.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spec/CLI.spec.js b/spec/CLI.spec.js index c9f6dd8140..dc1ecf6843 100644 --- a/spec/CLI.spec.js +++ b/spec/CLI.spec.js @@ -220,6 +220,7 @@ fdescribe('execution', () => { it('should start Parse Server', done => { const env = { ...process.env }; + // env.NODE_OPTIONS = '--dns-result-order=ipv4first'; childProcess = spawn( binPath, ['--appId', 'test', '--masterKey', 'test', '--databaseURI', databaseURI, '--port', '1339'], @@ -238,6 +239,7 @@ fdescribe('execution', () => { it('should start Parse Server with GraphQL', async done => { const env = { ...process.env }; + env.NODE_OPTIONS = '--dns-result-order=ipv4first'; childProcess = spawn( binPath, [ @@ -269,6 +271,7 @@ fdescribe('execution', () => { it('should start Parse Server with GraphQL and Playground', async done => { const env = { ...process.env }; + env.NODE_OPTIONS = '--dns-result-order=ipv4first'; childProcess = spawn( binPath, [ @@ -302,6 +305,7 @@ fdescribe('execution', () => { it('can start Parse Server with auth via CLI', done => { const env = { ...process.env }; + env.NODE_OPTIONS = '--dns-result-order=ipv4first'; childProcess = spawn( binPath, ['--databaseURI', databaseURI, './spec/configs/CLIConfigAuth.json'], From e38ccf80c311b607937da3cc5b5875da157345fa Mon Sep 17 00:00:00 2001 From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com> Date: Tue, 9 Jul 2024 11:29:53 +0200 Subject: [PATCH 06/13] re-add ipv4 --- spec/CLI.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/CLI.spec.js b/spec/CLI.spec.js index dc1ecf6843..5d6c5f55c6 100644 --- a/spec/CLI.spec.js +++ b/spec/CLI.spec.js @@ -220,7 +220,7 @@ fdescribe('execution', () => { it('should start Parse Server', done => { const env = { ...process.env }; - // env.NODE_OPTIONS = '--dns-result-order=ipv4first'; + env.NODE_OPTIONS = '--dns-result-order=ipv4first'; childProcess = spawn( binPath, ['--appId', 'test', '--masterKey', 'test', '--databaseURI', databaseURI, '--port', '1339'], From cb2645a1b560566a1bea0be7430c6642fd77913b Mon Sep 17 00:00:00 2001 From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com> Date: Tue, 9 Jul 2024 11:30:00 +0200 Subject: [PATCH 07/13] Update mongodbUrl.js --- src/vendor/mongodbUrl.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vendor/mongodbUrl.js b/src/vendor/mongodbUrl.js index b12a80544f..381e98521b 100644 --- a/src/vendor/mongodbUrl.js +++ b/src/vendor/mongodbUrl.js @@ -5,7 +5,8 @@ 'use strict'; -const punycode = require('punycode/'); +// const punycode = require('punycode/'); +import punycode from 'punycode/punycode.js' exports.parse = urlParse; exports.resolve = urlResolve; From 3d8f9c06e43819ace153a2ba7a183aed6ba95293 Mon Sep 17 00:00:00 2001 From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com> Date: Tue, 9 Jul 2024 11:35:55 +0200 Subject: [PATCH 08/13] Update CLI.spec.js --- spec/CLI.spec.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/CLI.spec.js b/spec/CLI.spec.js index 5d6c5f55c6..87320980fa 100644 --- a/spec/CLI.spec.js +++ b/spec/CLI.spec.js @@ -220,7 +220,7 @@ fdescribe('execution', () => { it('should start Parse Server', done => { const env = { ...process.env }; - env.NODE_OPTIONS = '--dns-result-order=ipv4first'; + env.NODE_OPTIONS = '--dns-result-order=ipv4first --trace-deprecation'; childProcess = spawn( binPath, ['--appId', 'test', '--masterKey', 'test', '--databaseURI', databaseURI, '--port', '1339'], @@ -239,7 +239,7 @@ fdescribe('execution', () => { it('should start Parse Server with GraphQL', async done => { const env = { ...process.env }; - env.NODE_OPTIONS = '--dns-result-order=ipv4first'; + env.NODE_OPTIONS = '--dns-result-order=ipv4first --trace-deprecation'; childProcess = spawn( binPath, [ @@ -271,7 +271,7 @@ fdescribe('execution', () => { it('should start Parse Server with GraphQL and Playground', async done => { const env = { ...process.env }; - env.NODE_OPTIONS = '--dns-result-order=ipv4first'; + env.NODE_OPTIONS = '--dns-result-order=ipv4first --trace-deprecation'; childProcess = spawn( binPath, [ @@ -305,7 +305,7 @@ fdescribe('execution', () => { it('can start Parse Server with auth via CLI', done => { const env = { ...process.env }; - env.NODE_OPTIONS = '--dns-result-order=ipv4first'; + env.NODE_OPTIONS = '--dns-result-order=ipv4first --trace-deprecation'; childProcess = spawn( binPath, ['--databaseURI', databaseURI, './spec/configs/CLIConfigAuth.json'], From 391a2c6cc1f00f8d9c13187585d40eaea6d13a5b Mon Sep 17 00:00:00 2001 From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com> Date: Tue, 9 Jul 2024 11:51:40 +0200 Subject: [PATCH 09/13] remove punycode --- package-lock.json | 1 - package.json | 1 - src/vendor/mongodbUrl.js | 5 ++--- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index aab6f97b75..467705e92f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -45,7 +45,6 @@ "pg-monitor": "2.0.0", "pg-promise": "11.7.8", "pluralize": "8.0.0", - "punycode": "2.3.1", "rate-limit-redis": "4.2.0", "redis": "4.6.13", "semver": "7.6.0", diff --git a/package.json b/package.json index 7811240ac2..8e2495c965 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,6 @@ "pg-monitor": "2.0.0", "pg-promise": "11.7.8", "pluralize": "8.0.0", - "punycode": "2.3.1", "rate-limit-redis": "4.2.0", "redis": "4.6.13", "semver": "7.6.0", diff --git a/src/vendor/mongodbUrl.js b/src/vendor/mongodbUrl.js index 381e98521b..09ca12a421 100644 --- a/src/vendor/mongodbUrl.js +++ b/src/vendor/mongodbUrl.js @@ -5,8 +5,7 @@ 'use strict'; -// const punycode = require('punycode/'); -import punycode from 'punycode/punycode.js' +const _url = require('node:url'); exports.parse = urlParse; exports.resolve = urlResolve; @@ -295,7 +294,7 @@ Url.prototype.parse = function (url, parseQueryString, slashesDenoteHost) { // It only converts parts of the domain name that // have non-ASCII characters, i.e. it doesn't matter if // you call it with a domain that already is ASCII-only. - this.hostname = punycode.toASCII(this.hostname); + this.hostname = _url.domainToASCII(this.hostname); } var p = this.port ? ':' + this.port : ''; From ed0ac04bb1b4ce30f2e0135ee0bf17ff40169136 Mon Sep 17 00:00:00 2001 From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com> Date: Tue, 9 Jul 2024 11:54:43 +0200 Subject: [PATCH 10/13] Update CLI.spec.js --- spec/CLI.spec.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/spec/CLI.spec.js b/spec/CLI.spec.js index 87320980fa..3593cb97c3 100644 --- a/spec/CLI.spec.js +++ b/spec/CLI.spec.js @@ -319,7 +319,17 @@ fdescribe('execution', () => { }); childProcess.stderr.on('data', data => { data = data.toString(); - done.fail(data.toString()); + if (!data.includes('[DEP0040] DeprecationWarning')) { + done.fail(data); + } + }); + childProcess.on('error', err => { + done.fail(err); + }); + childProcess.on('close', code => { + if (code !== 0) { + done.fail(`Process exited with code ${code}`); + } }); }); }); From 3045aa76b3f543945f759580abe580c05b07c095 Mon Sep 17 00:00:00 2001 From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com> Date: Tue, 9 Jul 2024 12:23:26 +0200 Subject: [PATCH 11/13] rewrite --- spec/CLI.spec.js | 102 ++++++++++++++++++++++------------------------- 1 file changed, 48 insertions(+), 54 deletions(-) diff --git a/spec/CLI.spec.js b/spec/CLI.spec.js index 3593cb97c3..8729fc4bb1 100644 --- a/spec/CLI.spec.js +++ b/spec/CLI.spec.js @@ -208,6 +208,31 @@ fdescribe('execution', () => { const binPath = path.resolve(__dirname, '../bin/parse-server'); let childProcess; + function handleStdout(childProcess, done, aggregatedData, requiredData) { + childProcess.stdout.on('data', data => { + data = data.toString(); + aggregatedData.push(data); + if (requiredData.every(required => aggregatedData.some(aggregated => aggregated.includes(required)))) { + done(); + } + }); + } + + function handleStderr(childProcess, done) { + childProcess.stderr.on('data', data => { + data = data.toString(); + if (!data.includes('[DEP0040] DeprecationWarning')) { + done.fail(data); + } + }); + } + + function handleError(childProcess, done) { + childProcess.on('error', err => { + done.fail(err); + }); + } + afterEach(done => { if (childProcess) { childProcess.on('close', () => { @@ -226,15 +251,10 @@ fdescribe('execution', () => { ['--appId', 'test', '--masterKey', 'test', '--databaseURI', databaseURI, '--port', '1339'], { env } ); - childProcess.stdout.on('data', data => { - data = data.toString(); - if (data.includes('parse-server running on')) { - done(); - } - }); - childProcess.stderr.on('data', data => { - done.fail(data.toString()); - }); + const aggregatedData = []; + handleStdout(childProcess, done, aggregatedData, ['parse-server running on']); + handleStderr(childProcess, done); + handleError(childProcess, done); }); it('should start Parse Server with GraphQL', async done => { @@ -255,18 +275,13 @@ fdescribe('execution', () => { ], { env } ); - let output = ''; - childProcess.stdout.on('data', data => { - data = data.toString(); - output += data; - if (data.includes('GraphQL running on')) { - expect(output).toMatch('parse-server running on'); - done(); - } - }); - childProcess.stderr.on('data', data => { - done.fail(data.toString()); - }); + const aggregatedData = []; + handleStdout(childProcess, done, aggregatedData, [ + 'parse-server running on', + 'GraphQL running on', + ]); + handleStderr(childProcess, done); + handleError(childProcess, done); }); it('should start Parse Server with GraphQL and Playground', async done => { @@ -288,19 +303,14 @@ fdescribe('execution', () => { ], { env } ); - let output = ''; - childProcess.stdout.on('data', data => { - data = data.toString(); - output += data; - if (data.includes('Playground running on')) { - expect(output).toMatch('GraphQL running on'); - expect(output).toMatch('parse-server running on'); - done(); - } - }); - childProcess.stderr.on('data', data => { - done.fail(data.toString()); - }); + const aggregatedData = []; + handleStdout(childProcess, done, aggregatedData, [ + 'parse-server running on', + 'Playground running on', + 'GraphQL running on', + ]); + handleStderr(childProcess, done); + handleError(childProcess, done); }); it('can start Parse Server with auth via CLI', done => { @@ -311,25 +321,9 @@ fdescribe('execution', () => { ['--databaseURI', databaseURI, './spec/configs/CLIConfigAuth.json'], { env } ); - childProcess.stdout.on('data', data => { - data = data.toString(); - if (data.includes('parse-server running on')) { - done(); - } - }); - childProcess.stderr.on('data', data => { - data = data.toString(); - if (!data.includes('[DEP0040] DeprecationWarning')) { - done.fail(data); - } - }); - childProcess.on('error', err => { - done.fail(err); - }); - childProcess.on('close', code => { - if (code !== 0) { - done.fail(`Process exited with code ${code}`); - } - }); + const aggregatedData = []; + handleStdout(childProcess, done, aggregatedData, ['parse-server running on']); + handleStderr(childProcess, done); + handleError(childProcess, done); }); }); From 7d0b053e576ae2a70e0142744ee3f8cf07906cd2 Mon Sep 17 00:00:00 2001 From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com> Date: Tue, 9 Jul 2024 12:25:40 +0200 Subject: [PATCH 12/13] Update CLI.spec.js --- spec/CLI.spec.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/spec/CLI.spec.js b/spec/CLI.spec.js index 8729fc4bb1..9c6a4775a5 100644 --- a/spec/CLI.spec.js +++ b/spec/CLI.spec.js @@ -204,9 +204,10 @@ describe('LiveQuery definitions', () => { }); }); -fdescribe('execution', () => { +describe('execution', () => { const binPath = path.resolve(__dirname, '../bin/parse-server'); let childProcess; + let aggregatedData; function handleStdout(childProcess, done, aggregatedData, requiredData) { childProcess.stdout.on('data', data => { @@ -233,6 +234,10 @@ fdescribe('execution', () => { }); } + beforeEach(() => { + aggregatedData = []; + }); + afterEach(done => { if (childProcess) { childProcess.on('close', () => { @@ -251,7 +256,6 @@ fdescribe('execution', () => { ['--appId', 'test', '--masterKey', 'test', '--databaseURI', databaseURI, '--port', '1339'], { env } ); - const aggregatedData = []; handleStdout(childProcess, done, aggregatedData, ['parse-server running on']); handleStderr(childProcess, done); handleError(childProcess, done); @@ -275,7 +279,6 @@ fdescribe('execution', () => { ], { env } ); - const aggregatedData = []; handleStdout(childProcess, done, aggregatedData, [ 'parse-server running on', 'GraphQL running on', @@ -303,7 +306,6 @@ fdescribe('execution', () => { ], { env } ); - const aggregatedData = []; handleStdout(childProcess, done, aggregatedData, [ 'parse-server running on', 'Playground running on', @@ -321,7 +323,6 @@ fdescribe('execution', () => { ['--databaseURI', databaseURI, './spec/configs/CLIConfigAuth.json'], { env } ); - const aggregatedData = []; handleStdout(childProcess, done, aggregatedData, ['parse-server running on']); handleStderr(childProcess, done); handleError(childProcess, done); From 008084b9dbac7e29f343ab2b6d35bd9357c16352 Mon Sep 17 00:00:00 2001 From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com> Date: Tue, 9 Jul 2024 12:36:16 +0200 Subject: [PATCH 13/13] add punycode --- package-lock.json | 2 ++ package.json | 1 + src/vendor/mongodbUrl.js | 4 ++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 467705e92f..0d760f241c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -45,6 +45,7 @@ "pg-monitor": "2.0.0", "pg-promise": "11.7.8", "pluralize": "8.0.0", + "punycode": "2.3.1", "rate-limit-redis": "4.2.0", "redis": "4.6.13", "semver": "7.6.0", @@ -18020,6 +18021,7 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "license": "MIT", "engines": { "node": ">=6" } diff --git a/package.json b/package.json index 8e2495c965..7811240ac2 100644 --- a/package.json +++ b/package.json @@ -54,6 +54,7 @@ "pg-monitor": "2.0.0", "pg-promise": "11.7.8", "pluralize": "8.0.0", + "punycode": "2.3.1", "rate-limit-redis": "4.2.0", "redis": "4.6.13", "semver": "7.6.0", diff --git a/src/vendor/mongodbUrl.js b/src/vendor/mongodbUrl.js index 09ca12a421..becab5745f 100644 --- a/src/vendor/mongodbUrl.js +++ b/src/vendor/mongodbUrl.js @@ -5,7 +5,7 @@ 'use strict'; -const _url = require('node:url'); +import punycode from 'punycode/punycode.js'; exports.parse = urlParse; exports.resolve = urlResolve; @@ -294,7 +294,7 @@ Url.prototype.parse = function (url, parseQueryString, slashesDenoteHost) { // It only converts parts of the domain name that // have non-ASCII characters, i.e. it doesn't matter if // you call it with a domain that already is ASCII-only. - this.hostname = _url.domainToASCII(this.hostname); + this.hostname = punycode.toASCII(this.hostname); } var p = this.port ? ':' + this.port : '';