Skip to content

Commit ee24d5b

Browse files
authored
Merge branch 'master' into bump-ci
2 parents fd4b9ec + 0225340 commit ee24d5b

File tree

6 files changed

+33
-8
lines changed

6 files changed

+33
-8
lines changed

.babelrc

Lines changed: 2 additions & 1 deletion
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"

CHANGELOG.md

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

156157
## 4.10.3
@@ -178,15 +179,15 @@ ___
178179

179180
*Versions >4.5.2 and <4.10.0 are skipped.*
180181

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:
182+
> ⚠️ 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:
182183
> ```js
183184
> "parse-server": "[email protected]:parse-community/parse-server.git#4.9.3"
184185
> ```
185-
>
186+
>
186187
> 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.
187188
>
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-
>
189+
> 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.
190+
>
190191
>**If you are using any of the affected versions, we urgently recommend to upgrade to version `4.10.0`.**
191192
192193
## 4.5.2

CONTRIBUTING.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,11 @@ The _type_ is the category of change that is made, possible types are:
309309
- `ci` - continuous integration
310310
- `test` - tests
311311

312-
The _summary_ is a short change description in present tense, not capitalized, without period at the end.
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.
313317

314318
For example:
315319

@@ -321,11 +325,15 @@ Currently, we are not making use of the commit _scope_, which would be written a
321325

322326
### Breaking Change
323327

324-
If a pull request contains a braking change, the text of the pull request must contain the word `BREAKING CHANGE` capitalized as the _last, most bottom_ part of the text. It must be followed by an empty line, then a short description of the character of the breaking change, and ideally how the developer should address it.
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.
325331
326332
For example:
327333
328334
```
335+
Detailed pull request description...
336+
329337
BREAKING CHANGE
330338
331339
The door handle has be pulled up to open the door, not down. Adjust your habits accordingly by walking on your hands.

spec/CloudCode.spec.js

Lines changed: 8 additions & 0 deletions
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

Lines changed: 3 additions & 0 deletions
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/ParseServer.js

Lines changed: 5 additions & 1 deletion
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)