Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to NodeJS 10 #25157

Merged
merged 48 commits into from
Dec 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
bcbfc82
feat(NA): upgrade node js version on file configs.
mistic Oct 31, 2018
28c487c
Merge branch 'master' into upgrade-to-nodejs-10
mistic Oct 31, 2018
f43c4d4
chore(NA): migrate configs and 3rd party dependencies to work on node…
mistic Nov 2, 2018
b24b1d4
fix(NA): add missing async function declaration.
mistic Nov 5, 2018
b619d49
chore(NA): updated elastic/good package to work with node10
mistic Nov 5, 2018
27023f0
chore(NA): fix and merge conflicts with master.
mistic Nov 5, 2018
4ed1696
chore(NA): update lockfiles.
mistic Nov 5, 2018
d379c8a
fix(NA): add missing dep.
mistic Nov 5, 2018
e959fcf
fix(NA): types for node 10.
mistic Nov 6, 2018
25e89c7
test(NA): fix error return type for node10.
mistic Nov 6, 2018
fdd107e
fix(NA): kbn-pm webpack config to unlazy a require using lazy-cache. …
mistic Nov 6, 2018
24d0a02
test(NA): jest integration test for kbn-pluin-helpers.
mistic Nov 7, 2018
8dc4ab2
test(NA): fix jest tests for kbn-es.
mistic Nov 7, 2018
880311f
fix(NA): use ostmpdir instead of a tmp folder inside the fixtures.
mistic Nov 7, 2018
4bc7645
fix(NA): change afterEach on kbn es decompress test.
mistic Nov 7, 2018
d866dec
fix(NA): change afterEach on kbn es decompress test.
mistic Nov 7, 2018
57c2a46
fix(NA): readd mock-fs for the tests that still use it on kbn-es and …
mistic Nov 7, 2018
89f2013
fix(NA): readd mock-fs for the tests that still use it on kbn-es and …
mistic Nov 7, 2018
ae3ba42
refact(NA): rewrite tests using mock-fs and completely remove this de…
mistic Nov 8, 2018
f1b2328
fix(NA): failing test implementation using jest mock in order to repl…
mistic Nov 8, 2018
664e876
fix(NA): update jest snapshots to match new ones generated one node 10.
mistic Nov 8, 2018
603c5a1
fix(NA): cli/cluster mock to spyOn off method instead off spyOn remov…
mistic Nov 8, 2018
81fd32d
fix(NA): tests for cluster_manager to also spyOn off and on instead o…
mistic Nov 8, 2018
d1d8896
test(NA): fix management advance settings image field test flow.
mistic Nov 8, 2018
607b78a
chore(NA): merge and solve conflicts with master.
mistic Nov 9, 2018
1a07b28
chore(NA): merge and solve conflicts with master.
mistic Nov 9, 2018
7e71d18
fix(NA): apply missing types for src/core/server/plugins/discovery/pl…
mistic Nov 9, 2018
2c2c821
test(NA): updated 2 missing snapshots for KuiCodeEditor on kbn-ui-fra…
mistic Nov 9, 2018
4252af3
chore(NA): merge and solve conflicts with master.
mistic Nov 12, 2018
1328728
refact(NA): fix eslint errors.
mistic Nov 13, 2018
899728b
chore(NA): merge and solve conflicts with master,
mistic Nov 13, 2018
9bf1e3f
refact(NA): fix ts code with tslint fix. chore(NA): update jest snaps…
mistic Nov 13, 2018
8dc0170
Merge branch 'master' into upgrade-to-nodejs-10
mistic Nov 14, 2018
a864de9
chore(NA): migrate kbn config schema peer dependency to last used joi…
mistic Nov 16, 2018
d9023f9
chore(NA): merge and solve conflicts with last master.
mistic Nov 22, 2018
42889e0
Merge branch 'master' into upgrade-to-nodejs-10
mistic Nov 23, 2018
c462391
fix(NA): tslint errors.
mistic Nov 23, 2018
601fcc5
chore(NA): merge and solve conflicts with last master.
mistic Nov 27, 2018
3a57396
chore(NA): upgrade types node to the last version.
mistic Nov 27, 2018
6e114a6
chore(NA): merge and solve conflicts with last master.
mistic Nov 28, 2018
1e7d454
chore(NA): upgrade to node 10.14.0. chore(NA): merge and solve confli…
mistic Nov 28, 2018
4e22991
fix(NA): missing utf8 input format encoding when reading a file.
mistic Nov 28, 2018
12bafbe
chore(NA): merge and solve conflicts with last master.
mistic Dec 3, 2018
45ea7b4
chore(NA): upgrade to node 10.14.1
mistic Dec 3, 2018
5f8fa0d
fix(NA): Buffer api usage to avoid deprecation warnings.
mistic Dec 6, 2018
faf62b9
chore(NA): merge and solve conflicts with last master.
mistic Dec 6, 2018
28fdbfc
Merge branch 'master' into upgrade-to-nodejs-10
mistic Dec 7, 2018
774653c
chore(NA): merge and solve conflicts with last master.
mistic Dec 10, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.14.0
10.14.1
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.14.0
10.14.1
21 changes: 10 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"url": "https://github.com/elastic/kibana.git"
},
"resolutions": {
"**/@types/node": "8.10.38",
"**/@types/node": "10.12.12",
"@types/react": "16.3.14"
},
"workspaces": {
Expand All @@ -95,7 +95,7 @@
"@elastic/datemath": "5.0.1",
"@elastic/eui": "5.3.0",
"@elastic/filesaver": "1.1.2",
"@elastic/good": "8.1.1-kibana1",
"@elastic/good": "8.1.1-kibana2",
"@elastic/numeral": "2.3.2",
"@elastic/ui-ace": "0.2.3",
"@kbn/babel-code-parser": "1.0.0",
Expand Down Expand Up @@ -137,7 +137,7 @@
"elasticsearch": "^15.2.0",
"elasticsearch-browser": "^15.2.0",
"encode-uri-query": "1.0.0",
"execa": "^0.10.0",
"execa": "^1.0.0",
mistic marked this conversation as resolved.
Show resolved Hide resolved
"expiry-js": "0.1.7",
"file-loader": "2.0.0",
"font-awesome": "4.4.0",
Expand Down Expand Up @@ -285,7 +285,7 @@
"@types/minimatch": "^2.0.29",
"@types/moment-timezone": "^0.5.8",
"@types/mustache": "^0.8.31",
"@types/node": "^8.10.38",
"@types/node": "^10.12.12",
"@types/opn": "^5.1.0",
"@types/podium": "^1.0.0",
"@types/prop-types": "^15.5.3",
Expand All @@ -308,7 +308,7 @@
"angular-mocks": "1.4.7",
"archiver": "^3.0.0",
"babel-eslint": "^9.0.0",
"babel-jest": "^23.4.2",
"babel-jest": "^23.6.0",
"backport": "4.4.1",
"chai": "3.5.0",
"chance": "1.0.10",
Expand All @@ -325,7 +325,7 @@
"eslint-config-prettier": "^3.1.0",
"eslint-plugin-babel": "^5.2.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jest": "^21.22.1",
"eslint-plugin-jest": "^21.26.2",
"eslint-plugin-jsx-a11y": "^6.1.2",
"eslint-plugin-mocha": "^5.2.0",
"eslint-plugin-no-unsanitized": "^3.0.2",
Expand All @@ -345,13 +345,13 @@
"grunt-peg": "^2.0.1",
"grunt-run": "0.7.0",
"gulp-babel": "^7.0.1",
"gulp-sourcemaps": "1.7.3",
"gulp-sourcemaps": "2.6.4",
"has-ansi": "^3.0.0",
"image-diff": "1.6.0",
"intl-messageformat-parser": "^1.4.0",
"istanbul-instrumenter-loader": "3.0.1",
"jest": "^23.5.0",
"jest-cli": "^23.5.0",
"jest": "^23.6.0",
"jest-cli": "^23.6.0",
"jest-raw-loader": "^1.0.1",
"jimp": "0.2.28",
"json5": "^1.0.1",
Expand All @@ -369,7 +369,6 @@
"load-grunt-config": "0.19.2",
"makelogs": "^4.3.0",
"mocha": "3.3.0",
"mock-fs": "^4.4.2",
"murmurhash3js": "3.0.1",
"mutation-observer": "^1.0.3",
"nock": "8.0.0",
Expand Down Expand Up @@ -400,7 +399,7 @@
"zlib": "^1.0.5"
},
"engines": {
"node": "8.14.0",
"node": "10.14.1",
"yarn": "^1.10.1"
}
}
4 changes: 2 additions & 2 deletions packages/kbn-babel-code-parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"url": "https://github.com/elastic/kibana/tree/master/packages/kbn-babel-code-parser"
},
"scripts": {
"build": "babel src --out-dir target --quiet",
"kbn:bootstrap": "yarn build",
"build": "babel src --out-dir target",
"kbn:bootstrap": "yarn build --quiet",
"kbn:watch": "yarn build --watch"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-config-schema/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"typescript": "^3.0.3"
},
"peerDependencies": {
"joi": "10.4.1",
"joi": "^13.5.2",
"moment": "^2.20.1",
"type-detect": "^4.0.8"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-dev-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"dependencies": {
"chalk": "^2.4.1",
"execa": "^0.10.0",
"execa": "^1.0.0",
"moment": "^2.20.1",
"rxjs": "^6.2.1",
"tree-kill": "^1.2.0",
Expand Down
8 changes: 3 additions & 5 deletions packages/kbn-es/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,14 @@
"chalk": "^2.4.1",
"dedent": "^0.7.0",
"del": "^3.0.0",
"execa": "^0.10.0",
"execa": "^1.0.0",
"getopts": "^2.0.6",
"glob": "^7.1.2",
"mkdirp": "^0.5.1",
"mock-fs": "^4.5.0",
"node-fetch": "^2.0.0",
"simple-git": "^1.91.0",
"tar-fs": "^1.16.0",
"tar-fs": "^1.16.3",
"tree-kill": "^1.1.0",
"yauzl": "^2.10.0",
"zlib": "^1.0.5"
"yauzl": "^2.10.0"
}
}
36 changes: 23 additions & 13 deletions packages/kbn-es/src/utils/decompress.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,40 @@
*/

const { decompress } = require('./decompress');
const mockFs = require('mock-fs');
const fs = require('fs');
const path = require('path');
const mkdirp = require('mkdirp');
const del = require('del');
const os = require('os');

const fixturesFolder = path.resolve(__dirname, '__fixtures__');
const randomDir = Math.random().toString(36);
const tmpFolder = path.resolve(os.tmpdir(), randomDir);
const dataFolder = path.resolve(tmpFolder, 'data');
const esFolder = path.resolve(tmpFolder, '.es');

const zipSnapshot = path.resolve(dataFolder, 'snapshot.zip');
const tarGzSnapshot = path.resolve(dataFolder, 'snapshot.tar.gz');

beforeEach(() => {
mockFs({
'/data': {
'snapshot.zip': fs.readFileSync(path.resolve(__dirname, '__fixtures__/snapshot.zip')),
'snapshot.tar.gz': fs.readFileSync(path.resolve(__dirname, '__fixtures__/snapshot.tar.gz')),
},
'/.es': {},
});
mkdirp.sync(tmpFolder);
mkdirp.sync(dataFolder);
mkdirp.sync(esFolder);

fs.copyFileSync(path.resolve(fixturesFolder, 'snapshot.zip'), zipSnapshot);
fs.copyFileSync(path.resolve(fixturesFolder, 'snapshot.tar.gz'), tarGzSnapshot);
});

afterEach(() => {
mockFs.restore();
del.sync(tmpFolder, { force: true });
});

test('zip strips root directory', async () => {
await decompress('/data/snapshot.zip', '/.es/foo');
expect(fs.readdirSync('/.es/foo/bin')).toContain('elasticsearch.bat');
await decompress(zipSnapshot, path.resolve(esFolder, 'foo'));
expect(fs.readdirSync(path.resolve(esFolder, 'foo/bin'))).toContain('elasticsearch.bat');
});

test('tar strips root directory', async () => {
await decompress('/data/snapshot.tar.gz', '/.es/foo');
expect(fs.readdirSync('/.es/foo/bin')).toContain('elasticsearch');
await decompress(tarGzSnapshot, path.resolve(esFolder, 'foo'));
expect(fs.readdirSync(path.resolve(esFolder, 'foo/bin'))).toContain('elasticsearch');
});
24 changes: 12 additions & 12 deletions packages/kbn-es/src/utils/extract_config_files.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@
* under the License.
*/

jest.mock('fs', () => ({
readFileSync: jest.fn(),
existsSync: jest.fn().mockImplementation(() => true),
writeFileSync: jest.fn(),
}));

const { extractConfigFiles } = require('./extract_config_files');
const mockFs = require('mock-fs');
const fs = require('fs');

beforeEach(() => {
mockFs({
'/data': {
'foo.yml': '',
},
'/es': {},
});
afterEach(() => {
jest.clearAllMocks();
});

afterEach(() => {
mockFs.restore();
afterAll(() => {
jest.restoreAllMocks();
});

test('returns config with local paths', () => {
Expand All @@ -43,8 +43,8 @@ test('returns config with local paths', () => {
test('copies file', () => {
extractConfigFiles(['path=/data/foo.yml'], '/es');

expect(fs.existsSync('/es/config/foo.yml')).toBe(true);
expect(fs.existsSync('/data/foo.yml')).toBe(true);
expect(fs.readFileSync.mock.calls[0][0]).toEqual('/data/foo.yml');
expect(fs.writeFileSync.mock.calls[0][0]).toEqual('/es/config/foo.yml');
});

test('ignores non-paths', () => {
Expand Down
47 changes: 26 additions & 21 deletions packages/kbn-es/src/utils/find_most_recently_changed.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,38 @@
* under the License.
*/

const mockFs = require('mock-fs');
const { findMostRecentlyChanged } = require('./find_most_recently_changed');

beforeEach(() => {
mockFs({
'/data': {
'oldest.yml': mockFs.file({
content: 'foo',
jest.mock('fs', () => ({
statSync: jest.fn().mockImplementation(path => {
if (path.includes('oldest')) {
return {
ctime: new Date(2018, 2, 1),
}),
'newest.yml': mockFs.file({
content: 'bar',
};
}

if (path.includes('newest')) {
return {
ctime: new Date(2018, 2, 3),
}),
'middle.yml': mockFs.file({
content: 'baz',
};
}

if (path.includes('middle')) {
return {
ctime: new Date(2018, 2, 2),
}),
},
});
});
};
}
}),
readdirSync: jest.fn().mockImplementation(() => {
return ['oldest.yml', 'newest.yml', 'middle.yml'];
}),
}));

afterEach(() => {
mockFs.restore();
});
const { findMostRecentlyChanged } = require('./find_most_recently_changed');

test('returns newest file', () => {
const file = findMostRecentlyChanged('/data/*.yml');
expect(file).toEqual('/data/newest.yml');
});

afterAll(() => {
jest.restoreAllMocks();
});
2 changes: 1 addition & 1 deletion packages/kbn-i18n/src/__snapshots__/loader.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

exports[`I18n loader registerTranslationFile should throw error if path to translation file is not an absolute 1`] = `"Paths to translation files must be absolute. Got relative path: \\"./en.json\\""`;

exports[`I18n loader registerTranslationFile should throw error if path to translation file is not specified 1`] = `"Path must be a string. Received undefined"`;
exports[`I18n loader registerTranslationFile should throw error if path to translation file is not specified 1`] = `"The \\"path\\" argument must be of type string. Received type undefined"`;
2 changes: 1 addition & 1 deletion packages/kbn-plugin-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"dependencies": {
"chalk": "^2.4.1",
"dedent": "^0.7.0",
"execa": "^0.9.0",
"execa": "^1.0.0",
"getopts": "^2.0.0",
"lodash.camelcase": "^4.3.0",
"lodash.kebabcase": "^4.1.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-plugin-helpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"argv-split": "^2.0.1",
"commander": "^2.9.0",
"del": "^2.2.2",
"execa": "^0.10.0",
"execa": "^1.0.0",
"gulp-rename": "1.2.2",
"gulp-zip": "^4.1.0",
"inquirer": "^1.2.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

const { resolve } = require('path');
const { readdirSync, existsSync, unlink } = require('fs');
const { readdirSync, existsSync, unlinkSync } = require('fs');
const del = require('del');
const createBuild = require('../create_build');

Expand Down Expand Up @@ -96,7 +96,7 @@ describe('creating the build', () => {
afterEach(() => {
PLUGIN.skipInstallDependencies = false;
PLUGIN.styleSheetToCompile = undefined;
unlink(cssPath);
unlinkSync(cssPath);
});

it('produces CSS', async () => {
Expand Down
Loading