From 2eb0bb4672882c161b1ec5680a8a7fcb84dc1e6a Mon Sep 17 00:00:00 2001 From: Tyler Smalley Date: Wed, 17 Feb 2021 16:46:37 -0800 Subject: [PATCH] [bootstrap] No longer build TS refs automatically Signed-off-by: Tyler Smalley --- packages/kbn-pm/dist/index.js | 4 ++++ packages/kbn-pm/src/commands/bootstrap.ts | 6 ++++++ scripts/build_ts_refs.js | 7 ++++++- test/scripts/jenkins_build_ts_refs.sh | 6 ++++++ vars/tasks.groovy | 3 +++ 5 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 test/scripts/jenkins_build_ts_refs.sh diff --git a/packages/kbn-pm/dist/index.js b/packages/kbn-pm/dist/index.js index 1b8bd4784e583..7f98f26be94ff 100644 --- a/packages/kbn-pm/dist/index.js +++ b/packages/kbn-pm/dist/index.js @@ -8984,6 +8984,10 @@ const BootstrapCommand = { _utils_log__WEBPACK_IMPORTED_MODULE_2__["log"].success(`[${project.name}] bootstrap complete`); } }); + + if (!process.env.BUILD_TS_REFS_ON_BOOTSTRAP) { + _utils_log__WEBPACK_IMPORTED_MODULE_2__["log"].info('For IDE TypeScript support run `node scripts/build_ts_refs` or set BUILD_TS_REFS_ON_BOOTSTRAP=true'); + } } }; diff --git a/packages/kbn-pm/src/commands/bootstrap.ts b/packages/kbn-pm/src/commands/bootstrap.ts index 98fcd71c3ac38..10dbe37b1cff3 100644 --- a/packages/kbn-pm/src/commands/bootstrap.ts +++ b/packages/kbn-pm/src/commands/bootstrap.ts @@ -111,5 +111,11 @@ export const BootstrapCommand: ICommand = { log.success(`[${project.name}] bootstrap complete`); } }); + + if (!process.env.BUILD_TS_REFS_ON_BOOTSTRAP) { + log.info( + 'For IDE TypeScript support run `node scripts/build_ts_refs` or set BUILD_TS_REFS_ON_BOOTSTRAP=true' + ); + } }, }; diff --git a/scripts/build_ts_refs.js b/scripts/build_ts_refs.js index a4ee6ec491ef1..b3d05bfa819be 100644 --- a/scripts/build_ts_refs.js +++ b/scripts/build_ts_refs.js @@ -7,4 +7,9 @@ */ require('../src/setup_node_env'); -require('../src/dev/typescript').runBuildRefsCli(); + +if (!process.env.npm_lifecycle_event || process.env.BUILD_TS_REFS_ON_BOOTSTRAP) { + require('../src/dev/typescript').runBuildRefsCli(); +} else { + console.warn('ran from yarn script without env BUILD_TS_REFS_ON_BOOTSTRAP=true'); +} diff --git a/test/scripts/jenkins_build_ts_refs.sh b/test/scripts/jenkins_build_ts_refs.sh new file mode 100644 index 0000000000000..b44ced61e3854 --- /dev/null +++ b/test/scripts/jenkins_build_ts_refs.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +source src/dev/ci_setup/setup_env.sh + +checks-reporter-with-killswitch "Build Typescript References" \ + node scripts/build_ts_refs.js diff --git a/vars/tasks.groovy b/vars/tasks.groovy index 846eed85fb076..9f9384147224a 100644 --- a/vars/tasks.groovy +++ b/vars/tasks.groovy @@ -18,6 +18,9 @@ def check() { kibanaPipeline.scriptTask('Verify NOTICE', 'test/scripts/checks/verify_notice.sh'), kibanaPipeline.scriptTask('Test Projects', 'test/scripts/checks/test_projects.sh'), kibanaPipeline.scriptTask('Test Hardening', 'test/scripts/checks/test_hardening.sh'), + dir("${env.WORKSPACE}/kibana") { + kibanaPipeline.scriptTask('Build TS Refs', 'test/scripts/jenkins_build_ts_refs.sh')() + } ]) }