diff --git a/kbn_pm/src/commands/bootstrap/bootstrap_command.mjs b/kbn_pm/src/commands/bootstrap/bootstrap_command.mjs index 94532fa99673b..6a53f6e1d30c8 100644 --- a/kbn_pm/src/commands/bootstrap/bootstrap_command.mjs +++ b/kbn_pm/src/commands/bootstrap/bootstrap_command.mjs @@ -62,7 +62,6 @@ export const command = { const quiet = args.getBooleanValue('quiet') ?? false; const vscodeConfig = !IS_CI && (args.getBooleanValue('vscode') ?? !process.env.KBN_BOOTSTRAP_NO_VSCODE); - const allowRoot = args.getBooleanValue('allow-root') ?? false; const forceInstall = args.getBooleanValue('force-install'); const shouldInstall = forceInstall || !(await areNodeModulesPresent()) || !(await checkYarnIntegrity(log)); @@ -105,40 +104,49 @@ export const command = { } }); - await time('pre-build webpack bundles for packages', async () => { - log.info('pre-build webpack bundles for packages'); - await run( - 'yarn', - ['kbn', 'build-shared'] - .concat(quiet ? ['--quiet'] : []) - .concat(forceInstall ? ['--no-cache'] : []) - .concat(allowRoot ? ['--allow-root'] : []), - { - pipe: true, - } - ); - log.success('shared webpack bundles built'); - }); - - await time('sort package json', async () => { - await sortPackageJson(log); - }); - - await Promise.all([ + const backgroundTasks = [ validate ? time('validate dependencies', async () => { // now that deps are installed we can import `@kbn/yarn-lock-validator` const { readYarnLock, validateDependencies } = External['@kbn/yarn-lock-validator'](); await validateDependencies(log, await readYarnLock()); + log.success('yarn.lock analysis completed without any issues'); }) : undefined, vscodeConfig ? time('update vscode config', async () => { // Update vscode settings - await run('node', ['scripts/update_vscode_config']); + const moonArgs = ['run', 'kibana:update-vscode-config']; + if (forceInstall) { + moonArgs.push('--force', '--updateCache'); + } + await run('moon', moonArgs); log.success('vscode config updated'); }) : undefined, - ]); + ]; + + await time('pre-build webpack bundles for packages', async () => { + log.info('pre-build webpack bundles for packages'); + const moonArgs = ['run', ':build-webpack']; + if (quiet) { + moonArgs.push('--quiet'); + } + if (forceInstall) { + moonArgs.push('--updateCache', '--force'); + } + await run('moon', moonArgs, { + pipe: !quiet, + }); + log.success('shared webpack bundles built'); + }); + + await time('sort package json', async () => { + await sortPackageJson(log); + }); + + await Promise.all(backgroundTasks); + + log.success('bootstrap complete'); }, }; diff --git a/moon.yml b/moon.yml index e4977413e6d89..9e77cd3142744 100644 --- a/moon.yml +++ b/moon.yml @@ -18,6 +18,19 @@ tasks: cache: false bootstrap: script: yarn kbn bootstrap + update-vscode-config: + script: node scripts/update_vscode_config.js + inputs: + - "packages/kbn-managed-vscode-config/src/**/*.ts" + - "packages/kbn-managed-vscode-config/index.ts" + - "packages/kbn-managed-vscode-config-cli/index.ts" + - "packages/kbn-kibana-manifest-schema/src/**/*.ts" + outputs: + - ".vscode/settings.json" + - ".vscode/kibana-*.json" + options: + cache: true + workspace: inheritedTasks: diff --git a/packages/kbn-yarn-lock-validator/src/validate_yarn_lock.ts b/packages/kbn-yarn-lock-validator/src/validate_yarn_lock.ts index e2a840be3e06e..33b77d6be7fc0 100644 --- a/packages/kbn-yarn-lock-validator/src/validate_yarn_lock.ts +++ b/packages/kbn-yarn-lock-validator/src/validate_yarn_lock.ts @@ -113,6 +113,4 @@ export async function validateDependencies(log: SomeDevLog, yarnLock: YarnLock) process.exit(1); } - - log.success('yarn.lock analysis completed without any issues'); }