Skip to content

Commit 18f19d3

Browse files
committed
Merge remote-tracking branch 'upstream/master' into alerting_expose_default_action_group_as_props
# Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
2 parents 27718f8 + f6dc674 commit 18f19d3

File tree

1,005 files changed

+8530
-2456
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,005 files changed

+8530
-2456
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,9 @@ Granted that you share your thoughts, we might even be able to come up with crea
5555

5656
First of all, **sorry about that!** We want you to have a great time with Kibana.
5757

58-
Hosting meaningful discussions on GitHub can be challenging. For that reason, we'll sometimes ask that you join us on IRC _([#kibana](https://kiwiirc.com/client/irc.freenode.net/?#kibana) on freenode)_ to chat about your issues. You may also experience **faster response times** when engaging us via IRC.
59-
6058
There's hundreds of open issues and prioritizing what to work on is an important aspect of our daily jobs. We prioritize issues according to impact and difficulty, so some issues can be neglected while we work on more pressing issues.
6159

62-
Feel free to bump your issues if you think they've been neglected for a prolonged period, or just jump on IRC and let us have it!
60+
Feel free to bump your issues if you think they've been neglected for a prolonged period.
6361

6462
### "I want to help!"
6563

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
"@kbn/ui-framework": "1.0.0",
141141
"@kbn/ui-shared-deps": "1.0.0",
142142
"JSONStream": "1.3.5",
143-
"abort-controller": "^3.0.0",
143+
"abortcontroller-polyfill": "^1.4.0",
144144
"angular": "^1.7.9",
145145
"angular-aria": "^1.7.9",
146146
"angular-elastic": "^2.5.1",

packages/kbn-optimizer/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"node-sass": "^4.13.0",
3232
"postcss-loader": "^3.0.0",
3333
"raw-loader": "^3.1.0",
34+
"resolve-url-loader": "^3.1.1",
3435
"rxjs": "^6.5.3",
3536
"sass-loader": "^8.0.2",
3637
"style-loader": "^1.1.3",

packages/kbn-optimizer/src/integration_tests/basic_optimization.test.ts

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const MOCK_REPO_DIR = Path.resolve(TMP_DIR, 'mock_repo');
3333

3434
expect.addSnapshotSerializer(createAbsolutePathSerializer(MOCK_REPO_DIR));
3535

36-
beforeEach(async () => {
36+
beforeAll(async () => {
3737
await del(TMP_DIR);
3838
await cpy('**/*', MOCK_REPO_DIR, {
3939
cwd: MOCK_REPO_SRC,
@@ -42,7 +42,7 @@ beforeEach(async () => {
4242
});
4343
});
4444

45-
afterEach(async () => {
45+
afterAll(async () => {
4646
await del(TMP_DIR);
4747
});
4848

@@ -153,3 +153,32 @@ it('builds expected bundles, saves bundle counts to metadata', async () => {
153153
]
154154
`);
155155
});
156+
157+
it('uses cache on second run and exist cleanly', async () => {
158+
const config = OptimizerConfig.create({
159+
repoRoot: MOCK_REPO_DIR,
160+
pluginScanDirs: [Path.resolve(MOCK_REPO_DIR, 'plugins')],
161+
maxWorkerCount: 1,
162+
});
163+
164+
const msgs = await runOptimizer(config)
165+
.pipe(
166+
tap(state => {
167+
if (state.event?.type === 'worker stdio') {
168+
// eslint-disable-next-line no-console
169+
console.log('worker', state.event.stream, state.event.chunk.toString('utf8'));
170+
}
171+
}),
172+
toArray()
173+
)
174+
.toPromise();
175+
176+
expect(msgs.map(m => m.state.phase)).toMatchInlineSnapshot(`
177+
Array [
178+
"initializing",
179+
"initializing",
180+
"initializing",
181+
"initialized",
182+
]
183+
`);
184+
});

packages/kbn-optimizer/src/optimizer/handle_optimizer_completion.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ export function handleOptimizerCompletion(config: OptimizerConfig) {
4444
return;
4545
}
4646

47+
if (prevState?.phase === 'initialized' && prevState.onlineBundles.length === 0) {
48+
// all bundles cached
49+
return;
50+
}
51+
4752
if (prevState?.phase === 'issue') {
4853
throw createFailError('webpack issue');
4954
}

packages/kbn-optimizer/src/worker/webpack.config.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,27 @@ export function getWebpackConfig(bundle: Bundle, worker: WorkerConfig) {
126126
},
127127
},
128128
},
129+
{
130+
loader: 'resolve-url-loader',
131+
options: {
132+
join: (_: string, __: any) => (uri: string, base?: string) => {
133+
if (!base) {
134+
return null;
135+
}
136+
137+
// manually force ui/* urls in legacy styles to resolve to ui/legacy/public
138+
if (uri.startsWith('ui/') && base.split(Path.sep).includes('legacy')) {
139+
return Path.resolve(
140+
worker.repoRoot,
141+
'src/legacy/ui/public',
142+
uri.replace('ui/', '')
143+
);
144+
}
145+
146+
return null;
147+
},
148+
},
149+
},
129150
{
130151
loader: 'sass-loader',
131152
options: {

packages/kbn-pm/dist/index.js

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43046,21 +43046,28 @@ module.exports = require("tty");
4304643046
const os = __webpack_require__(11);
4304743047
const hasFlag = __webpack_require__(12);
4304843048

43049-
const env = process.env;
43049+
const {env} = process;
4305043050

4305143051
let forceColor;
4305243052
if (hasFlag('no-color') ||
4305343053
hasFlag('no-colors') ||
43054-
hasFlag('color=false')) {
43055-
forceColor = false;
43054+
hasFlag('color=false') ||
43055+
hasFlag('color=never')) {
43056+
forceColor = 0;
4305643057
} else if (hasFlag('color') ||
4305743058
hasFlag('colors') ||
4305843059
hasFlag('color=true') ||
4305943060
hasFlag('color=always')) {
43060-
forceColor = true;
43061+
forceColor = 1;
4306143062
}
4306243063
if ('FORCE_COLOR' in env) {
43063-
forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;
43064+
if (env.FORCE_COLOR === true || env.FORCE_COLOR === 'true') {
43065+
forceColor = 1;
43066+
} else if (env.FORCE_COLOR === false || env.FORCE_COLOR === 'false') {
43067+
forceColor = 0;
43068+
} else {
43069+
forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
43070+
}
4306443071
}
4306543072

4306643073
function translateLevel(level) {
@@ -43077,7 +43084,7 @@ function translateLevel(level) {
4307743084
}
4307843085

4307943086
function supportsColor(stream) {
43080-
if (forceColor === false) {
43087+
if (forceColor === 0) {
4308143088
return 0;
4308243089
}
4308343090

@@ -43091,11 +43098,15 @@ function supportsColor(stream) {
4309143098
return 2;
4309243099
}
4309343100

43094-
if (stream && !stream.isTTY && forceColor !== true) {
43101+
if (stream && !stream.isTTY && forceColor === undefined) {
4309543102
return 0;
4309643103
}
4309743104

43098-
const min = forceColor ? 1 : 0;
43105+
const min = forceColor || 0;
43106+
43107+
if (env.TERM === 'dumb') {
43108+
return min;
43109+
}
4309943110

4310043111
if (process.platform === 'win32') {
4310143112
// Node.js 7.5.0 is the first version of Node.js to include a patch to
@@ -43156,10 +43167,6 @@ function supportsColor(stream) {
4315643167
return 1;
4315743168
}
4315843169

43159-
if (env.TERM === 'dumb') {
43160-
return min;
43161-
}
43162-
4316343170
return min;
4316443171
}
4316543172

packages/kbn-ui-shared-deps/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"devDependencies": {
1212
"@elastic/charts": "^17.0.2",
13-
"abort-controller": "^3.0.0",
13+
"abortcontroller-polyfill": "^1.4.0",
1414
"@elastic/eui": "19.0.0",
1515
"@kbn/dev-utils": "1.0.0",
1616
"@kbn/i18n": "1.0.0",

packages/kbn-ui-shared-deps/polyfills.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ require('core-js/stable');
2121
require('regenerator-runtime/runtime');
2222
require('custom-event-polyfill');
2323
require('whatwg-fetch');
24-
require('abort-controller/polyfill');
24+
require('abortcontroller-polyfill/dist/polyfill-patch-fetch');
2525
require('./vendor/childnode_remove_polyfill');
2626
require('symbol-observable');

packages/kbn-utility-types/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,12 @@ type B = UnwrapPromise<A>; // string
2020

2121
- `Ensure<T, X>` &mdash; Makes sure `T` is of type `X`.
2222
- `ObservableLike<T>` &mdash; Minimal interface for an object resembling an `Observable`.
23+
- `PublicContract<T>` &mdash; Returns an object with public keys only.
24+
- `PublicKeys<T>` &mdash; Returns public keys of an object.
2325
- `RecursiveReadonly<T>` &mdash; Like `Readonly<T>`, but freezes object recursively.
2426
- `ShallowPromise<T>` &mdash; Same as `Promise` type, but it flat maps the wrapped type.
27+
- `UnionToIntersection<T>` &mdash; Converts a union of types into an intersection.
2528
- `UnwrapObservable<T>` &mdash; Returns wrapped type of an observable.
2629
- `UnwrapPromise<T>` &mdash; Returns wrapped type of a promise.
2730
- `UnwrapPromiseOrReturn<T>` &mdash; Returns wrapped type of a promise or the type itself, if it isn't a promise.
31+
- `Values<T>` &mdash; Returns object or array value types.

0 commit comments

Comments
 (0)