Skip to content

Commit

Permalink
add script to update VSCode config with proper excludes (elastic#110161)
Browse files Browse the repository at this point in the history
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
3 people committed Aug 30, 2021
1 parent 2bd570d commit 493d0b4
Show file tree
Hide file tree
Showing 13 changed files with 725 additions and 68 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@
"devDependencies": {
"@babel/cli": "^7.12.10",
"@babel/core": "^7.12.10",
"@babel/generator": "^7.12.11",
"@babel/parser": "^7.12.11",
"@babel/plugin-proposal-class-properties": "^7.12.1",
"@babel/plugin-proposal-export-namespace-from": "^7.12.1",
Expand Down
2 changes: 2 additions & 0 deletions packages/kbn-dev-utils/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ RUNTIME_DEPS = [
"@npm//load-json-file",
"@npm//markdown-it",
"@npm//normalize-path",
"@npm//prettier",
"@npm//rxjs",
"@npm//tar",
"@npm//tree-kill",
Expand All @@ -81,6 +82,7 @@ TYPES_DEPS = [
"@npm//@types/markdown-it",
"@npm//@types/node",
"@npm//@types/normalize-path",
"@npm//@types/prettier",
"@npm//@types/react",
"@npm//@types/tar",
"@npm//@types/testing-library__jest-dom",
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-dev-utils/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ export * from './plugins';
export * from './streams';
export * from './babel';
export * from './extract';
export * from './vscode_config';
9 changes: 9 additions & 0 deletions packages/kbn-dev-utils/src/vscode_config/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* 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.
*/

export * from './update_vscode_config_cli';
40 changes: 40 additions & 0 deletions packages/kbn-dev-utils/src/vscode_config/managed_config_keys.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* 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.
*/

export interface ManagedConfigKey {
key: string;
value: Record<string, any>;
}

/**
* Defines the keys which we overrite in user's vscode config for the workspace. We currently
* only support object values because that's all we needed to support, but support for non object
* values should be easy to add.
*/
export const MANAGED_CONFIG_KEYS: ManagedConfigKey[] = [
{
key: 'files.watcherExclude',
value: {
['**/.eslintcache']: true,
['**/.es']: true,
['**/.yarn-local-mirror']: true,
['**/.chromium']: true,
['**/packages/kbn-pm/dist/index.js']: true,
['**/bazel-*']: true,
['**/node_modules']: true,
['**/target']: true,
['**/*.log']: true,
},
},
{
key: 'search.exclude',
value: {
['**/packages/kbn-pm/dist/index.js']: true,
},
},
];
Loading

0 comments on commit 493d0b4

Please sign in to comment.