-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into reporting/fix-deprecation-test
- Loading branch information
Showing
260 changed files
with
6,736 additions
and
1,321 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Synchronize all pushes to 'master' branch with 'main' branch to facilitate migration | ||
name: "Sync main branch" | ||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
sync_latest_from_upstream: | ||
runs-on: ubuntu-latest | ||
name: Sync latest commits from master branch | ||
|
||
steps: | ||
- name: Checkout target repo | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: main | ||
|
||
- name: Sync upstream changes | ||
id: sync | ||
uses: aormsby/[email protected] | ||
with: | ||
target_sync_branch: main | ||
target_repo_token: ${{ secrets.KIBANAMACHINE_TOKEN }} | ||
upstream_sync_branch: master | ||
upstream_sync_repo: elastic/kibana |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
/* eslint-disable no-restricted-syntax */ | ||
|
||
export class Bar {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
/* eslint-disable no-restricted-syntax */ | ||
|
||
export const one = 1; | ||
export const two = 2; | ||
export const three = 3; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
/* eslint-disable no-restricted-syntax */ | ||
|
||
export type { Bar as ReexportedClass } from './bar'; | ||
|
||
export const someConst = 'bar'; | ||
|
||
// eslint-disable-next-line prefer-const | ||
export let someLet = 'bar'; | ||
|
||
export function someFunction() {} | ||
|
||
export class SomeClass {} | ||
|
||
export interface SomeInterface { | ||
prop: number; | ||
} | ||
|
||
export enum SomeEnum { | ||
a = 'a', | ||
b = 'b', | ||
} | ||
|
||
export type TypeAlias = string[]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
/* eslint-disable no-restricted-syntax */ | ||
|
||
export * from './foo'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
const t = require('@babel/types'); | ||
const { default: generate } = require('@babel/generator'); | ||
|
||
/** @typedef {import('./export_set').ExportSet} ExportSet */ | ||
|
||
/** | ||
* Generate code for replacing a `export * from './path'`, ie. | ||
* | ||
* export type { foo } from './path' | ||
* export { bar } from './path' | ||
* @param {ExportSet} exportSet | ||
* @param {string} source | ||
*/ | ||
const getExportCode = (exportSet, source) => { | ||
const exportedTypes = exportSet.types.size | ||
? t.exportNamedDeclaration( | ||
undefined, | ||
Array.from(exportSet.types).map((n) => t.exportSpecifier(t.identifier(n), t.identifier(n))), | ||
t.stringLiteral(source) | ||
) | ||
: undefined; | ||
|
||
if (exportedTypes) { | ||
exportedTypes.exportKind = 'type'; | ||
} | ||
|
||
const exportedValues = exportSet.values.size | ||
? t.exportNamedDeclaration( | ||
undefined, | ||
Array.from(exportSet.values).map((n) => | ||
t.exportSpecifier(t.identifier(n), t.identifier(n)) | ||
), | ||
t.stringLiteral(source) | ||
) | ||
: undefined; | ||
|
||
return generate(t.program([exportedTypes, exportedValues].filter(Boolean))).code; | ||
}; | ||
|
||
/** | ||
* Generate code for replacing a `export * as name from './path'`, ie. | ||
* | ||
* import { foo, bar } from './path' | ||
* export const name = { foo, bar } | ||
* | ||
* @param {string} nsName | ||
* @param {string[]} exportNames | ||
* @param {string} source | ||
*/ | ||
const getExportNamedNamespaceCode = (nsName, exportNames, source) => { | ||
return generate( | ||
t.program([ | ||
t.importDeclaration( | ||
exportNames.map((n) => t.importSpecifier(t.identifier(n), t.identifier(n))), | ||
t.stringLiteral(source) | ||
), | ||
t.exportNamedDeclaration( | ||
t.variableDeclaration('const', [ | ||
t.variableDeclarator( | ||
t.identifier(nsName), | ||
t.objectExpression( | ||
exportNames.map((n) => | ||
t.objectProperty(t.identifier(n), t.identifier(n), false, true) | ||
) | ||
) | ||
), | ||
]) | ||
), | ||
]) | ||
).code; | ||
}; | ||
|
||
module.exports = { getExportCode, getExportNamedNamespaceCode }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
/** | ||
* Helper class to collect exports of different types, either "value" exports or "type" exports | ||
*/ | ||
class ExportSet { | ||
constructor() { | ||
/** @type {Set<string>} */ | ||
this.values = new Set(); | ||
|
||
/** @type {Set<string>} */ | ||
this.types = new Set(); | ||
} | ||
|
||
get size() { | ||
return this.values.size + this.types.size; | ||
} | ||
|
||
/** | ||
* @param {'value'|'type'} type | ||
* @param {string} value | ||
*/ | ||
add(type, value) { | ||
this[type + 's'].add(value); | ||
} | ||
} | ||
|
||
module.exports = { ExportSet }; |
Oops, something went wrong.