Skip to content

Commit d3f8d41

Browse files
authored
Merge branch 'master' into ci-add-node-engine-check
2 parents 66d924b + 3e4d1ec commit d3f8d41

14 files changed

+94
-24
lines changed

.babelrc

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
["@babel/preset-env", {
88
"targets": {
99
"node": "12"
10-
}
10+
},
11+
"exclude": ["proposal-dynamic-import"]
1112
}]
1213
],
1314
"sourceMaps": "inline"

.github/workflows/ci.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -114,17 +114,17 @@ jobs:
114114
MONGODB_STORAGE_ENGINE: wiredTiger
115115
NODE_VERSION: 14.17.6
116116
- name: MongoDB 4.2, ReplicaSet, WiredTiger
117-
MONGODB_VERSION: 4.2.15
117+
MONGODB_VERSION: 4.2.16
118118
MONGODB_TOPOLOGY: replicaset
119119
MONGODB_STORAGE_ENGINE: wiredTiger
120120
NODE_VERSION: 14.17.6
121121
- name: MongoDB 4.0, ReplicaSet, WiredTiger
122-
MONGODB_VERSION: 4.0.25
122+
MONGODB_VERSION: 4.0.27
123123
MONGODB_TOPOLOGY: replicaset
124124
MONGODB_STORAGE_ENGINE: wiredTiger
125125
NODE_VERSION: 14.17.6
126126
- name: MongoDB 4.0, Standalone, MMAPv1
127-
MONGODB_VERSION: 4.0.25
127+
MONGODB_VERSION: 4.0.27
128128
MONGODB_TOPOLOGY: standalone
129129
MONGODB_STORAGE_ENGINE: mmapv1
130130
NODE_VERSION: 14.17.6

CHANGELOG.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,8 @@ ___
152152
- Refactor: uniform issue templates across repos (Manuel Trezza) [#7528](https://github.com/parse-community/parse-server/pull/7528)
153153
- ci: bump ci environment (Manuel Trezza) [#7539](https://github.com/parse-community/parse-server/pull/7539)
154154
- CI now pushes docker images to Docker Hub (Corey Baker) [#7548](https://github.com/parse-community/parse-server/pull/7548)
155+
- Allow cloud string for ES modules (Daniel Blyth) [#7560](https://github.com/parse-community/parse-server/pull/7560)
156+
- docs: Introduce deprecation ID for reference in comments and online search (Manuel Trezza) [#7562](https://github.com/parse-community/parse-server/pull/7562)
155157

156158
## 4.10.3
157159
[Full Changelog](https://github.com/parse-community/parse-server/compare/4.10.2...4.10.3)
@@ -178,15 +180,15 @@ ___
178180

179181
*Versions >4.5.2 and <4.10.0 are skipped.*
180182

181-
> ⚠️ A security incident caused a number of incorrect version tags to be pushed to the Parse Server repository. These version tags linked to a personal fork of a contributor who had write access to the repository. The code to which these tags linked has not been reviewed or approved by Parse Platform. Even though no releases were published with these incorrect versions, it was possible to define a Parse Server dependency that pointed to these version tags, for example if you defined this dependency:
183+
> ⚠️ A security incident caused a number of incorrect version tags to be pushed to the Parse Server repository. These version tags linked to a personal fork of a contributor who had write access to the repository. The code to which these tags linked has not been reviewed or approved by Parse Platform. Even though no releases were published with these incorrect versions, it was possible to define a Parse Server dependency that pointed to these version tags, for example if you defined this dependency:
182184
> ```js
183185
> "parse-server": "[email protected]:parse-community/parse-server.git#4.9.3"
184186
> ```
185-
>
187+
>
186188
> We have since deleted the incorrect version tags, but they may still show up if your personal fork on GitHub or locally. We do not know when these tags have been pushed to the Parse Server repository, but we first became aware of this issue on July 21, 2021. We are not aware of any malicious code or concerns related to privacy, security or legality (e.g. proprietary code). However, it has been reported that some functionality does not work as expected and the introduction of security vulnerabilities cannot be ruled out.
187189
>
188-
> You may be also affected if you used the Bitnami image for Parse Server. Bitnami picked up the incorrect version tag `4.9.3` and published a new Bitnami image for Parse Server.
189-
>
190+
> You may be also affected if you used the Bitnami image for Parse Server. Bitnami picked up the incorrect version tag `4.9.3` and published a new Bitnami image for Parse Server.
191+
>
190192
>**If you are using any of the affected versions, we urgently recommend to upgrade to version `4.10.0`.**
191193
192194
## 4.5.2

CONTRIBUTING.md

+51
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
- [Wording Guideline](#wording-guideline)
2020
- [Parse Error](#parse-error)
2121
- [Parse Server Configuration](#parse-server-configuration)
22+
- [Commit Message](#commit-message)
23+
- [Breaking Change](#breaking-change)
2224
- [Code of Conduct](#code-of-conduct)
2325

2426
## Contributing
@@ -288,6 +290,55 @@ Introducing new [Parse Server configuration][config] parameters requires the fol
288290
5. Add test cases to ensure the correct parameter value validation. Parse Server throws an error at launch if an invalid value is set for any configuration parameter.
289291
6. Execute `npm run docs` to generate the documentation in the `/out` directory. Take a look at the documentation whether the description and formatting of the newly introduced parameters is satisfactory.
290292

293+
## Commit Message
294+
295+
For release automation, the title of pull requests needs to be written in a defined syntax. We loosely follow the [Conventional Commits](https://www.conventionalcommits.org) specification, which defines this syntax:
296+
297+
```
298+
<type>: <summary>
299+
```
300+
301+
The _type_ is the category of change that is made, possible types are:
302+
- `feat` - add a new feature
303+
- `fix` - fix a bug
304+
- `refactor` - refactor code without impact on features or performance
305+
- `docs` - add or edit code comments, documentation, GitHub pages
306+
- `style` - edit code style
307+
- `build` - retry failing build and anything build process related
308+
- `perf` - performance optimization
309+
- `ci` - continuous integration
310+
- `test` - tests
311+
312+
The _summary_ is a short change description in present tense, not capitalized, without period at the end. This summary will also be used as the changelog entry.
313+
- It must be short and self-explanatory for a reader who does not see the details of the full pull request description
314+
- It must not contain abbreviations, e.g. instead of `LQ` write `LiveQuery`
315+
- It must use the correct product and feature names as referenced in the documentation, e.g. instead of `Cloud Validator` use `Cloud Function validation`
316+
- In case of a breaking change, the summary must not contain duplicate information that is also in the [BREAKING CHANGE](#breaking-change) chapter of the pull request description. It must not contain a note that it is a breaking change, as this will be automatically flagged as such if the pull request description contains the BREAKING CHANGE chapter.
317+
318+
For example:
319+
320+
```
321+
feat: add handle to door for easy opening
322+
```
323+
324+
Currently, we are not making use of the commit _scope_, which would be written as `<type>(<scope>): <summary>`, that attributes a change to a specific part of the product.
325+
326+
### Breaking Change
327+
328+
If a pull request contains a braking change, the description of the pull request must contain a special chapter at the bottom.
329+
330+
The chapter consists of the phrase `BREAKING CHANGE`, capitalized, in a single line without any formatting. It must be followed by an empty line, then a short description of the breaking change, and ideally how the developer should address it. This chapter should contain more details focusing on the "breaking” aspect of the change, as it is intended to assist the developer in adapting their deployment. However, keep it concise, as it will also become part of the changelog entry.
331+
332+
For example:
333+
334+
```
335+
Detailed pull request description...
336+
337+
BREAKING CHANGE
338+
339+
The door handle has be pulled up to open the door, not down. Adjust your habits accordingly by walking on your hands.
340+
```
341+
291342
## Code of Conduct
292343
293344
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.

DEPRECATIONS.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
The following is a list of deprecations, according to the [Deprecation Policy](https://github.com/parse-community/parse-server/blob/master/CONTRIBUTING.md#deprecation-policy). After a feature becomes deprecated, and giving developers time to adapt to the change, the deprecated feature will eventually be removed, leading to a breaking change. Developer feedback during the deprecation period may postpone or even revoke the introduction of the breaking change.
44

5-
| Change | Issue | Deprecation [ℹ️][i_deprecation] | Planned Removal [ℹ️][i_removal] | Status [ℹ️][i_status] | Notes |
6-
|-------------------------------------------------|----------------------------------------------------------------------|---------------------------------|---------------------------------|-----------------------|-------|
7-
| Native MongoDB syntax in aggregation pipeline | [#7338](https://github.com/parse-community/parse-server/issues/7338) | 5.0.0 (2022) | 6.0.0 (2023) | deprecated | - |
8-
| Config option `directAccess` defaults to `true` | [#6636](https://github.com/parse-community/parse-server/pull/6636) | 5.0.0 (2022) | 6.0.0 (2023) | deprecated | - |
5+
| ID | Change | Issue | Deprecation [ℹ️][i_deprecation] | Planned Removal [ℹ️][i_removal] | Status [ℹ️][i_status] | Notes |
6+
|--------|-------------------------------------------------|----------------------------------------------------------------------|---------------------------------|---------------------------------|-----------------------|-------|
7+
| DEPPS1 | Native MongoDB syntax in aggregation pipeline | [#7338](https://github.com/parse-community/parse-server/issues/7338) | 5.0.0 (2022) | 6.0.0 (2023) | deprecated | - |
8+
| DEPPS2 | Config option `directAccess` defaults to `true` | [#6636](https://github.com/parse-community/parse-server/pull/6636) | 5.0.0 (2022) | 6.0.0 (2023) | deprecated | - |
99

1010
[i_deprecation]: ## "The version and date of the deprecation."
1111
[i_removal]: ## "The version and date of the planned removal."

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ Parse Server is continuously tested with the most recent releases of MongoDB to
123123

124124
| Version | Latest Version | End-of-Life Date | Compatibility |
125125
|-------------|----------------|------------------|--------------------|
126-
| MongoDB 4.0 | 4.0.25 | April 2022 | ✅ Fully compatible |
127-
| MongoDB 4.2 | 4.2.15 | TBD | ✅ Fully compatible |
126+
| MongoDB 4.0 | 4.0.27 | April 2022 | ✅ Fully compatible |
127+
| MongoDB 4.2 | 4.2.16 | TBD | ✅ Fully compatible |
128128
| MongoDB 4.4 | 4.4.8 | TBD | ✅ Fully compatible |
129129
| MongoDB 5.0 | 5.0.2 | January 2024 | ✅ Fully compatible |
130130

package-lock.json

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@
112112
"test:mongodb:runnerstart": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=$npm_config_dbversion} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} MONGODB_STORAGE_ENGINE=${MONGODB_STORAGE_ENGINE:=wiredTiger} mongodb-runner start",
113113
"test:mongodb:testonly": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=$npm_config_dbversion} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} MONGODB_STORAGE_ENGINE=${MONGODB_STORAGE_ENGINE:=wiredTiger} TESTING=1 jasmine",
114114
"test:mongodb": "npm run test:mongodb:runnerstart --dbversion=$npm_config_dbversion && npm run test:mongodb:testonly --dbversion=$npm_config_dbversion",
115-
"test:mongodb:4.0.25": "npm run test:mongodb --dbversion=4.0.25",
116-
"test:mongodb:4.2.15": "npm run test:mongodb --dbversion=4.2.15",
115+
"test:mongodb:4.0.27": "npm run test:mongodb --dbversion=4.0.27",
116+
"test:mongodb:4.2.16": "npm run test:mongodb --dbversion=4.2.16",
117117
"test:mongodb:4.4.8": "npm run test:mongodb --dbversion=4.4.8",
118118
"posttest:mongodb": "mongodb-runner stop",
119119
"pretest": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=4.4.8} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} MONGODB_STORAGE_ENGINE=${MONGODB_STORAGE_ENGINE:=wiredTiger} mongodb-runner start",

spec/CloudCode.spec.js

+8
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@ describe('Cloud Code', () => {
3939
});
4040
});
4141

42+
it('can load cloud code as a module', async () => {
43+
process.env.npm_package_type = 'module';
44+
await reconfigureServer({ cloud: './spec/cloud/cloudCodeModuleFile.js' });
45+
const result = await Parse.Cloud.run('cloudCodeInFile');
46+
expect(result).toEqual('It is possible to define cloud code in a file.');
47+
delete process.env.npm_package_type;
48+
});
49+
4250
it('can create functions', done => {
4351
Parse.Cloud.define('hello', () => {
4452
return 'Hello world!';

spec/cloud/cloudCodeModuleFile.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Parse.Cloud.define('cloudCodeInFile', () => {
2+
return 'It is possible to define cloud code in a file.';
3+
});

src/Options/Definitions.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,8 @@ module.exports.ParseServerOptions = {
156156
},
157157
expireInactiveSessions: {
158158
env: 'PARSE_SERVER_EXPIRE_INACTIVE_SESSIONS',
159-
help: 'Sets wether we should expire the inactive sessions, defaults to true',
159+
help:
160+
'Sets whether we should expire the inactive sessions, defaults to true. If false, all new sessions are created with no expiration date.',
160161
action: parsers.booleanParser,
161162
default: true,
162163
},

src/Options/docs.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
* @property {Boolean} enableAnonymousUsers Enable (or disable) anonymous users, defaults to true
2929
* @property {Boolean} enableExpressErrorHandler Enables the default express error handler for all errors
3030
* @property {String} encryptionKey Key for encrypting your files
31-
* @property {Boolean} expireInactiveSessions Sets wether we should expire the inactive sessions, defaults to true
31+
* @property {Boolean} expireInactiveSessions Sets whether we should expire the inactive sessions, defaults to true. If false, all new sessions are created with no expiration date.
3232
* @property {String} fileKey Key for your files
3333
* @property {Adapter<FilesAdapter>} filesAdapter Adapter module for the files sub-system
3434
* @property {FileUploadOptions} fileUpload Options for file uploads

src/Options/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ export interface ParseServerOptions {
170170
sessionLength: ?number;
171171
/* Max value for limit option on queries, defaults to unlimited */
172172
maxLimit: ?number;
173-
/* Sets wether we should expire the inactive sessions, defaults to true
173+
/* Sets whether we should expire the inactive sessions, defaults to true. If false, all new sessions are created with no expiration date.
174174
:DEFAULT: true */
175175
expireInactiveSessions: ?boolean;
176176
/* When a user changes their password, either through the reset password email or while logged in, all sessions are revoked if this is true. Set to false if you don't want to revoke sessions.

src/ParseServer.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,11 @@ class ParseServer {
103103
if (typeof cloud === 'function') {
104104
cloud(Parse);
105105
} else if (typeof cloud === 'string') {
106-
require(path.resolve(process.cwd(), cloud));
106+
if (process.env.npm_package_type === 'module') {
107+
import(path.resolve(process.cwd(), cloud));
108+
} else {
109+
require(path.resolve(process.cwd(), cloud));
110+
}
107111
} else {
108112
throw "argument 'cloud' must either be a string or a function";
109113
}

0 commit comments

Comments
 (0)