From 37c8d3cc7889510a365ae5d5849bba0355ed2078 Mon Sep 17 00:00:00 2001 From: Florent Vilmart Date: Tue, 10 Oct 2017 08:49:27 -0400 Subject: [PATCH 1/6] let travis build against 3.x --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 0ea8f9933b..2536a6ce23 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,7 @@ branches: only: - master - /^[0-9]+.[0-9]+.[0-9]+(-.*)?$/ + - 3.x - /^greenkeeper/.*$/ cache: directories: From 7e7d0a94a7664cae02b156223e1d098f159ba1f7 Mon Sep 17 00:00:00 2001 From: Florent Vilmart Date: Sat, 21 Oct 2017 11:42:07 -0400 Subject: [PATCH 2/6] Cleanup dependencies and bump min version to current LTS --- .babelrc | 7 +++---- .travis.yml | 6 +++--- package.json | 7 ++----- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/.babelrc b/.babelrc index b1ff51d47d..509c3decfe 100644 --- a/.babelrc +++ b/.babelrc @@ -1,13 +1,12 @@ { "plugins": [ - "transform-flow-strip-types" + "transform-flow-strip-types", + "transform-object-rest-spread" ], "presets": [ - "es2015", - "stage-3", ["env", { "targets": { - "node": "4.6" + "node": "6.11.4" } }] ] diff --git a/.travis.yml b/.travis.yml index 2536a6ce23..ea19cea91e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,13 +25,13 @@ stage: test env: global: - COVERAGE_OPTION='./node_modules/.bin/nyc' - - NODE_VERSION=6.10 + - NODE_VERSION=6.11.4 matrix: - MONGODB_VERSION=3.2.13 - MONGODB_VERSION=3.4.4 - PARSE_SERVER_TEST_DB=postgres - PARSE_SERVER_TEST_CACHE=redis - - NODE_VERSION=8.5 + - NODE_VERSION=8.7 before_install: - nvm install $NODE_VERSION - nvm use $NODE_VERSION @@ -48,7 +48,7 @@ jobs: include: # release on github latest branch - stage: release - node_js: '4.6' + node_js: '6.11.4' env: before_script: skip after_script: skip diff --git a/package.json b/package.json index c049d8cce8..6422de80d1 100644 --- a/package.json +++ b/package.json @@ -48,12 +48,9 @@ "babel-cli": "6.26.0", "babel-core": "6.26.0", "babel-eslint": "^8.0.0", - "babel-plugin-syntax-flow": "6.18.0", "babel-plugin-transform-flow-strip-types": "6.22.0", + "babel-plugin-transform-object-rest-spread": "^6.26.0", "babel-preset-env": "1.6.1", - "babel-preset-es2015": "6.24.1", - "babel-preset-stage-3": "6.24.1", - "babel-register": "6.26.0", "bcrypt-nodejs": "0.0.3", "cross-env": "5.1.0", "deep-diff": "0.3.8", @@ -80,7 +77,7 @@ "prepublish": "npm run build" }, "engines": { - "node": ">=4.6" + "node": ">=6.11.4" }, "bin": { "parse-server": "./bin/parse-server" From d7315c52a95e7d715d3f8389dbc4bb599445a028 Mon Sep 17 00:00:00 2001 From: Florent Vilmart Date: Sat, 21 Oct 2017 11:45:01 -0400 Subject: [PATCH 3/6] Makes npm-git push all branches to -preview --- .travis.yml | 6 ++++-- resources/npm-git.sh | 10 ++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index ea19cea91e..2342795097 100644 --- a/.travis.yml +++ b/.travis.yml @@ -57,8 +57,10 @@ jobs: - provider: script skip_cleanup: true script: ./resources/npm-git.sh - on: - branch: master + # on: Commented out just for testing + # branch: + # - master + # - 3.x - provider: npm skip_cleanup: true email: diff --git a/resources/npm-git.sh b/resources/npm-git.sh index 7fa1dd0642..d0442ffc85 100755 --- a/resources/npm-git.sh +++ b/resources/npm-git.sh @@ -9,6 +9,12 @@ # From: https://github.com/graphql/graphql-js/blob/master/resources/npm-git.sh BUILD_DIR=latest +BRANCH=$(git rev-parse --abbrev-ref HEAD) +TARGET="latest" +if [ "$BRANCH" != "master" ]; +then + TARGET="$BRANCH-preview" +fi npm run build @@ -29,5 +35,5 @@ git init git config user.name "Travis CI" git config user.email "github@fb.com" git add . -git commit -m "Deploy master to LATEST branch" -git push --force --quiet "https://${GH_TOKEN}@github.com/parse-community/parse-server.git" master:latest +git commit -m "Deploy $BRANCH to $TARGET branch" +git push --force --quiet "https://${GH_TOKEN}@github.com/parse-community/parse-server.git" master:$TARGET From b228d3e9249f1c7571bf8e1b6727a882e374cf58 Mon Sep 17 00:00:00 2001 From: Florent Vilmart Date: Sat, 21 Oct 2017 12:10:21 -0400 Subject: [PATCH 4/6] restores releases --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2342795097..a189c4ac0d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -57,10 +57,10 @@ jobs: - provider: script skip_cleanup: true script: ./resources/npm-git.sh - # on: Commented out just for testing - # branch: - # - master - # - 3.x + on: + branch: + - master + - 3.x - provider: npm skip_cleanup: true email: From ea07d20b1a2dd53c90a4e9975127fa7081e94cd4 Mon Sep 17 00:00:00 2001 From: Florent Vilmart Date: Sat, 21 Oct 2017 13:29:07 -0400 Subject: [PATCH 5/6] Bumps mime to 2.0.3 (requires node 6+) --- package.json | 2 +- src/Controllers/FilesController.js | 6 +++--- src/Routers/FilesRouter.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 6422de80d1..49086858b7 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "intersect": "1.0.1", "lodash": "4.17.4", "lru-cache": "4.1.1", - "mime": "1.4.1", + "mime": "2.0.3", "mongodb": "2.2.33", "multer": "1.3.0", "parse": "1.10.1", diff --git a/src/Controllers/FilesController.js b/src/Controllers/FilesController.js index e8bcbc71d9..2ea83412db 100644 --- a/src/Controllers/FilesController.js +++ b/src/Controllers/FilesController.js @@ -19,10 +19,10 @@ export class FilesController extends AdaptableController { const hasExtension = extname.length > 0; - if (!hasExtension && contentType && mime.extension(contentType)) { - filename = filename + '.' + mime.extension(contentType); + if (!hasExtension && contentType && mime.getExtension(contentType)) { + filename = filename + '.' + mime.getExtension(contentType); } else if (hasExtension && !contentType) { - contentType = mime.lookup(filename); + contentType = mime.getType(filename); } filename = randomHexString(32) + '_' + filename; diff --git a/src/Routers/FilesRouter.js b/src/Routers/FilesRouter.js index 5e09d045f7..8312526f30 100644 --- a/src/Routers/FilesRouter.js +++ b/src/Routers/FilesRouter.js @@ -37,7 +37,7 @@ export class FilesRouter { const config = Config.get(req.params.appId); const filesController = config.filesController; const filename = req.params.filename; - const contentType = mime.lookup(filename); + const contentType = mime.getType(filename); if (isFileStreamable(req, filesController)) { filesController.getFileStream(config, filename).then((stream) => { handleFileStream(stream, req, res, contentType); From cc91af594e1cabe1467dde9ac98a68f57b91a117 Mon Sep 17 00:00:00 2001 From: Florent Vilmart Date: Sat, 21 Oct 2017 13:38:19 -0400 Subject: [PATCH 6/6] Bumps express to latest version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 49086858b7..ca4abd4f0e 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "body-parser": "1.18.2", "commander": "2.11.0", "deepcopy": "0.6.3", - "express": "4.16.0", + "express": "4.16.2", "intersect": "1.0.1", "lodash": "4.17.4", "lru-cache": "4.1.1",