From 543f21cdb1d73f1f175b231f87e3667e90f70f3c Mon Sep 17 00:00:00 2001 From: Jim Laurie Date: Fri, 23 Feb 2018 14:57:58 +0100 Subject: [PATCH] Fix PR feedback --- LICENSE.md | 2 +- packages/strapi-admin/LICENSE.md | 2 +- packages/strapi-admin/package.json | 2 +- packages/strapi-bookshelf/LICENSE.md | 2 +- packages/strapi-bookshelf/package.json | 2 +- packages/strapi-ejs/LICENSE.md | 2 +- packages/strapi-ejs/package.json | 2 +- packages/strapi-generate-admin/LICENSE.md | 2 +- packages/strapi-generate-admin/package.json | 2 +- packages/strapi-generate-api/LICENSE.md | 2 +- packages/strapi-generate-api/package.json | 2 +- packages/strapi-generate-controller/LICENSE.md | 2 +- packages/strapi-generate-controller/package.json | 2 +- packages/strapi-generate-model/LICENSE.md | 2 +- packages/strapi-generate-model/package.json | 2 +- packages/strapi-generate-new/LICENSE.md | 2 +- packages/strapi-generate-new/json/package.json.js | 1 - packages/strapi-generate-new/package.json | 2 +- packages/strapi-generate-plugin/LICENSE.md | 2 +- packages/strapi-generate-plugin/package.json | 2 +- packages/strapi-generate-policy/LICENSE.md | 2 +- packages/strapi-generate-policy/package.json | 2 +- packages/strapi-generate-service/LICENSE.md | 2 +- packages/strapi-generate-service/package.json | 2 +- packages/strapi-generate/package.json | 2 +- packages/strapi-helper-plugin/package.json | 2 +- packages/strapi-knex/LICENSE.md | 2 +- packages/strapi-knex/package.json | 2 +- packages/strapi-middleware-views/LICENSE.md | 2 +- packages/strapi-middleware-views/package.json | 2 +- packages/strapi-mongoose/LICENSE.md | 2 +- packages/strapi-mongoose/package.json | 2 +- .../strapi-plugin-content-manager/package.json | 2 +- .../package.json | 2 +- .../strapi-plugin-settings-manager/package.json | 2 +- .../config/functions/bootstrap.js | 14 +++++++------- .../strapi-plugin-upload/controllers/Upload.js | 3 +-- .../strapi-plugin-upload/models/File.settings.json | 3 +-- packages/strapi-plugin-upload/package.json | 1 + packages/strapi-plugin-upload/services/Upload.js | 2 +- packages/strapi-redis/LICENSE.md | 2 +- packages/strapi-redis/package.json | 2 +- .../.editorconfig | 0 .../.gitignore | 0 .../.npmignore | 0 .../LICENSE.md | 2 +- .../README.md | 0 .../lib/index.js | 8 +++----- .../package.json | 6 +++--- packages/strapi-upload-local/LICENSE.md | 2 +- packages/strapi-upload-local/lib/index.js | 12 +++++++++--- packages/strapi-upload-local/package.json | 4 ++-- packages/strapi-utils/LICENSE.md | 2 +- packages/strapi-utils/package.json | 2 +- packages/strapi/LICENSE.md | 2 +- packages/strapi/package.json | 2 +- scripts/setup.js | 2 +- 57 files changed, 71 insertions(+), 69 deletions(-) rename packages/{strapi-upload-s3 => strapi-upload-aws-s3}/.editorconfig (100%) rename packages/{strapi-upload-s3 => strapi-upload-aws-s3}/.gitignore (100%) rename packages/{strapi-upload-s3 => strapi-upload-aws-s3}/.npmignore (100%) rename packages/{strapi-upload-s3 => strapi-upload-aws-s3}/LICENSE.md (96%) rename packages/{strapi-upload-s3 => strapi-upload-aws-s3}/README.md (100%) rename packages/{strapi-upload-s3 => strapi-upload-aws-s3}/lib/index.js (92%) rename packages/{strapi-upload-s3 => strapi-upload-aws-s3}/package.json (90%) diff --git a/LICENSE.md b/LICENSE.md index 18d1ee5cac..374bffb6c5 100755 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,4 +1,4 @@ -Copyright (c) 2015-2017 Strapi Solutions. +Copyright (c) 2015-2018 Strapi Solutions. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/packages/strapi-admin/LICENSE.md b/packages/strapi-admin/LICENSE.md index e27c5b5d59..e02de523ba 100755 --- a/packages/strapi-admin/LICENSE.md +++ b/packages/strapi-admin/LICENSE.md @@ -1,4 +1,4 @@ -Copyright (c) 2015-2017 Strapi Solutions. +Copyright (c) 2015-2018 Strapi Solutions. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/packages/strapi-admin/package.json b/packages/strapi-admin/package.json index 1bf8c539bf..524362b5f1 100755 --- a/packages/strapi-admin/package.json +++ b/packages/strapi-admin/package.json @@ -43,7 +43,7 @@ } ], "engines": { - "node": ">= 8.0.0", + "node": ">= 9.0.0", "npm": ">= 3.0.0" }, "license": "MIT" diff --git a/packages/strapi-bookshelf/LICENSE.md b/packages/strapi-bookshelf/LICENSE.md index e27c5b5d59..e02de523ba 100755 --- a/packages/strapi-bookshelf/LICENSE.md +++ b/packages/strapi-bookshelf/LICENSE.md @@ -1,4 +1,4 @@ -Copyright (c) 2015-2017 Strapi Solutions. +Copyright (c) 2015-2018 Strapi Solutions. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/packages/strapi-bookshelf/package.json b/packages/strapi-bookshelf/package.json index e1b01735e2..34ca0d39e1 100755 --- a/packages/strapi-bookshelf/package.json +++ b/packages/strapi-bookshelf/package.json @@ -51,7 +51,7 @@ "url": "https://github.com/strapi/strapi/issues" }, "engines": { - "node": ">= 8.0.0", + "node": ">= 9.0.0", "npm": ">= 5.3.0" }, "license": "MIT" diff --git a/packages/strapi-ejs/LICENSE.md b/packages/strapi-ejs/LICENSE.md index e27c5b5d59..e02de523ba 100755 --- a/packages/strapi-ejs/LICENSE.md +++ b/packages/strapi-ejs/LICENSE.md @@ -1,4 +1,4 @@ -Copyright (c) 2015-2017 Strapi Solutions. +Copyright (c) 2015-2018 Strapi Solutions. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/packages/strapi-ejs/package.json b/packages/strapi-ejs/package.json index 75030784c8..019e8e2897 100755 --- a/packages/strapi-ejs/package.json +++ b/packages/strapi-ejs/package.json @@ -42,7 +42,7 @@ "url": "https://github.com/strapi/strapi/issues" }, "engines": { - "node": ">= 8.0.0", + "node": ">= 9.0.0", "npm": ">= 5.3.0" }, "license": "MIT" diff --git a/packages/strapi-generate-admin/LICENSE.md b/packages/strapi-generate-admin/LICENSE.md index e27c5b5d59..e02de523ba 100755 --- a/packages/strapi-generate-admin/LICENSE.md +++ b/packages/strapi-generate-admin/LICENSE.md @@ -1,4 +1,4 @@ -Copyright (c) 2015-2017 Strapi Solutions. +Copyright (c) 2015-2018 Strapi Solutions. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/packages/strapi-generate-admin/package.json b/packages/strapi-generate-admin/package.json index fcc04afac7..88f7c908a1 100755 --- a/packages/strapi-generate-admin/package.json +++ b/packages/strapi-generate-admin/package.json @@ -37,7 +37,7 @@ "url": "https://github.com/strapi/strapi/issues" }, "engines": { - "node": ">= 8.0.0", + "node": ">= 9.0.0", "npm": ">= 5.3.0" }, "license": "MIT" diff --git a/packages/strapi-generate-api/LICENSE.md b/packages/strapi-generate-api/LICENSE.md index e27c5b5d59..e02de523ba 100755 --- a/packages/strapi-generate-api/LICENSE.md +++ b/packages/strapi-generate-api/LICENSE.md @@ -1,4 +1,4 @@ -Copyright (c) 2015-2017 Strapi Solutions. +Copyright (c) 2015-2018 Strapi Solutions. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/packages/strapi-generate-api/package.json b/packages/strapi-generate-api/package.json index de09d08001..178c5d18de 100755 --- a/packages/strapi-generate-api/package.json +++ b/packages/strapi-generate-api/package.json @@ -39,7 +39,7 @@ "url": "https://github.com/strapi/strapi/issues" }, "engines": { - "node": ">= 8.0.0", + "node": ">= 9.0.0", "npm": ">= 5.3.0" }, "license": "MIT" diff --git a/packages/strapi-generate-controller/LICENSE.md b/packages/strapi-generate-controller/LICENSE.md index e27c5b5d59..e02de523ba 100755 --- a/packages/strapi-generate-controller/LICENSE.md +++ b/packages/strapi-generate-controller/LICENSE.md @@ -1,4 +1,4 @@ -Copyright (c) 2015-2017 Strapi Solutions. +Copyright (c) 2015-2018 Strapi Solutions. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/packages/strapi-generate-controller/package.json b/packages/strapi-generate-controller/package.json index a2d9bd5ca4..41ba8dc5ee 100755 --- a/packages/strapi-generate-controller/package.json +++ b/packages/strapi-generate-controller/package.json @@ -39,7 +39,7 @@ "url": "https://github.com/strapi/strapi/issues" }, "engines": { - "node": ">= 8.0.0", + "node": ">= 9.0.0", "npm": ">= 5.3.0" }, "license": "MIT" diff --git a/packages/strapi-generate-model/LICENSE.md b/packages/strapi-generate-model/LICENSE.md index e27c5b5d59..e02de523ba 100755 --- a/packages/strapi-generate-model/LICENSE.md +++ b/packages/strapi-generate-model/LICENSE.md @@ -1,4 +1,4 @@ -Copyright (c) 2015-2017 Strapi Solutions. +Copyright (c) 2015-2018 Strapi Solutions. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/packages/strapi-generate-model/package.json b/packages/strapi-generate-model/package.json index 979cd6b10a..2301efdc9a 100755 --- a/packages/strapi-generate-model/package.json +++ b/packages/strapi-generate-model/package.json @@ -39,7 +39,7 @@ "url": "https://github.com/strapi/strapi/issues" }, "engines": { - "node": ">= 8.0.0", + "node": ">= 9.0.0", "npm": ">= 5.3.0" }, "license": "MIT" diff --git a/packages/strapi-generate-new/LICENSE.md b/packages/strapi-generate-new/LICENSE.md index e27c5b5d59..e02de523ba 100755 --- a/packages/strapi-generate-new/LICENSE.md +++ b/packages/strapi-generate-new/LICENSE.md @@ -1,4 +1,4 @@ -Copyright (c) 2015-2017 Strapi Solutions. +Copyright (c) 2015-2018 Strapi Solutions. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/packages/strapi-generate-new/json/package.json.js b/packages/strapi-generate-new/json/package.json.js index 023bf36629..2c0ffd52cf 100755 --- a/packages/strapi-generate-new/json/package.json.js +++ b/packages/strapi-generate-new/json/package.json.js @@ -40,7 +40,6 @@ module.exports = scope => { 'dependencies': { 'lodash': '4.x.x', 'strapi': getDependencyVersion(cliPkg, 'strapi'), - 'strapi-upload-local': getDependencyVersion(cliPkg, 'strapi'), [scope.client.connector]: getDependencyVersion(cliPkg, 'strapi'), [scope.client.module]: scope.client.version }, diff --git a/packages/strapi-generate-new/package.json b/packages/strapi-generate-new/package.json index b66997d4e0..198f72864e 100755 --- a/packages/strapi-generate-new/package.json +++ b/packages/strapi-generate-new/package.json @@ -44,7 +44,7 @@ "url": "https://github.com/strapi/strapi/issues" }, "engines": { - "node": ">= 8.0.0", + "node": ">= 9.0.0", "npm": ">= 5.3.0" }, "license": "MIT" diff --git a/packages/strapi-generate-plugin/LICENSE.md b/packages/strapi-generate-plugin/LICENSE.md index e27c5b5d59..e02de523ba 100755 --- a/packages/strapi-generate-plugin/LICENSE.md +++ b/packages/strapi-generate-plugin/LICENSE.md @@ -1,4 +1,4 @@ -Copyright (c) 2015-2017 Strapi Solutions. +Copyright (c) 2015-2018 Strapi Solutions. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/packages/strapi-generate-plugin/package.json b/packages/strapi-generate-plugin/package.json index 29e8f493a6..6467082773 100755 --- a/packages/strapi-generate-plugin/package.json +++ b/packages/strapi-generate-plugin/package.json @@ -40,7 +40,7 @@ "url": "https://github.com/strapi/strapi/issues" }, "engines": { - "node": ">= 8.0.0", + "node": ">= 9.0.0", "npm": ">= 5.3.0" }, "license": "MIT" diff --git a/packages/strapi-generate-policy/LICENSE.md b/packages/strapi-generate-policy/LICENSE.md index e27c5b5d59..e02de523ba 100755 --- a/packages/strapi-generate-policy/LICENSE.md +++ b/packages/strapi-generate-policy/LICENSE.md @@ -1,4 +1,4 @@ -Copyright (c) 2015-2017 Strapi Solutions. +Copyright (c) 2015-2018 Strapi Solutions. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/packages/strapi-generate-policy/package.json b/packages/strapi-generate-policy/package.json index fdaf9e7d46..492c8123cc 100755 --- a/packages/strapi-generate-policy/package.json +++ b/packages/strapi-generate-policy/package.json @@ -39,7 +39,7 @@ "url": "https://github.com/strapi/strapi/issues" }, "engines": { - "node": ">= 8.0.0", + "node": ">= 9.0.0", "npm": ">= 5.3.0" }, "license": "MIT" diff --git a/packages/strapi-generate-service/LICENSE.md b/packages/strapi-generate-service/LICENSE.md index e27c5b5d59..e02de523ba 100755 --- a/packages/strapi-generate-service/LICENSE.md +++ b/packages/strapi-generate-service/LICENSE.md @@ -1,4 +1,4 @@ -Copyright (c) 2015-2017 Strapi Solutions. +Copyright (c) 2015-2018 Strapi Solutions. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/packages/strapi-generate-service/package.json b/packages/strapi-generate-service/package.json index 350919c2c6..c40e9e65bc 100755 --- a/packages/strapi-generate-service/package.json +++ b/packages/strapi-generate-service/package.json @@ -39,7 +39,7 @@ "url": "https://github.com/strapi/strapi/issues" }, "engines": { - "node": ">= 8.0.0", + "node": ">= 9.0.0", "npm": ">= 5.3.0" }, "license": "MIT" diff --git a/packages/strapi-generate/package.json b/packages/strapi-generate/package.json index 254aab1863..b911acfcb4 100755 --- a/packages/strapi-generate/package.json +++ b/packages/strapi-generate/package.json @@ -39,7 +39,7 @@ "url": "https://github.com/strapi/strapi/issues" }, "engines": { - "node": ">= 8.0.0", + "node": ">= 9.0.0", "npm": ">= 5.3.0" }, "license": "MIT" diff --git a/packages/strapi-helper-plugin/package.json b/packages/strapi-helper-plugin/package.json index eca1ec55ad..d2f7cfe0fc 100755 --- a/packages/strapi-helper-plugin/package.json +++ b/packages/strapi-helper-plugin/package.json @@ -3,7 +3,7 @@ "version": "3.0.0-alpha.10.2", "description": "Helper for Strapi plugins development", "engines": { - "node": ">= 8.0.0", + "node": ">= 9.0.0", "npm": ">= 5.3.0" }, "author": { diff --git a/packages/strapi-knex/LICENSE.md b/packages/strapi-knex/LICENSE.md index e27c5b5d59..e02de523ba 100755 --- a/packages/strapi-knex/LICENSE.md +++ b/packages/strapi-knex/LICENSE.md @@ -1,4 +1,4 @@ -Copyright (c) 2015-2017 Strapi Solutions. +Copyright (c) 2015-2018 Strapi Solutions. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/packages/strapi-knex/package.json b/packages/strapi-knex/package.json index e930307bf2..4706b40a82 100755 --- a/packages/strapi-knex/package.json +++ b/packages/strapi-knex/package.json @@ -42,7 +42,7 @@ "url": "https://github.com/strapi/strapi/issues" }, "engines": { - "node": ">= 8.0.0", + "node": ">= 9.0.0", "npm": ">= 5.0.0" }, "license": "MIT" diff --git a/packages/strapi-middleware-views/LICENSE.md b/packages/strapi-middleware-views/LICENSE.md index e27c5b5d59..e02de523ba 100755 --- a/packages/strapi-middleware-views/LICENSE.md +++ b/packages/strapi-middleware-views/LICENSE.md @@ -1,4 +1,4 @@ -Copyright (c) 2015-2017 Strapi Solutions. +Copyright (c) 2015-2018 Strapi Solutions. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/packages/strapi-middleware-views/package.json b/packages/strapi-middleware-views/package.json index ed26cc3ce3..b2a140e30c 100755 --- a/packages/strapi-middleware-views/package.json +++ b/packages/strapi-middleware-views/package.json @@ -42,7 +42,7 @@ "url": "https://github.com/strapi/strapi/issues" }, "engines": { - "node": ">= 8.0.0", + "node": ">= 9.0.0", "npm": ">= 5.3.0" }, "license": "MIT" diff --git a/packages/strapi-mongoose/LICENSE.md b/packages/strapi-mongoose/LICENSE.md index e27c5b5d59..e02de523ba 100755 --- a/packages/strapi-mongoose/LICENSE.md +++ b/packages/strapi-mongoose/LICENSE.md @@ -1,4 +1,4 @@ -Copyright (c) 2015-2017 Strapi Solutions. +Copyright (c) 2015-2018 Strapi Solutions. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/packages/strapi-mongoose/package.json b/packages/strapi-mongoose/package.json index fbbc8e9e44..9bf0a22d8f 100755 --- a/packages/strapi-mongoose/package.json +++ b/packages/strapi-mongoose/package.json @@ -44,7 +44,7 @@ "url": "https://github.com/strapi/strapi/issues" }, "engines": { - "node": ">= 8.0.0", + "node": ">= 9.0.0", "npm": ">= 5.3.0" }, "license": "MIT" diff --git a/packages/strapi-plugin-content-manager/package.json b/packages/strapi-plugin-content-manager/package.json index c4b3b538b7..5721c95ab5 100755 --- a/packages/strapi-plugin-content-manager/package.json +++ b/packages/strapi-plugin-content-manager/package.json @@ -43,7 +43,7 @@ "url": "git://github.com/strapi/strapi.git" }, "engines": { - "node": ">= 8.0.0", + "node": ">= 9.0.0", "npm": ">= 3.0.0" }, "license": "MIT" diff --git a/packages/strapi-plugin-content-type-builder/package.json b/packages/strapi-plugin-content-type-builder/package.json index 4a57137ab0..99f3eaa8a1 100755 --- a/packages/strapi-plugin-content-type-builder/package.json +++ b/packages/strapi-plugin-content-type-builder/package.json @@ -47,7 +47,7 @@ "url": "git://github.com/strapi/strapi.git" }, "engines": { - "node": ">= 8.0.0", + "node": ">= 9.0.0", "npm": ">= 3.0.0" }, "license": "MIT" diff --git a/packages/strapi-plugin-settings-manager/package.json b/packages/strapi-plugin-settings-manager/package.json index a2fcab943d..eb72c7ea67 100755 --- a/packages/strapi-plugin-settings-manager/package.json +++ b/packages/strapi-plugin-settings-manager/package.json @@ -44,7 +44,7 @@ "url": "git://github.com/strapi/strapi.git" }, "engines": { - "node": ">= 8.0.0", + "node": ">= 9.0.0", "npm": ">= 3.0.0" }, "license": "MIT" diff --git a/packages/strapi-plugin-upload/config/functions/bootstrap.js b/packages/strapi-plugin-upload/config/functions/bootstrap.js index 6a6ba86f54..18c7eb2ea3 100644 --- a/packages/strapi-plugin-upload/config/functions/bootstrap.js +++ b/packages/strapi-plugin-upload/config/functions/bootstrap.js @@ -20,10 +20,10 @@ module.exports = async cb => { name: 'upload' }); - fs.readdir(path.join(strapi.config.appPath, 'node_modules'), async (err, node_modules) => { + fs.readdir(path.join(strapi.config.appPath, 'plugins', 'upload', 'node_modules'), async (err, node_modules) => { // get all upload provider const uploads = _.filter(node_modules, (node_module) => { - return _.startsWith(node_module, ('strapi-upload-')); + return _.startsWith(node_module, ('strapi-upload')); }); strapi.plugins.upload.config.providers = []; @@ -31,16 +31,16 @@ module.exports = async cb => { // mount all providers to get configs _.forEach(uploads, (node_module) => { strapi.plugins.upload.config.providers.push( - require(path.join(`${strapi.config.appPath}/node_modules/${node_module}`)) + require(path.join(`${strapi.config.appPath}/plugins/upload/node_modules/${node_module}`)) ); }); try { - // if profiver config not exit set one by default + // if provider config not exit set one by default const config = await pluginStore.get({key: 'provider'}); if (!config) { - const provider = strapi.plugins.upload.config.providers[0]; + const provider = _.find(strapi.plugins.upload.config.providers, {provider: 'local'}); const value = _.assign({}, provider, { enabled: true, @@ -51,8 +51,8 @@ module.exports = async cb => { await pluginStore.set({key: 'provider', value}); } } catch (err) { - strapi.log.error(`Can't laod ${config.provider} upload provider`); - strapi.log.warn(`Please install strapi-upload-${config.provider} --save`); + strapi.log.error(`Can't load ${config.provider} upload provider.`); + strapi.log.warn(`Please install strapi-upload-${config.provider} --save in ${path.join(strapi.config.appPath, 'plugins', 'upload')} folder.`); strapi.stop(); } diff --git a/packages/strapi-plugin-upload/controllers/Upload.js b/packages/strapi-plugin-upload/controllers/Upload.js index a6fc93ab93..0b25860ba7 100644 --- a/packages/strapi-plugin-upload/controllers/Upload.js +++ b/packages/strapi-plugin-upload/controllers/Upload.js @@ -17,7 +17,6 @@ module.exports = { */ index: async (ctx) => { - console.log(ctx.request.body.files); const config = await strapi.store({ environment: strapi.config.environment, type: 'plugin', @@ -35,7 +34,7 @@ module.exports = { for (var i = 0; i < files.length; i++) { if (files[i].size > config.sizeLimit) { - return ctx.badRequest(null, ctx.request.admin ? [{ messages: [{ id: 'Upload.status.sizeLimit' }] }] : 'One of file is bigger than limit size!'); + return ctx.badRequest(null, ctx.request.admin ? [{ messages: [{ id: 'Upload.status.sizeLimit', values: {file: files[i].name} }] }] : `${files[i].name} file is bigger than limit size!`); } } diff --git a/packages/strapi-plugin-upload/models/File.settings.json b/packages/strapi-plugin-upload/models/File.settings.json index 5d52e9e5c1..ed33f26354 100644 --- a/packages/strapi-plugin-upload/models/File.settings.json +++ b/packages/strapi-plugin-upload/models/File.settings.json @@ -17,8 +17,7 @@ }, "ext": { "type": "string", - "configurable": false, - "required": true + "configurable": false }, "mime": { "type": "string", diff --git a/packages/strapi-plugin-upload/package.json b/packages/strapi-plugin-upload/package.json index 031b1c7a4e..e82e7c795d 100644 --- a/packages/strapi-plugin-upload/package.json +++ b/packages/strapi-plugin-upload/package.json @@ -27,6 +27,7 @@ "uuid": "^3.2.1" }, "devDependencies": { + "strapi-upload-local": "3.0.0-alpha.10.2", "strapi-helper-plugin": "3.0.0-alpha.10.2" }, "author": { diff --git a/packages/strapi-plugin-upload/services/Upload.js b/packages/strapi-plugin-upload/services/Upload.js index 39199b8479..fd7a2d02d6 100644 --- a/packages/strapi-plugin-upload/services/Upload.js +++ b/packages/strapi-plugin-upload/services/Upload.js @@ -32,7 +32,7 @@ module.exports = { return { name: stream.name, hash: uuid().replace(/-/g, ''), - ext: _.last(stream.name.split('.')), + ext: stream.name.split('.').length > 1 ? `.${_.last(stream.name.split('.'))}` : '', buffer: Buffer.concat(buffers), mime: stream.type, size: (stream.size / 1000).toFixed(2) diff --git a/packages/strapi-redis/LICENSE.md b/packages/strapi-redis/LICENSE.md index e27c5b5d59..e02de523ba 100755 --- a/packages/strapi-redis/LICENSE.md +++ b/packages/strapi-redis/LICENSE.md @@ -1,4 +1,4 @@ -Copyright (c) 2015-2017 Strapi Solutions. +Copyright (c) 2015-2018 Strapi Solutions. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/packages/strapi-redis/package.json b/packages/strapi-redis/package.json index 9330058d46..6b883d9125 100755 --- a/packages/strapi-redis/package.json +++ b/packages/strapi-redis/package.json @@ -43,7 +43,7 @@ "url": "https://github.com/strapi/strapi/issues" }, "engines": { - "node": ">= 8.0.0", + "node": ">= 9.0.0", "npm": ">= 5.3.0" }, "license": "MIT" diff --git a/packages/strapi-upload-s3/.editorconfig b/packages/strapi-upload-aws-s3/.editorconfig similarity index 100% rename from packages/strapi-upload-s3/.editorconfig rename to packages/strapi-upload-aws-s3/.editorconfig diff --git a/packages/strapi-upload-s3/.gitignore b/packages/strapi-upload-aws-s3/.gitignore similarity index 100% rename from packages/strapi-upload-s3/.gitignore rename to packages/strapi-upload-aws-s3/.gitignore diff --git a/packages/strapi-upload-s3/.npmignore b/packages/strapi-upload-aws-s3/.npmignore similarity index 100% rename from packages/strapi-upload-s3/.npmignore rename to packages/strapi-upload-aws-s3/.npmignore diff --git a/packages/strapi-upload-s3/LICENSE.md b/packages/strapi-upload-aws-s3/LICENSE.md similarity index 96% rename from packages/strapi-upload-s3/LICENSE.md rename to packages/strapi-upload-aws-s3/LICENSE.md index e27c5b5d59..e02de523ba 100644 --- a/packages/strapi-upload-s3/LICENSE.md +++ b/packages/strapi-upload-aws-s3/LICENSE.md @@ -1,4 +1,4 @@ -Copyright (c) 2015-2017 Strapi Solutions. +Copyright (c) 2015-2018 Strapi Solutions. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/packages/strapi-upload-s3/README.md b/packages/strapi-upload-aws-s3/README.md similarity index 100% rename from packages/strapi-upload-s3/README.md rename to packages/strapi-upload-aws-s3/README.md diff --git a/packages/strapi-upload-s3/lib/index.js b/packages/strapi-upload-aws-s3/lib/index.js similarity index 92% rename from packages/strapi-upload-s3/lib/index.js rename to packages/strapi-upload-aws-s3/lib/index.js index 4165292fdf..181c603c60 100644 --- a/packages/strapi-upload-s3/lib/index.js +++ b/packages/strapi-upload-aws-s3/lib/index.js @@ -9,7 +9,7 @@ const _ = require('lodash'); const AWS = require('aws-sdk'); module.exports = { - provider: 's3', + provider: 'aws-s3', name: 'Amazon Web Service S3', auth: { public: { @@ -69,12 +69,11 @@ module.exports = { return new Promise((resolve, reject) => { // upload file on S3 bucket S3.upload({ - Key: `${file.hash}.${file.ext}`, + Key: `${file.hash}${file.ext}`, Body: new Buffer(file.buffer, 'binary'), ACL: 'public-read' }, (err, data) => { if (err) { - console.log(err); return reject(err); } @@ -91,12 +90,11 @@ module.exports = { S3.deleteObjects({ Delete: { Objects: [{ - Key: `${file.hash}.${file.ext}` + Key: `${file.hash}${file.ext}` }] } }, (err, data) => { if (err) { - console.log(err); return reject(err); } diff --git a/packages/strapi-upload-s3/package.json b/packages/strapi-upload-aws-s3/package.json similarity index 90% rename from packages/strapi-upload-s3/package.json rename to packages/strapi-upload-aws-s3/package.json index b368d9a084..c1b36a261d 100644 --- a/packages/strapi-upload-s3/package.json +++ b/packages/strapi-upload-aws-s3/package.json @@ -1,5 +1,5 @@ { - "name": "strapi-upload-s3", + "name": "strapi-upload-aws-s3", "version": "3.0.0-alpha.10.2", "description": "AWS S3 provider for strapi upload", "homepage": "http://strapi.io", @@ -17,7 +17,7 @@ "aws-sdk": "^2.199.0" }, "strapi": { - "isHook": false + "isProvider": true }, "author": { "email": "hi@strapi.io", @@ -39,7 +39,7 @@ "url": "https://github.com/strapi/strapi/issues" }, "engines": { - "node": ">= 8.0.0", + "node": ">= 9.0.0", "npm": ">= 5.3.0" }, "license": "MIT" diff --git a/packages/strapi-upload-local/LICENSE.md b/packages/strapi-upload-local/LICENSE.md index e27c5b5d59..e02de523ba 100644 --- a/packages/strapi-upload-local/LICENSE.md +++ b/packages/strapi-upload-local/LICENSE.md @@ -1,4 +1,4 @@ -Copyright (c) 2015-2017 Strapi Solutions. +Copyright (c) 2015-2018 Strapi Solutions. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/packages/strapi-upload-local/lib/index.js b/packages/strapi-upload-local/lib/index.js index 12837c1036..703099568d 100644 --- a/packages/strapi-upload-local/lib/index.js +++ b/packages/strapi-upload-local/lib/index.js @@ -16,12 +16,12 @@ module.exports = { upload: (file) => { return new Promise((resolve, reject) => { // write file in public/assets folder - fs.writeFile(path.join(strapi.config.appPath, 'public', `uploads/${file.hash}.${file.ext}`), file.buffer, (err) => { + fs.writeFile(path.join(strapi.config.appPath, 'public', `uploads/${file.hash}${file.ext}`), file.buffer, (err) => { if (err) { return reject(err); } - file.url = `/uploads/${file.hash}.${file.ext}`; + file.url = `/uploads/${file.hash}${file.ext}`; resolve(); }); @@ -29,8 +29,14 @@ module.exports = { }, delete: (file) => { return new Promise((resolve, reject) => { + const filePath = path.join(strapi.config.appPath, 'public', `uploads/${file.hash}${file.ext}`); + + if (!fs.existsSync(filePath)) { + return resolve('File doesn\'t exist'); + } + // remove file from public/assets folder - fs.unlink(path.join(strapi.config.appPath, 'public', file.url), (err) => { + fs.unlink(filePath, (err) => { if (err) { return reject(err); } diff --git a/packages/strapi-upload-local/package.json b/packages/strapi-upload-local/package.json index 261144dc8f..c38f58b094 100644 --- a/packages/strapi-upload-local/package.json +++ b/packages/strapi-upload-local/package.json @@ -13,7 +13,7 @@ "main": "./lib", "dependencies": {}, "strapi": { - "isHook": false + "isProvider": true }, "author": { "email": "hi@strapi.io", @@ -35,7 +35,7 @@ "url": "https://github.com/strapi/strapi/issues" }, "engines": { - "node": ">= 8.0.0", + "node": ">= 9.0.0", "npm": ">= 5.3.0" }, "license": "MIT" diff --git a/packages/strapi-utils/LICENSE.md b/packages/strapi-utils/LICENSE.md index cc579c13ab..e5988d638b 100755 --- a/packages/strapi-utils/LICENSE.md +++ b/packages/strapi-utils/LICENSE.md @@ -1,4 +1,4 @@ -Copyright (c) 2015-2017 Strapi Solutions. +Copyright (c) 2015-2018 Strapi Solutions. Copyright (c) 2017, Vandium Software Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/packages/strapi-utils/package.json b/packages/strapi-utils/package.json index 27686aed77..5352641858 100755 --- a/packages/strapi-utils/package.json +++ b/packages/strapi-utils/package.json @@ -41,7 +41,7 @@ "url": "https://github.com/strapi/strapi/issues" }, "engines": { - "node": ">= 8.0.0", + "node": ">= 9.0.0", "npm": ">= 5.3.0" }, "license": "MIT" diff --git a/packages/strapi/LICENSE.md b/packages/strapi/LICENSE.md index e27c5b5d59..e02de523ba 100755 --- a/packages/strapi/LICENSE.md +++ b/packages/strapi/LICENSE.md @@ -1,4 +1,4 @@ -Copyright (c) 2015-2017 Strapi Solutions. +Copyright (c) 2015-2018 Strapi Solutions. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/packages/strapi/package.json b/packages/strapi/package.json index d7ea7e7d0d..34b61aede4 100755 --- a/packages/strapi/package.json +++ b/packages/strapi/package.json @@ -84,7 +84,7 @@ "url": "https://github.com/strapi/strapi/issues" }, "engines": { - "node": ">= 8.0.0", + "node": ">= 9.0.0", "npm": ">= 5.3.0" }, "preferGlobal": true, diff --git a/scripts/setup.js b/scripts/setup.js index 5ff15148d4..7018bcef3a 100755 --- a/scripts/setup.js +++ b/scripts/setup.js @@ -107,7 +107,7 @@ watcher('🏗 Building...', 'npm run build'); shell.cd('../strapi-upload-local'); watcher('📦 Linking strapi-plugin-upload...', 'npm link --no-optional', false); -shell.cd('../strapi-upload-s3'); +shell.cd('../strapi-upload-aws-s3'); watcher('📦 Linking strapi-plugin-upload...', 'npm link --no-optional', false); shell.cd('../strapi-plugin-content-type-builder');