[node] downgrade to 0.12.7

While working to reintroduce shrinkwrap into our workflow it became
apparent that we needed to be using npm3 but unfortunately node-gyp
is not compatible with iojs, and the iojs distros actually contain a
patched version. This means that you can only use iojs with the npm
it ships with.

When trying to find a solution for this issue, we contemplated not
using npm3, but that would mean that we can't use npm-shrinkwrap and
decided that since we are using babel anyway that switching back to
node was the best option.

The only code that must be updated to work in the new node 0.12 env
is lodash templates that use the template string syntax inside their
source (Since 0.12 does not support template strings).
This commit is contained in:
spalger 2015-08-31 21:24:40 -07:00
parent cf82ce0d74
commit 708f1f1a25
8 changed files with 41 additions and 57 deletions

View file

@ -1 +1 @@
iojs-v2.5
0.12.7

View file

@ -1,5 +1,5 @@
language: node_js
node_js: 'iojs-v2.5'
node_js: '0.12.7'
install:
- npm install -g npm@3.2
- npm install

View file

@ -30,7 +30,7 @@ module.exports = function (grunt) {
}
}()),
nodeVersion: '2.5.0',
nodeVersion: grunt.file.read('.node-version').trim(),
meta: {
banner: '/*! <%= package.name %> - v<%= package.version %> - ' +

View file

@ -4,7 +4,4 @@ exports.webpack = {
optional: ['runtime']
};
exports.node = Object.assign({}, exports.webpack, {
optional: ['runtime', 'asyncToGenerator'],
blacklist: ['regenerator']
});
exports.node = Object.assign({}, exports.webpack);

View file

@ -1,6 +1,14 @@
module.exports = function ({env, bundle}) {
module.exports = require('lodash').template(
`
let pluginSlug = env.pluginInfo.sort()
.map(p => ' * - ' + p)
.join('\n');
let requires = bundle.modules
.map(m => `require('${m}');`)
.join('\n');
return `
/**
* Test entry file
*
@ -8,14 +16,7 @@ module.exports = require('lodash').template(
*
* context: <%= JSON.stringify(env.context) %>
* includes code from:
<%
env.pluginInfo.sort().forEach(function (plugin, i) {
if (i > 0) print('\\n');
print(' * - ' + plugin);
});
%>
${pluginSlug}
*
*/
@ -27,15 +28,9 @@ window.__KBN__ = {
};
require('ui/testHarness');
<%
bundle.modules.forEach(function (id, i) {
if (i > 0) print('\\n');
print(\`require('\${id.replace(/\\\\/g, '\\\\\\\\')}');\`);
});
%>
${requires}
require('ui/testHarness').bootstrap(/* go! */);
`
);
`;
};

View file

@ -17,7 +17,7 @@ class Status extends EventEmitter {
tags.push(this.state === 'red' ? 'error' : 'info');
server.log(tags, {
tmpl: 'Status changed from <%= prevState %> to <%= state %><% message && print(` - ${message}`) %>',
tmpl: 'Status changed from <%= prevState %> to <%= state %><% message ? " - " + message : "" %>',
name: name,
state: this.state,
message: this.message,

View file

@ -1,37 +1,29 @@
module.exports = function ({env, bundle}) {
module.exports = require('lodash').template(
`
let pluginSlug = env.pluginInfo.sort()
.map(p => ' * - ' + p)
.join('\n');
let requires = bundle.modules
.map(m => `require('${m}');`)
.join('\n');
return `
/**
* Optimized application entry file
* Test entry file
*
* This is programatically created and updated, do not modify
*
* context: <%= JSON.stringify(env.context) %>
* includes code from:
<%
env.pluginInfo.sort().forEach(function (plugin) {
print(\` * - \${plugin}\n\`);
});
%> *
${pluginSlug}
*
*/
require('ui/chrome');
<%
bundle.modules
.filter(function (id) {
return id !== 'ui/chrome';
})
.forEach(function (id, i) {
if (i > 0) print('\\n');
print(\`require('\${id}');\`);
});
%>
require('ui/chrome')
${requires}
require('ui/chrome').bootstrap(/* xoxo */);
`
);
`;
};

View file

@ -4,7 +4,7 @@ module.exports = function (grunt) {
let version = grunt.config.get('pkg.version');
let nodeVersion = grunt.config.get('nodeVersion');
let rootPath = grunt.config.get('root');
let baseUri = `https://iojs.org/dist/v${nodeVersion}`;
let baseUri = `https://nodejs.org/dist/v${nodeVersion}`;
return [
'darwin-x64',
@ -14,7 +14,7 @@ module.exports = function (grunt) {
].map(function (name) {
let win = name === 'windows';
let nodeUrl = win ? `${baseUri}/win-x86/iojs.exe` : `${baseUri}/iojs-v${nodeVersion}-${name}.tar.gz`;
let nodeUrl = win ? `${baseUri}/node.exe` : `${baseUri}/node-v${nodeVersion}-${name}.tar.gz`;
let nodeDir = resolve(rootPath, `.node_binaries/${nodeVersion}/${name}`);
let buildName = `kibana-${version}-${name}`;