Remove file dependencies before commit

This commit is contained in:
aurelsicoko 2017-07-17 17:19:35 +02:00
parent 0f9c16940a
commit a8732565c9
25 changed files with 12350 additions and 4927 deletions

4901
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -22,7 +22,8 @@
}, },
"scripts": { "scripts": {
"test": "make test", "test": "make test",
"postinstall": "lerna bootstrap --stream && node ./scripts/setup.js" "removefiledependencies": "node ./scripts/removefiledependencies.js",
"postinstall": "lerna bootstrap --stream && node ./scripts/setup.js && node ./scripts/removefiledependencies.js"
}, },
"author": { "author": {
"email": "hi@strapi.io", "email": "hi@strapi.io",
@ -36,6 +37,10 @@
"url": "http://strapi.io" "url": "http://strapi.io"
} }
], ],
"pre-commit": [
"removefiledependencies",
"test"
],
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git://github.com/strapi/strapi.git" "url": "git://github.com/strapi/strapi.git"

View File

@ -29,9 +29,9 @@
"integrity": "sha1-eRQg1/VR7qKJdFOop3ZT+WYG1nw=" "integrity": "sha1-eRQg1/VR7qKJdFOop3ZT+WYG1nw="
}, },
"bookshelf": { "bookshelf": {
"version": "0.10.3", "version": "0.10.4",
"resolved": "https://registry.npmjs.org/bookshelf/-/bookshelf-0.10.3.tgz", "resolved": "https://registry.npmjs.org/bookshelf/-/bookshelf-0.10.4.tgz",
"integrity": "sha1-clWCBOg4Ffjlu6b9gIcCVj5ys+Q=", "integrity": "sha1-/gaYRFZ0BBeroT0NdsewZdHxd00=",
"requires": { "requires": {
"babel-runtime": "6.23.0", "babel-runtime": "6.23.0",
"bluebird": "3.5.0", "bluebird": "3.5.0",

View File

@ -19,7 +19,7 @@
"bookshelf": "^0.10.3", "bookshelf": "^0.10.3",
"lodash": "^4.17.4", "lodash": "^4.17.4",
"pluralize": "^3.1.0", "pluralize": "^3.1.0",
"strapi-utils": "file:../strapi-utils" "strapi-utils": "^3.0.0-alpha.4"
}, },
"strapi": { "strapi": {
"isHook": true, "isHook": true,

File diff suppressed because it is too large Load Diff

View File

@ -20,7 +20,7 @@
"mongoose-double": "0.0.1", "mongoose-double": "0.0.1",
"mongoose-float": "^1.0.2", "mongoose-float": "^1.0.2",
"pluralize": "^3.1.0", "pluralize": "^3.1.0",
"strapi-utils": "file:../strapi-utils" "strapi-utils": "^3.0.0-alpha.4"
}, },
"strapi": { "strapi": {
"isHook": true "isHook": true

View File

@ -0,0 +1,21 @@
const fs = require('fs');
const path = require('path');
try {
const pkgJSON = JSON.parse(fs.readFileSync(path.resolve(process.cwd(), 'package.json'), 'utf8'));
const packages = fs.readdirSync(path.resolve(process.cwd(),'packages'), 'utf8');
packages.filter(pkg => pkg.indexOf('strapi') !== -1).forEach(pkg => {
const packageJSON = JSON.parse(fs.readFileSync(path.resolve(process.cwd(), 'packages', pkg, 'package.json'), 'utf8'));
Object.keys(packageJSON.dependencies).filter(dependency => dependency.indexOf('strapi-') !== -1).forEach(dependency => {
if (packageJSON.dependencies[dependency].indexOf('file:') !== -1) {
packageJSON.dependencies[dependency] = '^' + pkgJSON.version;
}
});
fs.writeFileSync(path.resolve(process.cwd(), 'packages', pkg, 'package.json'), JSON.stringify(packageJSON, null, 2), 'utf8');
});
} catch (error) {
console.error(error);
}