mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Merge pull request #4939 from rashidkpc/revert/npm3
Revert npm3, go back to npm2
This commit is contained in:
commit
1e3dd08b99
9 changed files with 27 additions and 58 deletions
|
@ -1,7 +1,6 @@
|
|||
language: node_js
|
||||
node_js: '0.12.7'
|
||||
install:
|
||||
- npm install -g npm@3.2
|
||||
- npm install
|
||||
script: ./node_modules/.bin/grunt travis
|
||||
sudo: false
|
||||
|
|
|
@ -23,12 +23,6 @@ Please make sure you have signed the [Contributor License Agreement](http://www.
|
|||
nvm install "$(cat .node-version)"
|
||||
```
|
||||
|
||||
- Install npm 3.2
|
||||
|
||||
```sh
|
||||
npm install -g npm@3.2
|
||||
```
|
||||
|
||||
- Install dependencies
|
||||
|
||||
```sh
|
||||
|
|
17
Gruntfile.js
17
Gruntfile.js
|
@ -45,7 +45,22 @@ module.exports = function (grunt) {
|
|||
'<%= root %>/tasks/**/*.js',
|
||||
'<%= src %>/**/*.js',
|
||||
'!<%= src %>/fixtures/**/*.js'
|
||||
]
|
||||
],
|
||||
deepModules: {
|
||||
'caniuse-db': '1.0.30000265',
|
||||
'chalk': '1.1.0',
|
||||
'glob': '4.5.3',
|
||||
'har-validator': '1.8.0',
|
||||
'json5': '0.4.0',
|
||||
'loader-utils': '0.2.11',
|
||||
'micromatch': '2.2.0',
|
||||
'postcss-normalize-url': '2.1.1',
|
||||
'postcss-reduce-idents': '1.0.2',
|
||||
'postcss-unique-selectors': '1.0.0',
|
||||
'postcss-minify-selectors': '1.4.6',
|
||||
'postcss-single-charset': '0.3.0',
|
||||
'regenerator': '0.8.36'
|
||||
}
|
||||
};
|
||||
|
||||
grunt.config.merge(config);
|
||||
|
|
|
@ -159,7 +159,7 @@
|
|||
"mocha": "2.3.0",
|
||||
"nock": "2.10.0",
|
||||
"Nonsense": "0.1.2",
|
||||
"npm": "3.2.2",
|
||||
"npm": "2.11.0",
|
||||
"portscanner": "1.0.0",
|
||||
"simple-git": "1.8.0",
|
||||
"sinon": "1.16.1",
|
||||
|
@ -167,7 +167,7 @@
|
|||
"wreck": "6.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "2.5",
|
||||
"npm": "3.2"
|
||||
"node": "0.12",
|
||||
"npm": "2.14.3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@ module.exports = function (grunt) {
|
|||
let { flatten } = require('lodash');
|
||||
|
||||
grunt.registerTask('build', flatten([
|
||||
'_build:shrinkwrap:ensureExists:true',
|
||||
'_build:getProps',
|
||||
'clean:build',
|
||||
'clean:target',
|
||||
|
@ -13,10 +12,10 @@ module.exports = function (grunt) {
|
|||
'_build:installedPlugins',
|
||||
'_build:packageJson',
|
||||
'_build:readme',
|
||||
'_build:shrinkwrap:copyToBuild',
|
||||
'_build:shrinkwrap:cleanup',
|
||||
'_build:installNpmDeps',
|
||||
'clean:testsFromModules',
|
||||
'clean:deepModuleBins',
|
||||
'clean:deepModules',
|
||||
'run:optimizeBuild',
|
||||
'stop:optimizeBuild',
|
||||
'_build:downloadNodeBuilds:finish',
|
||||
|
|
|
@ -2,6 +2,7 @@ module.exports = function (grunt) {
|
|||
let { defaults } = require('lodash');
|
||||
|
||||
let pkg = grunt.config.get('pkg');
|
||||
let deepModules = grunt.config.get('deepModules');
|
||||
|
||||
grunt.registerTask('_build:packageJson', function () {
|
||||
|
||||
|
@ -17,7 +18,7 @@ module.exports = function (grunt) {
|
|||
sha: grunt.config.get('buildSha')
|
||||
},
|
||||
repository: pkg.repository,
|
||||
dependencies: pkg.dependencies
|
||||
dependencies: defaults({}, pkg.dependencies, deepModules)
|
||||
}, null, ' ')
|
||||
);
|
||||
});
|
||||
|
|
|
@ -1,41 +0,0 @@
|
|||
module.exports = function (grunt) {
|
||||
let { config } = grunt;
|
||||
let { statSync } = require('fs');
|
||||
let { join } = require('path');
|
||||
let exec = (...args) => require('../utils/exec')(...args, { cwd: config.get('root') });
|
||||
let newFiles = [];
|
||||
let shrinkwrapFile = join(config.get('root'), 'npm-shrinkwrap.json');
|
||||
|
||||
grunt.registerTask('_build:shrinkwrap:ensureExists', function (createIfMissing) {
|
||||
try {
|
||||
statSync(shrinkwrapFile);
|
||||
} catch (e) {
|
||||
if (e.code !== 'ENOENT') throw e;
|
||||
|
||||
if (createIfMissing) {
|
||||
exec('npm', ['shrinkwrap', '--dev', '--loglevel', 'error']);
|
||||
newFiles.push(shrinkwrapFile);
|
||||
}
|
||||
else grunt.fail.warn('Releases require an npm-shrinkwrap.json file to exist');
|
||||
}
|
||||
});
|
||||
|
||||
grunt.registerTask('_build:shrinkwrap:copyToBuild', function () {
|
||||
// this.requires(['_build:shrinkwrap:ensureExists', 'copy:devSource']);
|
||||
|
||||
// backup shrinkwrap and copy to build
|
||||
exec('cp', ['npm-shrinkwrap.json', 'npm-shrinkwrap.dev']);
|
||||
exec('cp', ['npm-shrinkwrap.json', join(config.get('root'), 'build', 'kibana', 'npm-shrinkwrap.build.json')]);
|
||||
|
||||
// create shrinkwrap without dev dependencies and copy to build
|
||||
exec('npm', ['shrinkwrap', '--loglevel', 'error']);
|
||||
exec('cp', ['npm-shrinkwrap.json', join(config.get('root'), 'build', 'kibana', 'npm-shrinkwrap.json')]);
|
||||
|
||||
// restore the dev shrinkwrap
|
||||
exec('mv', ['npm-shrinkwrap.dev', 'npm-shrinkwrap.json']);
|
||||
});
|
||||
|
||||
grunt.registerTask('_build:shrinkwrap:cleanup', function () {
|
||||
if (newFiles.length) exec('rm', newFiles.splice(0));
|
||||
});
|
||||
};
|
|
@ -1,7 +1,10 @@
|
|||
module.exports = function (grunt) {
|
||||
let modules = Object.keys(grunt.config.get('deepModules'));
|
||||
return {
|
||||
build: 'build',
|
||||
target: 'target',
|
||||
testsFromModules: 'build/kibana/node_modules/**/*test*/**'
|
||||
testsFromModules: 'build/kibana/node_modules/**/*test*/**',
|
||||
deepModuleBins: 'build/kibana/node_modules/*/node_modules/**/.bin/{' + modules.join(',') + '}',
|
||||
deepModules: 'build/kibana/node_modules/*/node_modules/**/{' + modules.join(',') + '}/',
|
||||
};
|
||||
};
|
||||
|
|
|
@ -3,7 +3,6 @@ module.exports = function (grunt) {
|
|||
|
||||
// build, then zip and upload to s3
|
||||
grunt.registerTask('release', [
|
||||
'_build:shrinkwrap:ensureExists',
|
||||
'_release:confirmUpload',
|
||||
'_release:loadS3Config',
|
||||
'build',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue