From ab82eb1d2e2c17c855bedc2032b8d712a6cd69f7 Mon Sep 17 00:00:00 2001 From: Jim LAURIE Date: Fri, 15 Feb 2019 22:22:13 +0100 Subject: [PATCH] Fix PR feedback --- packages/strapi-admin/scripts/setup.js | 4 ++-- packages/strapi-generate-new/lib/before.js | 12 ++++++++---- packages/strapi-plugin-graphql/package.json | 10 +++++----- packages/strapi/bin/strapi-new.js | 10 +++++----- 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/packages/strapi-admin/scripts/setup.js b/packages/strapi-admin/scripts/setup.js index 7002be7bac..7e209642a3 100644 --- a/packages/strapi-admin/scripts/setup.js +++ b/packages/strapi-admin/scripts/setup.js @@ -12,7 +12,7 @@ const appPath = isDevelopmentMode ? path.resolve(process.env.PWD, '..') : path.r shell.echo('🏗 Building the admin...'); shell.cd(path.resolve(appPath, 'admin')); -const build = shell.exec(`set APP_PATH="${appPath}" && npm run build`, {silent}); +const build = shell.exec(`cross-env APP_PATH="${appPath}" npm run build`, {silent}); if (build.stderr && build.code !== 0) { console.error(build.stderr); @@ -55,7 +55,7 @@ if (process.env.npm_config_plugins === 'true') { shell.echo('🏗 Building...'); shell.cd(path.resolve(plugins, plugin)); - const build = shell.exec(`set APP_PATH="${appPath}" && npm run build`, {silent}); + const build = shell.exec(`cross-env APP_PATH="${appPath}" npm run build`, {silent}); if (build.stderr && build.code !== 0) { console.error(build.stderr); diff --git a/packages/strapi-generate-new/lib/before.js b/packages/strapi-generate-new/lib/before.js index b9f094e115..009132495c 100644 --- a/packages/strapi-generate-new/lib/before.js +++ b/packages/strapi-generate-new/lib/before.js @@ -267,7 +267,7 @@ module.exports = (scope, cb) => { if (answers.authenticationDatabase) { scope.database.options.authenticationDatabase = answers.authenticationDatabase; } - + // SQLite requirements. if (isSQLite) { // Necessary for SQLite configuration (https://knexjs.org/#Builder-insert). @@ -283,7 +283,11 @@ module.exports = (scope, cb) => { } console.log(); - console.log(isQuick ? '✅ Connected to the database' : '⏳ Testing database connection...'); + console.log( + isQuick + ? '✅ Connected to the database' + : '⏳ Testing database connection...\r\nIt might take a minute, please have a coffee ☕️' + ); resolve(); }), @@ -347,11 +351,11 @@ module.exports = (scope, cb) => { const connectedToTheDatabase = (withMessage = true) => { console.log(); - if (withMessage) { + if (withMessage) { console.log(`The app has been connected to the database ${green('successfully')}!`); console.log(); } - + trackSuccess('didConnectDatabase', scope); cb.success(); diff --git a/packages/strapi-plugin-graphql/package.json b/packages/strapi-plugin-graphql/package.json index 16348386bc..7aec2a865c 100644 --- a/packages/strapi-plugin-graphql/package.json +++ b/packages/strapi-plugin-graphql/package.json @@ -33,6 +33,10 @@ "pluralize": "^7.0.0", "strapi-utils": "3.0.0-alpha.23.1" }, + "devDependencies": { + "cross-env": "^5.2.0", + "rimraf": "^2.6.3" + }, "author": { "name": "A Strapi developer", "email": "", @@ -49,9 +53,5 @@ "node": ">= 10.0.0", "npm": ">= 6.0.0" }, - "license": "MIT", - "devDependencies": { - "cross-env": "^5.2.0", - "rimraf": "^2.6.3" - } + "license": "MIT" } \ No newline at end of file diff --git a/packages/strapi/bin/strapi-new.js b/packages/strapi/bin/strapi-new.js index 2a4a3806e7..379be95f0f 100644 --- a/packages/strapi/bin/strapi-new.js +++ b/packages/strapi/bin/strapi-new.js @@ -31,7 +31,7 @@ const packageJSON = require('../package.json'); */ module.exports = function (name, cliArguments) { - console.log('🚀 Start creating your Strapi application. It might take a minute, please take a coffee ☕️'); + console.log('🚀 Start creating your Strapi application.'); const developerMode = cliArguments.dev !== undefined; @@ -85,9 +85,9 @@ module.exports = function (name, cliArguments) { const error = (error) => { fetch('https://analytics.strapi.io/track', { method: 'POST', - body: JSON.stringify({ - event: 'didNotStartAutomatically', - deviceId: machineIdSync(), + body: JSON.stringify({ + event: 'didNotStartAutomatically', + deviceId: machineIdSync(), properties: { error, os: os.type() @@ -122,7 +122,7 @@ module.exports = function (name, cliArguments) { input: process.stdin, output: process.stdout }); - + rl.on("SIGINT", function () { process.emit("SIGINT"); });