diff --git a/.gitignore b/.gitignore index 0d97c963ca..e2a8447e31 100755 --- a/.gitignore +++ b/.gitignore @@ -93,6 +93,7 @@ build node_modules .node_history package-lock.json +**/package-lock.json ############################ diff --git a/ROADMAP.md b/ROADMAP.md index a6483f96c8..5e0587c5e7 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -52,23 +52,22 @@ _Reorganize the mono-repository. The rule to follow is to only have hooks withou - ~~Prototype the CLI to create, install and uninstall plugins.~~ - ~~Ensure that we are compatible with Node 8.~~ -`strapi@alpha.5` *(expected release date: 10/08/2017)*: -- [Plugin] Settings Manager. -- Update `strapi-helper-plugin` and `strapi-admin` dependencies to the latest version. -- Update layout design. -- Create a draft of the guidelines to follow of how to create a plugin. -- Finalize the plugins queries process to be able to use different ORMs. -- Initialize the `strapi-docs` package. -- Use [lerna](http://lernajs.io) to run tests. -- Synchronize the ORM adapters to set the same properties in the AST. -- Rewrite the Strapi core to improve performances and startup time. +`strapi@alpha.5` *(expected release date: 30/08/2017)*: +- ~~[Plugin] Settings Manager~~. +- ~~Update layout design~~. +- ~~Create a draft of the guidelines to follow of how to create a plugin~~. +- ~~Initialize the `strapi-docs` package~~. +- ~~Synchronize the ORM adapters to set the same properties in the AST~~. +- ~~Rewrite the Strapi core to improve performances and startup time~~. +- ~~Freeze (make immutable) the AST~~. +- ~~Remove global variable `strapi` and use the module pattern instead~~. `strapi@alpha.6` *(expected release date: 21/09/2017)*: - [Plugin] Content Manager. - [Plugin] Content Type Builder. -- Freeze (make immutable) the AST. -- Remove global variable `strapi` and use the module pattern instead. -- Write better tests. +- Finalize the plugins queries process to be able to use different ORMs. +- Update `strapi-helper-plugin` and `strapi-admin` dependencies to the latest version. +- Use [lerna](http://lernajs.io) to run tests. `strapi@alpha.7` *(expected release date: 31/10/2017)*: - [Plugin] Users & groups (with full authentication process). diff --git a/packages/strapi-admin/files/public/app/i18n.js b/packages/strapi-admin/files/public/app/i18n.js index a97c69fc24..1bde45c64c 100644 --- a/packages/strapi-admin/files/public/app/i18n.js +++ b/packages/strapi-admin/files/public/app/i18n.js @@ -20,7 +20,7 @@ const requireTranslations = language => { try { return require(`./translations/${language}.json`); // eslint-disable-line global-require } catch (error) { - console.error(`Unable to load "${language}" translation. Please make sure "${language}.json" file exists in "admin/public/app/translations" folder.`); + console.error(`Unable to load "${language}" translation. Please make sure "${language}.json" file exists in "admin/public/app/translations" folder.`); // eslint-disable-line no-console return false; } }; @@ -37,7 +37,7 @@ const addLanguageLocaleData = language => { addLocaleData(localeData); return true; } catch (error) { - console.error(`It looks like the language "${language}" is not supported by "react-intl" module.`); + console.error(`It looks like the language "${language}" is not supported by "react-intl" module.`); // eslint-disable-line no-console return false; } }; diff --git a/packages/strapi-admin/files/public/package-lock.json b/packages/strapi-admin/files/public/package-lock.json index 872c8d04d4..c0f015ee4e 100644 --- a/packages/strapi-admin/files/public/package-lock.json +++ b/packages/strapi-admin/files/public/package-lock.json @@ -4,6 +4,16 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "JSONStream": { + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-0.8.4.tgz", + "integrity": "sha1-kWV9/m/4V0gwZhMrRhi2Lo9Ih70=", + "dev": true, + "requires": { + "jsonparse": "0.0.5", + "through": "2.3.8" + } + }, "abab": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/abab/-/abab-1.0.3.tgz", @@ -6155,15 +6165,6 @@ } } }, - "string_decoder": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.1.tgz", - "integrity": "sha1-YuIA8DmVWmgQ2N8KM//A8BNmLZg=", - "dev": true, - "requires": { - "safe-buffer": "5.0.1" - } - }, "string-width": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", @@ -6175,6 +6176,15 @@ "strip-ansi": "3.0.1" } }, + "string_decoder": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.1.tgz", + "integrity": "sha1-YuIA8DmVWmgQ2N8KM//A8BNmLZg=", + "dev": true, + "requires": { + "safe-buffer": "5.0.1" + } + }, "stringstream": { "version": "0.0.5", "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", @@ -8613,16 +8623,6 @@ "integrity": "sha1-T9kss04OnbPInIYi7PUfm5eMbLk=", "dev": true }, - "JSONStream": { - "version": "0.8.4", - "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-0.8.4.tgz", - "integrity": "sha1-kWV9/m/4V0gwZhMrRhi2Lo9Ih70=", - "dev": true, - "requires": { - "jsonparse": "0.0.5", - "through": "2.3.8" - } - }, "jsprim": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.0.tgz", @@ -13696,15 +13696,6 @@ "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=" }, - "string_decoder": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", - "dev": true, - "requires": { - "safe-buffer": "5.1.1" - } - }, "string-template": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/string-template/-/string-template-1.0.0.tgz", @@ -13722,6 +13713,15 @@ "strip-ansi": "3.0.1" } }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "dev": true, + "requires": { + "safe-buffer": "5.1.1" + } + }, "stringify-object": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-2.4.0.tgz", diff --git a/packages/strapi-generate-new/files/config/functions/bootstrap.js b/packages/strapi-generate-new/files/config/functions/bootstrap.js index 45f42d971c..cbb47866f9 100755 --- a/packages/strapi-generate-new/files/config/functions/bootstrap.js +++ b/packages/strapi-generate-new/files/config/functions/bootstrap.js @@ -2,7 +2,7 @@ /** * An asynchronous bootstrap function that runs before - * your application gets lifted. + * your application gets started. * * This gives you an opportunity to set up your data model, * run jobs, or perform some special logic. diff --git a/packages/strapi-generate-new/files/public/index.html b/packages/strapi-generate-new/files/public/index.html index 1f162b2438..8ba93f2ff7 100755 --- a/packages/strapi-generate-new/files/public/index.html +++ b/packages/strapi-generate-new/files/public/index.html @@ -153,9 +153,10 @@
You'll probably also want to learn how to customize your application, set up security and configure your data sources.
For more help getting started, check out:
diff --git a/packages/strapi-generate-new/lib/after.js b/packages/strapi-generate-new/lib/after.js index a82db9623d..1f9efda440 100755 --- a/packages/strapi-generate-new/lib/after.js +++ b/packages/strapi-generate-new/lib/after.js @@ -31,17 +31,26 @@ module.exports = (scope, cb) => { // Copy the default files. fs.copySync(path.resolve(__dirname, '..', 'files'), path.resolve(scope.rootPath)); + const availableDependencies = []; const missingDependencies = []; // Verify if the dependencies are available into the global _.forEach(_.merge(_.get(packageJSON, 'dependencies'), _.get(packageJSON, 'devDependencies')), (value, key) => { try { fs.accessSync(path.resolve(strapiRootPath, key), fs.constants.R_OK | fs.constants.W_OK); - fs.symlinkSync(path.resolve(strapiRootPath, key), path.resolve(scope.rootPath, 'node_modules', key), 'dir'); + availableDependencies.push({ + key, + global: true + }); + // fs.symlinkSync(path.resolve(strapiRootPath, key), path.resolve(scope.rootPath, 'node_modules', key), 'dir'); } catch (e1) { try { fs.accessSync(path.resolve(scope.strapiRoot, 'node_modules', key), fs.constants.R_OK | fs.constants.W_OK); - fs.symlinkSync(path.resolve(scope.strapiRoot, 'node_modules', key), path.resolve(scope.rootPath, 'node_modules', key), 'dir'); + availableDependencies.push({ + key, + global: false + }); + // fs.symlinkSync(path.resolve(scope.strapiRoot, 'node_modules', key), path.resolve(scope.rootPath, 'node_modules', key), 'dir'); } catch (e2) { missingDependencies.push(key); } @@ -67,6 +76,14 @@ module.exports = (scope, cb) => { return cb(); } + availableDependencies.forEach(dependency => { + if (dependency.global) { + fs.symlinkSync(path.resolve(strapiRootPath, dependency.key), path.resolve(scope.rootPath, 'node_modules', dependency.key), 'dir'); + } else { + fs.symlinkSync(path.resolve(scope.strapiRoot, 'node_modules', dependency.key), path.resolve(scope.rootPath, 'node_modules', dependency.key), 'dir'); + } + }) + logger.info('Your new application `' + scope.name + '` is ready at `' + scope.rootPath + '`.'); cb(); diff --git a/packages/strapi-generate/lib/generate.js b/packages/strapi-generate/lib/generate.js index b2a059eb20..e017870b29 100755 --- a/packages/strapi-generate/lib/generate.js +++ b/packages/strapi-generate/lib/generate.js @@ -17,9 +17,6 @@ const reportback = require('reportback')(); const pathRegexp = require('./util').pathRegexp; const generateTarget = require('./target'); -// Logger. -const { logger } = require('strapi-utils'); - /** * Run a generator given an existing scope * @@ -50,9 +47,6 @@ function generate(generator, scope, cb) { invalid: sb.invalid, success: () => { - // Emit output. - logger.info('Generating ' + util.inspect(generator) + ' at `' + scope.rootPath + '`...'); - // Process all of the generator's targets concurrently. async.each(Object.keys(generator.targets), (keyPath, asyncEachCb) => { const asyncEachSb = reportback.extend(asyncEachCb); diff --git a/packages/strapi-mongoose/lib/index.js b/packages/strapi-mongoose/lib/index.js index 8d907402a1..579e10f337 100644 --- a/packages/strapi-mongoose/lib/index.js +++ b/packages/strapi-mongoose/lib/index.js @@ -13,7 +13,7 @@ const mongooseUtils = require('mongoose/lib/utils'); const utils = require('./utils/'); // Strapi helpers for models. -const utilsModels = require('strapi-utils').models; +const { models: utilsModels, logger } = require('strapi-utils'); /** * Bookshelf hook @@ -63,6 +63,10 @@ module.exports = function (strapi) { // Handle error db.on('error', error => { + if (error.message.indexOf(`:${port}`)) { + return cb('Make sure your MongoDB database is running...'); + } + cb(error); }); diff --git a/packages/strapi/lib/middlewares/public/index.js b/packages/strapi/lib/middlewares/public/index.js index 13526e26e1..8379339081 100644 --- a/packages/strapi/lib/middlewares/public/index.js +++ b/packages/strapi/lib/middlewares/public/index.js @@ -56,10 +56,12 @@ module.exports = strapi => { // Note: This route could be override by the user. strapi.router.route({ method: 'GET', - path: '/*.*', + path: '/*(.*)?', handler: [ async (ctx, next) => { - ctx.url = path.basename(ctx.url); + const parse = path.parse(ctx.url); + + ctx.url = path.join(parse.dir, parse.base); await next(); },