diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0fbdca6cce..7b1dda35ae 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -32,6 +32,8 @@ If you send a pull request, please do it against the `master` branch. We are dev ## Setup Development Environment To facilitate the contribution, we drastically reduce the amount of commands necessary to install the entire development environment. First of all, you need to check if you're using the [required versions of Node.js and npm](https://strapi.io/documentation/3.x.x/getting-started/installation.html#requirements) +**Note: Fish shell users** - due to the way fish shell deals with symlinks, the following steps will not work. + Then, please follow the instructions below: #### 1. ▪️ Fork the repository diff --git a/docs/3.x.x/cli/CLI.md b/docs/3.x.x/cli/CLI.md index 5ed7c01e84..9ebe1d6b9e 100644 --- a/docs/3.x.x/cli/CLI.md +++ b/docs/3.x.x/cli/CLI.md @@ -10,7 +10,7 @@ Create a new project ```bash strapi new -options: [--dev|--dbclient= --dbhost= --dbport= --dbname= --dbusername= --dbpassword= --dbssl= --dbauth=] +options: [--dev|--debug|--dbclient= --dbhost= --dbport= --dbname= --dbusername= --dbpassword= --dbssl= --dbauth= --dbforce] ``` - **strapi new <name>**
@@ -18,11 +18,16 @@ options: [--dev|--dbclient= --dbhost= --dbport= --dbna - **strapi new <name> --dev**
Generates a new project called **<name>** and creates symlinks for the `./admin` folder and each plugin inside the `./plugin` folder. It means that the Strapi's development workflow has been set up on the machine earlier. + +- **strapi new <name> --debug**
+ Will display the full error message if one is fired during the database connection. + +- **strapi new <name> --dbclient=<dbclient> --dbhost=<dbhost> --dbport=<dbport> --dbname=<dbname> --dbusername=<dbusername> --dbpassword=<dbpassword> --dbssl=<dbssl> --dbauth=<dbauth> --dbforce**
-- **strapi new <name> --dbclient=<dbclient> --dbhost=<dbhost> --dbport=<dbport> --dbname=<dbname> --dbusername=<dbusername> --dbpassword=<dbpassword> --dbssl=<dbssl> --dbauth=<dbauth>**
Generates a new project called **<name>** and skip the interactive database configuration and initilize with these options. - **<dbclient>** can be `mongo`, `postgres`, `mysql`. - **<dbssl>** and **<dbauth>** are available only for `mongo` and are optional. + - **--dbforce** Allows you to overwrite content if the provided database is not empty. Only available for `postgres`, `mysql`, and is optional. See the [CONTRIBUTING guide](https://github.com/strapi/strapi/blob/master/CONTRIBUTING.md) for more details. diff --git a/docs/3.x.x/guides/models.md b/docs/3.x.x/guides/models.md index c286de9bc6..fd9b43071e 100644 --- a/docs/3.x.x/guides/models.md +++ b/docs/3.x.x/guides/models.md @@ -148,6 +148,17 @@ module.exports = { } ``` +**Example** +```js +// Create a pet +const xhr = new XMLHttpRequest(); +xhr.open('POST', '/pets', true); +xhr.setRequestHeader('Content-Type', 'application/json'); +xhr.send(JSON.stringify({ + owner: '5c151d9d5b1d55194d3209be' // The id of the user you want to link +})); +``` + ### One-to-one Refer to the [one-to-one concept](../concepts/concepts.md#one-to-one) for informations. @@ -211,6 +222,17 @@ module.exports = { } ``` +**Example** +```js +// Create an address +const xhr = new XMLHttpRequest(); +xhr.open('POST', '/addresses', true); +xhr.setRequestHeader('Content-Type', 'application/json'); +xhr.send(JSON.stringify({ + user: '5c151d9d5b1d55194d3209be' // The id of the user you want to link +})); +``` + ### One-to-many Refer to the [one-to-many concept](../concepts/concepts.md#one-to-many) for more informations. @@ -274,6 +296,25 @@ module.exports = { } ``` +**Examples** +```js +// Create an article +const xhr = new XMLHttpRequest(); +xhr.open('POST', '/articles', true); +xhr.setRequestHeader('Content-Type', 'application/json'); +xhr.send(JSON.stringify({ + author: '5c151d9d5b1d55194d3209be' // The id of the user you want to link +})); + +// Update an article +const xhr = new XMLHttpRequest(); +xhr.open('PUT', '/users/5c151d9d5b1d55194d3209be', true); +xhr.setRequestHeader('Content-Type', 'application/json'); +xhr.send(JSON.stringify({ + articles: ['5c151d51eb28fd19457189f6', '5c151d51eb28fd19457189f8'] // Set of ALL articles linked to the user (existing articles + new article or - removed article) +})); +``` + ### Many-to-many Refer to the [many-to-many concept](../concepts/concepts.md#many-to-many). @@ -343,6 +384,17 @@ module.exports = { } ``` +**Example** +```js +// Update a product +const xhr = new XMLHttpRequest(); +xhr.open('PUT', '/products/5c151d9d5b1d55194d3209be', true); +xhr.setRequestHeader('Content-Type', 'application/json'); +xhr.send(JSON.stringify({ + categories: ['5c151d51eb28fd19457189f6', '5c151d51eb28fd19457189f8'] // Set of ALL categories linked to the product (existing categories + new category or - removed category) +})); +``` + ### Polymorphic The polymorphic relationships are the solution when you don't know which kind of model will be associated to your entry. A common use case is an `Image` model that can be associated to many others kind of models (Article, Product, User, etc). diff --git a/docs/3.x.x/migration-guide/README.md b/docs/3.x.x/migration-guide/README.md index c6d199d02b..000a49d734 100644 --- a/docs/3.x.x/migration-guide/README.md +++ b/docs/3.x.x/migration-guide/README.md @@ -24,3 +24,4 @@ - [Migration guide from alpha.15 to alpha.16](migration-guide-alpha.15-to-alpha.16.md) - [Migration guide from alpha.15 to alpha.16](migration-guide-alpha.15-to-alpha.16.md) - [Migration guide from alpha.16 to alpha.17](migration-guide-alpha.16-to-alpha.17.md) +- [Migration guide from alpha.17 to alpha.18](migration-guide-alpha.17-to-alpha.18.md) diff --git a/docs/3.x.x/migration-guide/migration-guide-alpha.17-to-alpha.18.md b/docs/3.x.x/migration-guide/migration-guide-alpha.17-to-alpha.18.md new file mode 100644 index 0000000000..048f573b62 --- /dev/null +++ b/docs/3.x.x/migration-guide/migration-guide-alpha.17-to-alpha.18.md @@ -0,0 +1,59 @@ +# Migration guide from alpha.17 to alpha.18 + +**Here are the major changes:** + +- Improve debug on strapi new +- Apollo server tracing in GraphQL +- Fix cors + +**Useful links:** +- Changelog: [https://github.com/strapi/strapi/releases/tag/v3.0.0-alpha.18](https://github.com/strapi/strapi/releases/tag/v3.0.0-alpha.18) +- GitHub diff: [https://github.com/strapi/strapi/compare/v3.0.0-alpha.17...v3.0.0-alpha.18](https://github.com/strapi/strapi/compare/v3.0.0-alpha.17...v3.0.0-alpha.18) + +
+ +::: note +Feel free to [join us on Slack](http://slack.strapi.io) and ask questions about the migration process. +::: + +
+ +## Getting started + +Install Strapi `alpha.18` globally on your computer. To do so run `npm install strapi@3.0.0-alpha.18 -g`. + +When it's done, generate a new empty project `strapi new myNewProject` (don't pay attention to the database configuration). + +
+ +## Update node modules + +Update the Strapi's dependencies version (move Strapi's dependencies to `3.0.0-alpha.18` version) of your project. + +Run `npm install strapi@3.0.0-alpha.18 --save` to update your strapi version. + +
+ +## Update the Admin + +::: note +If you performed updates in the Admin, you will have to manually migrate your changes. +::: + +Delete your old admin folder and replace it with the new one. + +
+ +## Update the Plugins + +::: note +If you did a custom update on one of the plugins, you will have to manually migrate your update. +::: + +Copy the fields and relations you had in your `/plugins/users-permissions/models/User.settings.json` file in the new one. + +Then, delete your old `plugins` folder and replace it with the new one. + +
+ +That's all, you have now upgraded to Strapi `alpha.18`. diff --git a/package.json b/package.json index 954176f379..3df98bc00a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "private": true, - "version": "3.0.0-alpha.17", + "version": "3.0.0-alpha.18", "dependencies": {}, "devDependencies": { "assert": "~1.3.0", diff --git a/packages/strapi-admin/package.json b/packages/strapi-admin/package.json index 07f7ee5d6e..b9518fed2a 100644 --- a/packages/strapi-admin/package.json +++ b/packages/strapi-admin/package.json @@ -1,6 +1,6 @@ { "name": "strapi-admin", - "version": "3.0.0-alpha.17", + "version": "3.0.0-alpha.18", "description": "Strapi Admin", "repository": { "type": "git", @@ -31,8 +31,8 @@ }, "devDependencies": { "sanitize.css": "^4.1.0", - "strapi-helper-plugin": "3.0.0-alpha.17", - "strapi-utils": "3.0.0-alpha.17" + "strapi-helper-plugin": "3.0.0-alpha.18", + "strapi-utils": "3.0.0-alpha.18" }, "author": { "name": "Strapi", diff --git a/packages/strapi-generate-admin/package.json b/packages/strapi-generate-admin/package.json index 3fd96ea202..28264fb9ef 100644 --- a/packages/strapi-generate-admin/package.json +++ b/packages/strapi-generate-admin/package.json @@ -1,6 +1,6 @@ { "name": "strapi-generate-admin", - "version": "3.0.0-alpha.17", + "version": "3.0.0-alpha.18", "description": "Generate the default admin panel for a Strapi application.", "homepage": "http://strapi.io", "keywords": [ @@ -15,8 +15,8 @@ "dependencies": { "fs-extra": "^4.0.1", "lodash": "^4.17.5", - "strapi-admin": "3.0.0-alpha.17", - "strapi-utils": "3.0.0-alpha.17" + "strapi-admin": "3.0.0-alpha.18", + "strapi-utils": "3.0.0-alpha.18" }, "author": { "email": "hi@strapi.io", diff --git a/packages/strapi-generate-api/package.json b/packages/strapi-generate-api/package.json index 27d6545286..9ade023cf8 100644 --- a/packages/strapi-generate-api/package.json +++ b/packages/strapi-generate-api/package.json @@ -1,6 +1,6 @@ { "name": "strapi-generate-api", - "version": "3.0.0-alpha.17", + "version": "3.0.0-alpha.18", "description": "Generate an API for a Strapi application.", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-generate-controller/package.json b/packages/strapi-generate-controller/package.json index 41eb822a8b..fbdd4638c4 100644 --- a/packages/strapi-generate-controller/package.json +++ b/packages/strapi-generate-controller/package.json @@ -1,6 +1,6 @@ { "name": "strapi-generate-controller", - "version": "3.0.0-alpha.17", + "version": "3.0.0-alpha.18", "description": "Generate a controller for a Strapi API.", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-generate-model/package.json b/packages/strapi-generate-model/package.json index 0ca6438af8..c030aca1ea 100644 --- a/packages/strapi-generate-model/package.json +++ b/packages/strapi-generate-model/package.json @@ -1,6 +1,6 @@ { "name": "strapi-generate-model", - "version": "3.0.0-alpha.17", + "version": "3.0.0-alpha.18", "description": "Generate a model for a Strapi API.", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-generate-new/lib/before.js b/packages/strapi-generate-new/lib/before.js index bc69e93e2e..3bdce44d98 100644 --- a/packages/strapi-generate-new/lib/before.js +++ b/packages/strapi-generate-new/lib/before.js @@ -226,6 +226,7 @@ module.exports = (scope, cb) => { } let cmd = `${packageCmd} ${scope.client.connector}@${scope.strapiPackageJSON.version}`; + let linkNodeModulesCommand = `cd ${scope.tmpPath} && npm link ${scope.client.connector}`; if (scope.client.module) { cmd += ` ${scope.client.module}`; @@ -233,6 +234,7 @@ module.exports = (scope, cb) => { if (scope.client.connector === 'strapi-hook-bookshelf') { cmd += ` strapi-hook-knex@${scope.strapiPackageJSON.version}`; + linkNodeModulesCommand += ` && npm link strapi-hook-knex`; scope.additionalsDependencies = ['strapi-hook-knex', 'knex']; } @@ -248,7 +250,13 @@ module.exports = (scope, cb) => { } } - resolve(); + if (scope.developerMode) { + exec(linkNodeModulesCommand, () => { + resolve(); + }); + } else { + resolve(); + } }); }) ]; @@ -258,8 +266,8 @@ module.exports = (scope, cb) => { try { require(path.join(`${scope.tmpPath}`, '/node_modules/', `${scope.client.connector}/lib/utils/connectivity.js`))(scope, cb.success, connectionValidation); } catch(err) { - shell.rm('-r', scope.tmpPath); console.log(err); + shell.rm('-r', scope.tmpPath); cb.error(); } }); diff --git a/packages/strapi-generate-new/package.json b/packages/strapi-generate-new/package.json index fdfb911a97..daa5f2aa0e 100644 --- a/packages/strapi-generate-new/package.json +++ b/packages/strapi-generate-new/package.json @@ -1,6 +1,6 @@ { "name": "strapi-generate-new", - "version": "3.0.0-alpha.17", + "version": "3.0.0-alpha.18", "description": "Generate a new Strapi application.", "homepage": "http://strapi.io", "keywords": [ @@ -19,7 +19,7 @@ "listr": "^0.14.1", "lodash": "^4.17.5", "ora": "^2.1.0", - "strapi-utils": "3.0.0-alpha.17", + "strapi-utils": "3.0.0-alpha.18", "uuid": "^3.1.0" }, "scripts": { diff --git a/packages/strapi-generate-plugin/package.json b/packages/strapi-generate-plugin/package.json index 367b219abd..7f0aa48f52 100644 --- a/packages/strapi-generate-plugin/package.json +++ b/packages/strapi-generate-plugin/package.json @@ -1,6 +1,6 @@ { "name": "strapi-generate-plugin", - "version": "3.0.0-alpha.17", + "version": "3.0.0-alpha.18", "description": "Generate an plugin for a Strapi application.", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-generate-policy/package.json b/packages/strapi-generate-policy/package.json index 438fc4ee28..c956efe970 100644 --- a/packages/strapi-generate-policy/package.json +++ b/packages/strapi-generate-policy/package.json @@ -1,6 +1,6 @@ { "name": "strapi-generate-policy", - "version": "3.0.0-alpha.17", + "version": "3.0.0-alpha.18", "description": "Generate a policy for a Strapi API.", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-generate-service/package.json b/packages/strapi-generate-service/package.json index 8c3cb65f21..a6477e7dc2 100644 --- a/packages/strapi-generate-service/package.json +++ b/packages/strapi-generate-service/package.json @@ -1,6 +1,6 @@ { "name": "strapi-generate-service", - "version": "3.0.0-alpha.17", + "version": "3.0.0-alpha.18", "description": "Generate a service for a Strapi API.", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-generate/package.json b/packages/strapi-generate/package.json index a25695987a..4530ae077b 100644 --- a/packages/strapi-generate/package.json +++ b/packages/strapi-generate/package.json @@ -1,6 +1,6 @@ { "name": "strapi-generate", - "version": "3.0.0-alpha.17", + "version": "3.0.0-alpha.18", "description": "Master of ceremonies for the Strapi generators.", "homepage": "http://strapi.io", "keywords": [ @@ -17,7 +17,7 @@ "fs-extra": "^4.0.0", "lodash": "^4.17.5", "reportback": "^2.0.1", - "strapi-utils": "3.0.0-alpha.17" + "strapi-utils": "3.0.0-alpha.18" }, "author": { "name": "Strapi team", diff --git a/packages/strapi-helper-plugin/package.json b/packages/strapi-helper-plugin/package.json index 3599bd6be5..83df546fe6 100644 --- a/packages/strapi-helper-plugin/package.json +++ b/packages/strapi-helper-plugin/package.json @@ -1,6 +1,6 @@ { "name": "strapi-helper-plugin", - "version": "3.0.0-alpha.17", + "version": "3.0.0-alpha.18", "description": "Helper for Strapi plugins development", "engines": { "node": ">= 10.0.0", diff --git a/packages/strapi-hook-bookshelf/lib/utils/connectivity.js b/packages/strapi-hook-bookshelf/lib/utils/connectivity.js index 34671904b7..97f6a5b5cc 100644 --- a/packages/strapi-hook-bookshelf/lib/utils/connectivity.js +++ b/packages/strapi-hook-bookshelf/lib/utils/connectivity.js @@ -1,12 +1,24 @@ 'use strict'; +// Core +const path = require('path'); + // Public node modules const inquirer = require('inquirer'); const rimraf = require('rimraf'); module.exports = (scope, success, error) => { - // eslint-disable-next-line import/no-unresolved - const knex = require('knex')({ + let knex; + + try { + // eslint-disable-next-line import/no-unresolved + knex = require('knex'); + } catch (err) { + // eslint-disable-next-line import/no-unresolved + knex = require(path.resolve(scope.tmpPath, 'node_modules', 'knex')); + } + + knex = knex({ client: scope.client.module, connection: Object.assign({}, scope.database.settings, { user: scope.database.settings.username @@ -27,20 +39,24 @@ module.exports = (scope, success, error) => { }; if (tables.rows && tables.rows.length !== 0) { - console.log('🤔 It seems that your database is not empty. Be aware that Strapi is going to automatically creates tables & columns, and might update columns which can corrupt data or cause data loss.'); + if (scope.dbforce) { + next(); + } else { + console.log('🤔 It seems that your database is not empty. Be aware that Strapi is going to automatically creates tables & columns, and might update columns which can corrupt data or cause data loss.'); - inquirer.prompt([{ - type: 'confirm', - name: 'confirm', - message: `Are you sure you want to continue with the ${scope.database.settings.database} database:`, - }]) - .then(({ confirm }) => { - if (confirm) { - next(); - } else { - error(); - } - }); + inquirer.prompt([{ + type: 'confirm', + name: 'confirm', + message: `Are you sure you want to continue with the ${scope.database.settings.database} database:`, + }]) + .then(({ confirm }) => { + if (confirm) { + next(); + } else { + error(); + } + }); + } } else { next(); } @@ -48,10 +64,16 @@ module.exports = (scope, success, error) => { }) .catch((err) => { if (err.sql) { - console.log('⚠️ Server connection has failed! Make sure your database server is running.'); + console.log('⚠️ Server connection has failed! Make sure your database server is running.'); } else { - console.log(`⚠️ Database connection has failed! Make sure your "${scope.database.settings.database}" database exist.`); + console.log(`⚠️ Database connection has failed! Make sure your "${scope.database.settings.database}" database exist.`); } + + if (scope.debug) { + console.log('🐛 Full error log:'); + console.log(err); + } + error(); }); }; diff --git a/packages/strapi-hook-bookshelf/package.json b/packages/strapi-hook-bookshelf/package.json index 2a02e9b4ed..f0104486bc 100644 --- a/packages/strapi-hook-bookshelf/package.json +++ b/packages/strapi-hook-bookshelf/package.json @@ -1,6 +1,6 @@ { "name": "strapi-hook-bookshelf", - "version": "3.0.0-alpha.17", + "version": "3.0.0-alpha.18", "description": "Bookshelf hook for the Strapi framework", "homepage": "http://strapi.io", "keywords": [ @@ -21,8 +21,8 @@ "lodash": "^4.17.5", "pluralize": "^6.0.0", "rimraf": "^2.6.2", - "strapi-hook-knex": "3.0.0-alpha.17", - "strapi-utils": "3.0.0-alpha.17" + "strapi-hook-knex": "3.0.0-alpha.18", + "strapi-utils": "3.0.0-alpha.18" }, "strapi": { "dependencies": [ diff --git a/packages/strapi-hook-ejs/package.json b/packages/strapi-hook-ejs/package.json index b5f93ad0b0..fb5f497570 100644 --- a/packages/strapi-hook-ejs/package.json +++ b/packages/strapi-hook-ejs/package.json @@ -1,6 +1,6 @@ { "name": "strapi-hook-ejs", - "version": "3.0.0-alpha.17", + "version": "3.0.0-alpha.18", "description": "EJS hook for the Strapi framework", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-hook-knex/package.json b/packages/strapi-hook-knex/package.json index 8fa339e824..639fec3a5a 100644 --- a/packages/strapi-hook-knex/package.json +++ b/packages/strapi-hook-knex/package.json @@ -1,6 +1,6 @@ { "name": "strapi-hook-knex", - "version": "3.0.0-alpha.17", + "version": "3.0.0-alpha.18", "description": "Knex hook for the Strapi framework", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-hook-mongoose/lib/utils/connectivity.js b/packages/strapi-hook-mongoose/lib/utils/connectivity.js index 214ab4196b..f2addd4b0c 100644 --- a/packages/strapi-hook-mongoose/lib/utils/connectivity.js +++ b/packages/strapi-hook-mongoose/lib/utils/connectivity.js @@ -29,7 +29,13 @@ module.exports = (scope, success, error) => { Mongoose.connect(`mongodb${srv ? '+srv' : ''}://${scope.database.settings.host}${!srv ? `:${scope.database.settings.port}` : ''}/`, connectOptions, function (err) { if (err) { - console.log('⚠️ Database connection has failed! Make sure your database is running.'); + console.log('⚠️ Database connection has failed! Make sure your database is running.'); + + if (scope.debug) { + console.log('🐛 Full error log:'); + console.log(err); + } + return error(); } diff --git a/packages/strapi-hook-mongoose/package.json b/packages/strapi-hook-mongoose/package.json index ce638194ec..eb4f8d46e8 100644 --- a/packages/strapi-hook-mongoose/package.json +++ b/packages/strapi-hook-mongoose/package.json @@ -1,6 +1,6 @@ { "name": "strapi-hook-mongoose", - "version": "3.0.0-alpha.17", + "version": "3.0.0-alpha.18", "description": "Mongoose hook for the Strapi framework", "homepage": "http://strapi.io", "keywords": [ @@ -20,7 +20,7 @@ "mongoose-float": "^1.0.3", "pluralize": "^6.0.0", "rimraf": "^2.6.2", - "strapi-utils": "3.0.0-alpha.17" + "strapi-utils": "3.0.0-alpha.18" }, "author": { "email": "hi@strapi.io", diff --git a/packages/strapi-hook-redis/package.json b/packages/strapi-hook-redis/package.json index 51f346748a..26b965c73f 100644 --- a/packages/strapi-hook-redis/package.json +++ b/packages/strapi-hook-redis/package.json @@ -1,6 +1,6 @@ { "name": "strapi-hook-redis", - "version": "3.0.0-alpha.17", + "version": "3.0.0-alpha.18", "description": "Redis hook for the Strapi framework", "homepage": "http://strapi.io", "keywords": [ @@ -19,7 +19,7 @@ "lodash": "^4.17.5", "rimraf": "^2.6.2", "stack-trace": "0.0.10", - "strapi-utils": "3.0.0-alpha.17" + "strapi-utils": "3.0.0-alpha.18" }, "author": { "email": "hi@strapi.io", diff --git a/packages/strapi-lint/package.json b/packages/strapi-lint/package.json index 99aca6e232..0b68645a0d 100644 --- a/packages/strapi-lint/package.json +++ b/packages/strapi-lint/package.json @@ -1,6 +1,6 @@ { "name": "strapi-lint", - "version": "3.0.0-alpha.17", + "version": "3.0.0-alpha.18", "description": "Strapi eslint and prettier configurations", "directories": { "lib": "lib" diff --git a/packages/strapi-middleware-views/package.json b/packages/strapi-middleware-views/package.json index 26422cb5c1..85b8e80616 100644 --- a/packages/strapi-middleware-views/package.json +++ b/packages/strapi-middleware-views/package.json @@ -1,6 +1,6 @@ { "name": "strapi-middleware-views", - "version": "3.0.0-alpha.17", + "version": "3.0.0-alpha.18", "description": "Views middleware to enable server-side rendering for the Strapi framework", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-plugin-content-manager/package.json b/packages/strapi-plugin-content-manager/package.json index f47e64ce26..4470a36399 100644 --- a/packages/strapi-plugin-content-manager/package.json +++ b/packages/strapi-plugin-content-manager/package.json @@ -1,6 +1,6 @@ { "name": "strapi-plugin-content-manager", - "version": "3.0.0-alpha.17", + "version": "3.0.0-alpha.18", "description": "A powerful UI to easily manage your data.", "strapi": { "name": "Content Manager", @@ -26,7 +26,7 @@ "draft-js": "^0.10.5", "react-select": "^1.2.1", "showdown": "^1.8.6", - "strapi-helper-plugin": "3.0.0-alpha.17" + "strapi-helper-plugin": "3.0.0-alpha.18" }, "dependencies": { "pluralize": "^7.0.0" diff --git a/packages/strapi-plugin-content-type-builder/package.json b/packages/strapi-plugin-content-type-builder/package.json index 0c3e129b31..248ed8c09b 100644 --- a/packages/strapi-plugin-content-type-builder/package.json +++ b/packages/strapi-plugin-content-type-builder/package.json @@ -1,6 +1,6 @@ { "name": "strapi-plugin-content-type-builder", - "version": "3.0.0-alpha.17", + "version": "3.0.0-alpha.18", "description": "Strapi plugin to create content type (API).", "strapi": { "name": "Content Type Builder", @@ -24,11 +24,11 @@ "dependencies": { "immutable": "^3.8.2", "pluralize": "^7.0.0", - "strapi-generate": "3.0.0-alpha.17", - "strapi-generate-api": "3.0.0-alpha.17" + "strapi-generate": "3.0.0-alpha.18", + "strapi-generate-api": "3.0.0-alpha.18" }, "devDependencies": { - "strapi-helper-plugin": "3.0.0-alpha.17" + "strapi-helper-plugin": "3.0.0-alpha.18" }, "author": { "name": "Strapi team", diff --git a/packages/strapi-plugin-documentation/package.json b/packages/strapi-plugin-documentation/package.json index c061827574..ef58a8d1da 100755 --- a/packages/strapi-plugin-documentation/package.json +++ b/packages/strapi-plugin-documentation/package.json @@ -1,6 +1,6 @@ { "name": "strapi-plugin-documentation", - "version": "3.0.0-alpha.17", + "version": "3.0.0-alpha.18", "description": "This is the description of the plugin.", "strapi": { "name": "Documentation", @@ -29,7 +29,7 @@ "swagger-ui-dist": "^3.18.3-republish2" }, "devDependencies": { - "strapi-helper-plugin": "3.0.0-alpha.17" + "strapi-helper-plugin": "3.0.0-alpha.18" }, "author": { "name": "soupette", diff --git a/packages/strapi-plugin-email/package.json b/packages/strapi-plugin-email/package.json index 20bf93b1b0..fcc3b1a40e 100644 --- a/packages/strapi-plugin-email/package.json +++ b/packages/strapi-plugin-email/package.json @@ -1,6 +1,6 @@ { "name": "strapi-plugin-email", - "version": "3.0.0-alpha.17", + "version": "3.0.0-alpha.18", "description": "This is the description of the plugin.", "strapi": { "name": "Email", @@ -22,11 +22,11 @@ "prepublishOnly": "IS_MONOREPO=true npm run build" }, "dependencies": { - "strapi-provider-email-sendmail": "3.0.0-alpha.17" + "strapi-provider-email-sendmail": "3.0.0-alpha.18" }, "devDependencies": { "react-copy-to-clipboard": "5.0.1", - "strapi-helper-plugin": "3.0.0-alpha.17" + "strapi-helper-plugin": "3.0.0-alpha.18" }, "author": { "name": "Strapi team", diff --git a/packages/strapi-plugin-graphql/package.json b/packages/strapi-plugin-graphql/package.json index 349f038f57..47d96fb787 100644 --- a/packages/strapi-plugin-graphql/package.json +++ b/packages/strapi-plugin-graphql/package.json @@ -1,6 +1,6 @@ { "name": "strapi-plugin-graphql", - "version": "3.0.0-alpha.17", + "version": "3.0.0-alpha.18", "description": "This is the description of the plugin.", "strapi": { "name": "graphql", @@ -30,7 +30,7 @@ "graphql-type-json": "^0.2.1", "graphql-type-datetime": "^0.2.2", "pluralize": "^7.0.0", - "strapi-utils": "3.0.0-alpha.17" + "strapi-utils": "3.0.0-alpha.18" }, "author": { "name": "A Strapi developer", diff --git a/packages/strapi-plugin-settings-manager/package.json b/packages/strapi-plugin-settings-manager/package.json index e0548a4aad..bb764771a4 100644 --- a/packages/strapi-plugin-settings-manager/package.json +++ b/packages/strapi-plugin-settings-manager/package.json @@ -1,6 +1,6 @@ { "name": "strapi-plugin-settings-manager", - "version": "3.0.0-alpha.17", + "version": "3.0.0-alpha.18", "description": "Strapi plugin to manage settings.", "strapi": { "name": "Settings Manager", @@ -25,7 +25,7 @@ "devDependencies": { "flag-icon-css": "^2.8.0", "react-select": "^1.0.0-rc.5", - "strapi-helper-plugin": "3.0.0-alpha.17" + "strapi-helper-plugin": "3.0.0-alpha.18" }, "author": { "name": "Strapi team", diff --git a/packages/strapi-plugin-upload/package.json b/packages/strapi-plugin-upload/package.json index 38d3557d39..0ce4d7d143 100644 --- a/packages/strapi-plugin-upload/package.json +++ b/packages/strapi-plugin-upload/package.json @@ -1,6 +1,6 @@ { "name": "strapi-plugin-upload", - "version": "3.0.0-alpha.17", + "version": "3.0.0-alpha.18", "description": "This is the description of the plugin.", "strapi": { "name": "Files Upload", @@ -22,12 +22,12 @@ "prepublishOnly": "IS_MONOREPO=true npm run build" }, "dependencies": { - "strapi-provider-upload-local": "3.0.0-alpha.17", + "strapi-provider-upload-local": "3.0.0-alpha.18", "stream-to-array": "^2.3.0", "uuid": "^3.2.1" }, "devDependencies": { - "strapi-helper-plugin": "3.0.0-alpha.17" + "strapi-helper-plugin": "3.0.0-alpha.18" }, "author": { "name": "A Strapi developer", diff --git a/packages/strapi-plugin-users-permissions/package.json b/packages/strapi-plugin-users-permissions/package.json index 7dbb574de9..c276ad5026 100644 --- a/packages/strapi-plugin-users-permissions/package.json +++ b/packages/strapi-plugin-users-permissions/package.json @@ -1,6 +1,6 @@ { "name": "strapi-plugin-users-permissions", - "version": "3.0.0-alpha.17", + "version": "3.0.0-alpha.18", "description": "Protect your API with a full-authentication process based on JWT", "strapi": { "name": "Roles & Permissions", @@ -29,11 +29,11 @@ "koa2-ratelimit": "^0.6.1", "purest": "^2.0.1", "request": "^2.83.0", - "strapi-utils": "3.0.0-alpha.17", + "strapi-utils": "3.0.0-alpha.18", "uuid": "^3.1.0" }, "devDependencies": { - "strapi-helper-plugin": "3.0.0-alpha.17" + "strapi-helper-plugin": "3.0.0-alpha.18" }, "author": { "name": "Strapi team", diff --git a/packages/strapi-provider-email-amazon-ses/package.json b/packages/strapi-provider-email-amazon-ses/package.json index ca1d263ad8..90835cb311 100644 --- a/packages/strapi-provider-email-amazon-ses/package.json +++ b/packages/strapi-provider-email-amazon-ses/package.json @@ -1,6 +1,6 @@ { "name": "strapi-provider-email-amazon-ses", - "version": "3.0.0-alpha.17", + "version": "3.0.0-alpha.18", "description": "Amazon SES provider for strapi email", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-provider-email-mailgun/package.json b/packages/strapi-provider-email-mailgun/package.json index b292cffc23..4b92e64b55 100644 --- a/packages/strapi-provider-email-mailgun/package.json +++ b/packages/strapi-provider-email-mailgun/package.json @@ -1,6 +1,6 @@ { "name": "strapi-provider-email-mailgun", - "version": "3.0.0-alpha.17", + "version": "3.0.0-alpha.18", "description": "Mailgun provider for strapi email plugin", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-provider-email-sendgrid/package.json b/packages/strapi-provider-email-sendgrid/package.json index d6d0bd7c06..ed90354386 100644 --- a/packages/strapi-provider-email-sendgrid/package.json +++ b/packages/strapi-provider-email-sendgrid/package.json @@ -1,6 +1,6 @@ { "name": "strapi-provider-email-sendgrid", - "version": "3.0.0-alpha.17", + "version": "3.0.0-alpha.18", "description": "Sendgrid provider for strapi email", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-provider-email-sendmail/package.json b/packages/strapi-provider-email-sendmail/package.json index 4dc2925d1c..2b4cc2d0c5 100644 --- a/packages/strapi-provider-email-sendmail/package.json +++ b/packages/strapi-provider-email-sendmail/package.json @@ -1,6 +1,6 @@ { "name": "strapi-provider-email-sendmail", - "version": "3.0.0-alpha.17", + "version": "3.0.0-alpha.18", "description": "Sendmail provider for strapi email", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-provider-upload-aws-s3/package.json b/packages/strapi-provider-upload-aws-s3/package.json index f01868296c..02440749e7 100644 --- a/packages/strapi-provider-upload-aws-s3/package.json +++ b/packages/strapi-provider-upload-aws-s3/package.json @@ -1,6 +1,6 @@ { "name": "strapi-provider-upload-aws-s3", - "version": "3.0.0-alpha.17", + "version": "3.0.0-alpha.18", "description": "AWS S3 provider for strapi upload", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-provider-upload-cloudinary/package.json b/packages/strapi-provider-upload-cloudinary/package.json index 3211e71d0d..09e4d897f5 100644 --- a/packages/strapi-provider-upload-cloudinary/package.json +++ b/packages/strapi-provider-upload-cloudinary/package.json @@ -1,6 +1,6 @@ { "name": "strapi-provider-upload-cloudinary", - "version": "3.0.0-alpha.17", + "version": "3.0.0-alpha.18", "description": "Cloudinary provider for strapi upload", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-provider-upload-local/package.json b/packages/strapi-provider-upload-local/package.json index 2a8e9aceba..f5d880fe3e 100644 --- a/packages/strapi-provider-upload-local/package.json +++ b/packages/strapi-provider-upload-local/package.json @@ -1,6 +1,6 @@ { "name": "strapi-provider-upload-local", - "version": "3.0.0-alpha.17", + "version": "3.0.0-alpha.18", "description": "Local provider for strapi upload", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-provider-upload-rackspace/package.json b/packages/strapi-provider-upload-rackspace/package.json index 9e923e4e2e..9c02ba1ca4 100644 --- a/packages/strapi-provider-upload-rackspace/package.json +++ b/packages/strapi-provider-upload-rackspace/package.json @@ -1,6 +1,6 @@ { "name": "strapi-provider-upload-rackspace", - "version": "3.0.0-alpha.17", + "version": "3.0.0-alpha.18", "description": "Rackspace provider for strapi upload", "main": "./lib", "scripts": { diff --git a/packages/strapi-utils/package.json b/packages/strapi-utils/package.json index ca360f8e08..52cf337974 100644 --- a/packages/strapi-utils/package.json +++ b/packages/strapi-utils/package.json @@ -1,6 +1,6 @@ { "name": "strapi-utils", - "version": "3.0.0-alpha.17", + "version": "3.0.0-alpha.18", "description": "Shared utilities for the Strapi packages", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi/bin/strapi-new.js b/packages/strapi/bin/strapi-new.js index 6c475c28f7..707a7bbe35 100644 --- a/packages/strapi/bin/strapi-new.js +++ b/packages/strapi/bin/strapi-new.js @@ -42,7 +42,8 @@ module.exports = function (name, cliArguments) { generatorType: 'new', name, strapiPackageJSON: packageJSON, - developerMode + developerMode, + debug: cliArguments.debug !== undefined }; const dbArguments = ['dbclient', 'dbhost', 'dbport', 'dbname', 'dbusername', 'dbpassword']; @@ -54,6 +55,8 @@ module.exports = function (name, cliArguments) { return process.exit(1); } + scope.dbforce = cliArguments.dbforce !== undefined; + scope.database = { settings: { client: cliArguments.dbclient, diff --git a/packages/strapi/bin/strapi.js b/packages/strapi/bin/strapi.js index 453a7705eb..4aa5d87cdd 100755 --- a/packages/strapi/bin/strapi.js +++ b/packages/strapi/bin/strapi.js @@ -53,6 +53,7 @@ program program .command('new') .option('-d, --dev', 'Development mode') + .option('--debug', 'Display database connection error') .option('--dbclient ', 'Database client') .option('--dbhost ', 'Database host') .option('--dbport ', 'Database port') @@ -61,6 +62,7 @@ program .option('--dbpassword ', 'Database password') .option('--dbssl ', 'Database SSL') .option('--dbauth ', 'Authentication Database') + .option('--dbforce', 'Overwrite database content if any') .description('create a new application') .action(require('./strapi-new')); diff --git a/packages/strapi/package.json b/packages/strapi/package.json index c1b10d91df..b4896681b9 100644 --- a/packages/strapi/package.json +++ b/packages/strapi/package.json @@ -1,6 +1,6 @@ { "name": "strapi", - "version": "3.0.0-alpha.17", + "version": "3.0.0-alpha.18", "description": "An open source solution to create and manage your own API. It provides a powerful dashboard and features to make your life easier.", "homepage": "http://strapi.io", "keywords": [ @@ -60,16 +60,16 @@ "rimraf": "^2.6.2", "semver": "^5.4.1", "stack-trace": "0.0.10", - "strapi-generate": "3.0.0-alpha.17", - "strapi-generate-admin": "3.0.0-alpha.17", - "strapi-generate-api": "3.0.0-alpha.17", - "strapi-generate-controller": "3.0.0-alpha.17", - "strapi-generate-model": "3.0.0-alpha.17", - "strapi-generate-new": "3.0.0-alpha.17", - "strapi-generate-plugin": "3.0.0-alpha.17", - "strapi-generate-policy": "3.0.0-alpha.17", - "strapi-generate-service": "3.0.0-alpha.17", - "strapi-utils": "3.0.0-alpha.17" + "strapi-generate": "3.0.0-alpha.18", + "strapi-generate-admin": "3.0.0-alpha.18", + "strapi-generate-api": "3.0.0-alpha.18", + "strapi-generate-controller": "3.0.0-alpha.18", + "strapi-generate-model": "3.0.0-alpha.18", + "strapi-generate-new": "3.0.0-alpha.18", + "strapi-generate-plugin": "3.0.0-alpha.18", + "strapi-generate-policy": "3.0.0-alpha.18", + "strapi-generate-service": "3.0.0-alpha.18", + "strapi-utils": "3.0.0-alpha.18" }, "author": { "email": "hi@strapi.io",