diff --git a/packages/strapi-admin/files/public/package-lock.json b/packages/strapi-admin/files/public/package-lock.json index c0f015ee4e..872c8d04d4 100644 --- a/packages/strapi-admin/files/public/package-lock.json +++ b/packages/strapi-admin/files/public/package-lock.json @@ -4,16 +4,6 @@ "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", @@ -6165,6 +6155,15 @@ } } }, + "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", @@ -6176,15 +6175,6 @@ "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", @@ -8623,6 +8613,16 @@ "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,6 +13696,15 @@ "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", @@ -13713,15 +13722,6 @@ "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/json/package.json.js b/packages/strapi-generate-new/json/package.json.js index 28f1a5bcf4..60fd942f0d 100755 --- a/packages/strapi-generate-new/json/package.json.js +++ b/packages/strapi-generate-new/json/package.json.js @@ -37,7 +37,8 @@ module.exports = scope => { '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' + 'lint': 'node_modules/.bin/eslint api/**/*.js config/**/*.js plugins/**/*.js', + 'postinstall': 'node node_modules/strapi-utils/script/plugin-install.js' }, 'author': { 'name': scope.author || 'A Strapi developer', diff --git a/packages/strapi-plugin-settings-manager/package.json b/packages/strapi-plugin-settings-manager/package.json index e4864dab45..57106028b7 100644 --- a/packages/strapi-plugin-settings-manager/package.json +++ b/packages/strapi-plugin-settings-manager/package.json @@ -48,7 +48,7 @@ "plop": "^1.5.0", "prettier": "^1.5.3", "rimraf": "^2.5.4", - "strapi-helper-plugin": "3.0.0-alpha.5.5", + "strapi-helper-plugin": "file:../strapi-helper-plugin", "webpack": "^2.1.0-beta.25" }, "author": { @@ -68,4 +68,4 @@ "npm": ">= 3.0.0" }, "license": "MIT" -} \ No newline at end of file +} diff --git a/packages/strapi-utils/package.json b/packages/strapi-utils/package.json index 207856befb..32ce37facc 100644 --- a/packages/strapi-utils/package.json +++ b/packages/strapi-utils/package.json @@ -45,4 +45,4 @@ "npm": ">= 5.3.0" }, "license": "MIT" -} \ No newline at end of file +} diff --git a/packages/strapi-utils/script/plugin-install.js b/packages/strapi-utils/script/plugin-install.js new file mode 100644 index 0000000000..accf4bc133 --- /dev/null +++ b/packages/strapi-utils/script/plugin-install.js @@ -0,0 +1,30 @@ +'use strict'; + +/** + * Module dependencies + */ + +// Node.js core +const exec = require('child_process').execSync; +const path = require('path'); +const fs = require('fs'); + +// Public node modules. +const _ = require('lodash'); + +// Define files/dir paths +const pluginsDirPath = path.join(process.cwd(), 'plugins'); +const plugins = fs.readdirSync(pluginsDirPath); + +// Install dependencies for each plugins +_.forEach(plugins, plugin => { + const pluginPath = path.join(pluginsDirPath, plugin); + + console.log(`Install plugin ${plugin} dependencies...`); + + try { + exec(`cd ${pluginPath} && npm install --prod --ignore-scripts`); + } catch (err) { + console.log(err); + } +});