Skip to content

Commit d4b5685

Browse files
authored
Bump nodejs version to 6+ (#4272)
* let travis build against 3.x * Cleanup dependencies and bump min version to current LTS * Makes npm-git push all branches to -preview * restores releases * Bumps mime to 2.0.3 (requires node 6+) * Bumps express to latest version
1 parent 409493a commit d4b5685

File tree

6 files changed

+25
-21
lines changed

6 files changed

+25
-21
lines changed

.babelrc

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
{
22
"plugins": [
3-
"transform-flow-strip-types"
3+
"transform-flow-strip-types",
4+
"transform-object-rest-spread"
45
],
56
"presets": [
6-
"es2015",
7-
"stage-3",
87
["env", {
98
"targets": {
10-
"node": "4.6"
9+
"node": "6.11.4"
1110
}
1211
}]
1312
]

.travis.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ stage: test
2525
env:
2626
global:
2727
- COVERAGE_OPTION='./node_modules/.bin/nyc'
28-
- NODE_VERSION=6.10
28+
- NODE_VERSION=6.11.4
2929
matrix:
3030
- MONGODB_VERSION=3.2.13
3131
- MONGODB_VERSION=3.4.4
3232
- PARSE_SERVER_TEST_DB=postgres
3333
- PARSE_SERVER_TEST_CACHE=redis
34-
- NODE_VERSION=8.5
34+
- NODE_VERSION=8.7
3535
before_install:
3636
- nvm install $NODE_VERSION
3737
- nvm use $NODE_VERSION
@@ -48,7 +48,7 @@ jobs:
4848
include:
4949
# release on github latest branch
5050
- stage: release
51-
node_js: '4.6'
51+
node_js: '6.11.4'
5252
env:
5353
before_script: skip
5454
after_script: skip
@@ -58,7 +58,9 @@ jobs:
5858
skip_cleanup: true
5959
script: ./resources/npm-git.sh
6060
on:
61-
branch: master
61+
branch:
62+
- master
63+
- 3.x
6264
- provider: npm
6365
skip_cleanup: true
6466
email:

package.json

+4-7
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
"body-parser": "1.18.2",
2323
"commander": "2.11.0",
2424
"deepcopy": "0.6.3",
25-
"express": "4.16.0",
25+
"express": "4.16.2",
2626
"intersect": "1.0.1",
2727
"lodash": "4.17.4",
2828
"lru-cache": "4.1.1",
29-
"mime": "1.4.1",
29+
"mime": "2.0.3",
3030
"mongodb": "2.2.33",
3131
"multer": "1.3.0",
3232
"parse": "1.10.2",
@@ -48,12 +48,9 @@
4848
"babel-cli": "6.26.0",
4949
"babel-core": "6.26.0",
5050
"babel-eslint": "^8.0.0",
51-
"babel-plugin-syntax-flow": "6.18.0",
5251
"babel-plugin-transform-flow-strip-types": "6.22.0",
52+
"babel-plugin-transform-object-rest-spread": "^6.26.0",
5353
"babel-preset-env": "1.6.1",
54-
"babel-preset-es2015": "6.24.1",
55-
"babel-preset-stage-3": "6.24.1",
56-
"babel-register": "6.26.0",
5754
"bcrypt-nodejs": "0.0.3",
5855
"cross-env": "5.1.1",
5956
"deep-diff": "0.3.8",
@@ -80,7 +77,7 @@
8077
"prepublish": "npm run build"
8178
},
8279
"engines": {
83-
"node": ">=4.6"
80+
"node": ">=6.11.4"
8481
},
8582
"bin": {
8683
"parse-server": "./bin/parse-server"

resources/npm-git.sh

+8-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
# From: https://github.com/graphql/graphql-js/blob/master/resources/npm-git.sh
1010

1111
BUILD_DIR=latest
12+
BRANCH=$(git rev-parse --abbrev-ref HEAD)
13+
TARGET="latest"
14+
if [ "$BRANCH" != "master" ];
15+
then
16+
TARGET="$BRANCH-preview"
17+
fi
1218

1319
npm run build
1420

@@ -29,5 +35,5 @@ git init
2935
git config user.name "Travis CI"
3036
git config user.email "[email protected]"
3137
git add .
32-
git commit -m "Deploy master to LATEST branch"
33-
git push --force --quiet "https://${GH_TOKEN}@github.com/parse-community/parse-server.git" master:latest
38+
git commit -m "Deploy $BRANCH to $TARGET branch"
39+
git push --force --quiet "https://${GH_TOKEN}@github.com/parse-community/parse-server.git" master:$TARGET

src/Controllers/FilesController.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ export class FilesController extends AdaptableController {
1919

2020
const hasExtension = extname.length > 0;
2121

22-
if (!hasExtension && contentType && mime.extension(contentType)) {
23-
filename = filename + '.' + mime.extension(contentType);
22+
if (!hasExtension && contentType && mime.getExtension(contentType)) {
23+
filename = filename + '.' + mime.getExtension(contentType);
2424
} else if (hasExtension && !contentType) {
25-
contentType = mime.lookup(filename);
25+
contentType = mime.getType(filename);
2626
}
2727

2828
filename = randomHexString(32) + '_' + filename;

src/Routers/FilesRouter.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export class FilesRouter {
3737
const config = Config.get(req.params.appId);
3838
const filesController = config.filesController;
3939
const filename = req.params.filename;
40-
const contentType = mime.lookup(filename);
40+
const contentType = mime.getType(filename);
4141
if (isFileStreamable(req, filesController)) {
4242
filesController.getFileStream(config, filename).then((stream) => {
4343
handleFileStream(stream, req, res, contentType);

0 commit comments

Comments
 (0)